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

Unified Diff: chrome/browser/extensions/api/declarative/url_matcher.cc

Issue 9844028: Implement rules removal for WebRequestRulesRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 9 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: chrome/browser/extensions/api/declarative/url_matcher.cc
diff --git a/chrome/browser/extensions/api/declarative/url_matcher.cc b/chrome/browser/extensions/api/declarative/url_matcher.cc
index 91ee8b55c7ac3468def1e2b71ab4fdf938cd3d61..30993cd888ad9eb2979f995e6770f337c3b30fd5 100644
--- a/chrome/browser/extensions/api/declarative/url_matcher.cc
+++ b/chrome/browser/extensions/api/declarative/url_matcher.cc
@@ -344,6 +344,10 @@ void URLMatcherConditionFactory::ForgetUnusedPatterns(
}
}
+bool URLMatcherConditionFactory::IsEmpty() const {
+ return pattern_singletons_.empty();
+}
+
URLMatcherCondition URLMatcherConditionFactory::CreateCondition(
URLMatcherCondition::Criterion criterion,
const std::string& pattern) {
@@ -480,6 +484,16 @@ std::set<URLMatcherConditionSet::ID> URLMatcher::MatchURL(const GURL& url) {
return result;
}
+bool URLMatcher::IsEmpty() const {
+ return condition_factory_.IsEmpty() &&
+ url_matcher_condition_sets_.empty() &&
+ substring_match_triggers_.empty() &&
+ full_url_matcher_.IsEmpty() &&
+ url_component_matcher_.IsEmpty() &&
+ registered_full_url_patterns_.empty() &&
+ registered_url_component_patterns_.empty();
+}
+
void URLMatcher::UpdateSubstringSetMatcher(bool full_url_conditions) {
// The purpose of |full_url_conditions| is just that we need to execute
// the same logic once for Full URL searches and once for URL Component

Powered by Google App Engine
This is Rietveld 408576698