Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/whitelisting.js

Issue 5721433737003008: Issue 1985 - Replaced __proto__ with Object.create() and Object.getPrototypeOf() (Closed)
Patch Set: Created Feb. 11, 2015, 11:51 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/prefs.js ('k') | options.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 return verifySignature(key, signature, params.join("\0")); 75 return verifySignature(key, signature, params.join("\0"));
76 } 76 }
77 77
78 function recordKey(page, url, key) 78 function recordKey(page, url, key)
79 { 79 {
80 let urlsWithKey = pagesWithKey.get(page); 80 let urlsWithKey = pagesWithKey.get(page);
81 81
82 if (!urlsWithKey) 82 if (!urlsWithKey)
83 { 83 {
84 urlsWithKey = {__proto__: null}; 84 urlsWithKey = Object.create(null);
85 pagesWithKey.set(page, urlsWithKey); 85 pagesWithKey.set(page, urlsWithKey);
86 } 86 }
87 87
88 urlsWithKey[url] = key; 88 urlsWithKey[url] = key;
89 } 89 }
90 90
91 function processKey(token, page, frame) 91 function processKey(token, page, frame)
92 { 92 {
93 let url = stripFragmentFromURL(frame.url); 93 let url = stripFragmentFromURL(frame.url);
94 94
95 if (token.indexOf("_") < 0) 95 if (token.indexOf("_") < 0)
96 return; 96 return;
97 97
98 let [key, signature] = token.split("_", 2); 98 let [key, signature] = token.split("_", 2);
99 key = key.replace(/=/g, ""); 99 key = key.replace(/=/g, "");
100 100
101 if (verifyKey(key, signature, url)) 101 if (verifyKey(key, signature, url))
102 recordKey(page, url, key); 102 recordKey(page, url, key);
103 } 103 }
104 exports.processKey = processKey; 104 exports.processKey = processKey;
OLDNEW
« no previous file with comments | « lib/prefs.js ('k') | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld