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

Side by Side Diff: lib/matcher.js

Issue 29961555: Issue 7162 - Add isWhitelisted method to CombinedMatcher (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Dec. 9, 2018, 11:54 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 | « no previous file | test/matcher.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-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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 result = this._matchesAnyInternal(location, typeMask, docDomain, 421 result = this._matchesAnyInternal(location, typeMask, docDomain,
422 thirdParty, sitekey, specificOnly); 422 thirdParty, sitekey, specificOnly);
423 423
424 if (this._resultCache.size >= this.maxCacheEntries) 424 if (this._resultCache.size >= this.maxCacheEntries)
425 this._resultCache.clear(); 425 this._resultCache.clear();
426 426
427 this._resultCache.set(key, result); 427 this._resultCache.set(key, result);
428 428
429 return result; 429 return result;
430 } 430 }
431
432 /**
433 * Tests whether the URL is whitelisted
434 * @see Matcher#matchesAny
435 * @inheritdoc
436 * @returns {boolean}
437 */
438 isWhitelisted(location, typeMask, docDomain, thirdParty, sitekey,
439 specificOnly)
440 {
441 return !!this._whitelist.matchesAny(location, typeMask, docDomain,
442 thirdParty, sitekey, specificOnly);
443 }
hub 2018/12/11 13:59:54 do we use this anywhere?
Manish Jethani 2018/12/12 00:48:06 We will call this function from lib/filterComposer
hub 2018/12/12 07:27:09 Acknowledged.
431 } 444 }
432 445
433 exports.CombinedMatcher = CombinedMatcher; 446 exports.CombinedMatcher = CombinedMatcher;
434 447
435 /** 448 /**
436 * Shared {@link CombinedMatcher} instance that should usually be used. 449 * Shared {@link CombinedMatcher} instance that should usually be used.
437 * @type {CombinedMatcher} 450 * @type {CombinedMatcher}
438 */ 451 */
439 let defaultMatcher = new CombinedMatcher(); 452 let defaultMatcher = new CombinedMatcher();
440 453
441 exports.defaultMatcher = defaultMatcher; 454 exports.defaultMatcher = defaultMatcher;
OLDNEW
« no previous file with comments | « no previous file | test/matcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld