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

Unified Diff: extensions/common/url_pattern_set.h

Issue 181043006: Implement correct logic for URLPatternSet set operators. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback. Created 6 years, 10 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
« no previous file with comments | « extensions/common/url_pattern.cc ('k') | extensions/common/url_pattern_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/url_pattern_set.h
diff --git a/extensions/common/url_pattern_set.h b/extensions/common/url_pattern_set.h
index da6ad132db183433d726363f5d291b9e412e0158..4ee7b42c3efdd0e3ee0edbafe6f01d5945ce7e8b 100644
--- a/extensions/common/url_pattern_set.h
+++ b/extensions/common/url_pattern_set.h
@@ -59,8 +59,9 @@ class URLPatternSet {
const_iterator begin() const { return patterns_.begin(); }
const_iterator end() const { return patterns_.end(); }
- // Adds a pattern to the set. Returns true if a new pattern was inserted,
- // false if the pattern was already in the set.
+ // Adds a pattern to the set. If a more general pattern is added, the more
+ // specific ones are removed from the set. Returns true if a new pattern was
+ // inserted, false if the pattern was already in the set.
bool AddPattern(const URLPattern& pattern);
// Adds all patterns from |set| into this.
@@ -96,6 +97,10 @@ class URLPatternSet {
std::string* error);
private:
+ // Directly inserts a pattern in the set without checking for more
+ // generic/more specific containment conditions.
+ bool InsertPattern(const URLPattern& pattern);
+
// The list of URL patterns that comprise the extent.
std::set<URLPattern> patterns_;
};
« no previous file with comments | « extensions/common/url_pattern.cc ('k') | extensions/common/url_pattern_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698