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

Unified Diff: chrome/browser/extensions/api/declarative/substring_set_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/substring_set_matcher.cc
diff --git a/chrome/browser/extensions/api/declarative/substring_set_matcher.cc b/chrome/browser/extensions/api/declarative/substring_set_matcher.cc
index 847fff9099a567b41cfb629f293d703c76c2b064..af03601a775c30bd217e86a14811bf00e7e113bd 100644
--- a/chrome/browser/extensions/api/declarative/substring_set_matcher.cc
+++ b/chrome/browser/extensions/api/declarative/substring_set_matcher.cc
@@ -92,6 +92,11 @@ bool SubstringSetMatcher::Match(const std::string& text,
return old_number_of_matches != matches->size();
}
+bool SubstringSetMatcher::IsEmpty() const {
+ // An empty tree consists of only the root node.
+ return patterns_.empty() && tree_.size() == 1u;
+}
+
void SubstringSetMatcher::RebuildAhoCorasickTree() {
tree_.clear();

Powered by Google App Engine
This is Rietveld 408576698