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

Delta Between Two Patch Sets: lib/whitelisting.js

Issue 29330321: Issue 3334 - Fix warnings spotted during testing before release (Closed)
Left Patch Set: Created Nov. 17, 2015, 4:44 p.m.
Right Patch Set: Remove redundant mapping for the large icon Created Nov. 17, 2015, 9:03 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | metadata.common » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 if (filter) 64 if (filter)
65 return true; 65 return true;
66 66
67 frame = parent; 67 frame = parent;
68 } 68 }
69 69
70 return false; 70 return false;
71 }; 71 };
72 72
73 let getKey =
73 /** 74 /**
74 * Gets the public key, previously recorded for the given page 75 * Gets the public key, previously recorded for the given page
75 * and frame, to be considered for the $sitekey filter option. 76 * and frame, to be considered for the $sitekey filter option.
76 * 77 *
77 * @param {Page} page 78 * @param {Page} page
78 * @param {Frame} frame 79 * @param {Frame} frame
79 * @return {string} 80 * @return {string}
80 */ 81 */
81 var getKey = exports.getKey = function(page, frame) 82 exports.getKey = function(page, frame)
Sebastian Noack 2015/11/17 17:02:58 This will break jsdoc. Instead use: let getKey =
kzar 2015/11/17 19:06:26 Done.
82 { 83 {
83 let urlsWithKey = pagesWithKey.get(page); 84 let urlsWithKey = pagesWithKey.get(page);
84 if (!urlsWithKey) 85 if (!urlsWithKey)
85 return null; 86 return null;
86 87
87 for (; frame != null; frame = frame.parent) 88 for (; frame != null; frame = frame.parent)
88 { 89 {
89 let key = urlsWithKey[stringifyURL(frame.url)]; 90 let key = urlsWithKey[stringifyURL(frame.url)];
90 if (key) 91 if (key)
91 return key; 92 return key;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 { 134 {
134 if (token.indexOf("_") < 0) 135 if (token.indexOf("_") < 0)
135 return; 136 return;
136 137
137 let [key, signature] = token.split("_", 2); 138 let [key, signature] = token.split("_", 2);
138 key = key.replace(/=/g, ""); 139 key = key.replace(/=/g, "");
139 140
140 if (verifyKey(key, signature, frame.url)) 141 if (verifyKey(key, signature, frame.url))
141 recordKey(page, frame.url, key); 142 recordKey(page, frame.url, key);
142 }; 143 };
LEFTRIGHT
« no previous file | metadata.common » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld