Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: components/subresource_filter/core/common/indexed_ruleset.cc

Issue 2167653002: Make the subresource filter support subdomain anchor matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more comments from engedy@ Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/core/common/indexed_ruleset.cc
diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/components/subresource_filter/core/common/indexed_ruleset.cc
index f6d7cc3dc6a7fa6115ed3aef55e0d4e67b17f409..31e7702453c7bbe089e3c8f0216388ef5d1d2b1d 100644
--- a/components/subresource_filter/core/common/indexed_ruleset.cc
+++ b/components/subresource_filter/core/common/indexed_ruleset.cc
@@ -382,8 +382,9 @@ IndexedRulesetMatcher::IndexedRulesetMatcher(const uint8_t* buffer, size_t size)
bool IndexedRulesetMatcher::IsAllowed(const GURL& url,
const url::Origin& initiator,
proto::ElementType element_type) const {
+ if (!url.is_valid())
+ return true;
const bool is_third_party = IsThirdPartyUrl(url, initiator);
-
return !IsMatch(root_->blacklist_index(), url, initiator, element_type,
is_third_party) ||
IsMatch(root_->whitelist_index(), url, initiator, element_type,

Powered by Google App Engine
This is Rietveld 408576698