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

Unified Diff: lib/csp.js

Issue 29990559: Noissue - Avoid redundant lookup of whitelist CSP filter (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Jan. 25, 2019, 12:30 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/csp.js
===================================================================
--- a/lib/csp.js
+++ b/lib/csp.js
@@ -45,17 +45,17 @@
return;
// To avoid an extra matchesAny for the common case we assumed no
// $genericblock filters applied when searching for a matching $csp filter.
// We must now pay the price by first checking for a $genericblock filter
// and if necessary that our $csp filter is specific.
let specificOnly = !!checkWhitelisted(page, frame, null,
typeMap.GENERICBLOCK);
- if (specificOnly)
+ if (specificOnly && !(cspMatch instanceof WhitelistFilter))
{
cspMatch = defaultMatcher.matchesAny(details.url, typeMap.CSP, hostname,
thirdParty, null, specificOnly);
if (!cspMatch)
return;
}
logRequest([details.tabId], {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld