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

Delta Between Two Patch Sets: lib/matcher.js

Issue 29926557: Issue 6994 - Use shortcut matching for location-only filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Minor update Created Oct. 25, 2018, 9:22 p.m.
Right Patch Set: Fix comment Created Oct. 25, 2018, 9:27 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 | « lib/filterClasses.js ('k') | test/filterListener.js » ('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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 * @param {boolean} [thirdParty] 192 * @param {boolean} [thirdParty]
193 * @param {string} [sitekey] 193 * @param {string} [sitekey]
194 * @param {boolean} [specificOnly] 194 * @param {boolean} [specificOnly]
195 * @returns {?Filter} 195 * @returns {?Filter}
196 * @protected 196 * @protected
197 */ 197 */
198 checkEntryMatch(keyword, location, typeMask, docDomain, thirdParty, sitekey, 198 checkEntryMatch(keyword, location, typeMask, docDomain, thirdParty, sitekey,
199 specificOnly) 199 specificOnly)
200 { 200 {
201 // We need to skip the simple (location-only) filters if the type mask does 201 // We need to skip the simple (location-only) filters if the type mask does
202 // not contain any non-default content types like $document, $elemhide, 202 // not contain any default content types.
Manish Jethani 2018/10/25 21:28:40 Fixed the comment, it's actually the opposite.
203 // $csp, and so on.
204 if ((typeMask & RegExpFilter.prototype.contentType) != 0) 203 if ((typeMask & RegExpFilter.prototype.contentType) != 0)
205 { 204 {
206 let simpleSet = this._simpleFiltersByKeyword.get(keyword); 205 let simpleSet = this._simpleFiltersByKeyword.get(keyword);
207 if (simpleSet) 206 if (simpleSet)
208 { 207 {
209 for (let filter of simpleSet) 208 for (let filter of simpleSet)
210 { 209 {
211 if (specificOnly && !(filter instanceof WhitelistFilter)) 210 if (specificOnly && !(filter instanceof WhitelistFilter))
212 continue; 211 continue;
213 212
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 432
434 exports.CombinedMatcher = CombinedMatcher; 433 exports.CombinedMatcher = CombinedMatcher;
435 434
436 /** 435 /**
437 * Shared {@link CombinedMatcher} instance that should usually be used. 436 * Shared {@link CombinedMatcher} instance that should usually be used.
438 * @type {CombinedMatcher} 437 * @type {CombinedMatcher}
439 */ 438 */
440 let defaultMatcher = new CombinedMatcher(); 439 let defaultMatcher = new CombinedMatcher();
441 440
442 exports.defaultMatcher = defaultMatcher; 441 exports.defaultMatcher = defaultMatcher;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld