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

Unified Diff: chrome/browser/content_settings/content_settings_pattern.h

Issue 7049007: Origin Identifier Value Map. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 7 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/content_settings/content_settings_pattern.h
diff --git a/chrome/browser/content_settings/content_settings_pattern.h b/chrome/browser/content_settings/content_settings_pattern.h
index 4b55683c81d473f4e99e9afcfe1fc09d72a86723..e7f5c59d623b8983eae17b177ff60b80199af86a 100644
--- a/chrome/browser/content_settings/content_settings_pattern.h
+++ b/chrome/browser/content_settings/content_settings_pattern.h
@@ -27,20 +27,32 @@ class ContentSettingsPattern {
// sets they describe, have specific relations. |Relation| describes the
// relation of two patterns A and B. When pattern A is compared with pattern B
// (A compare B) interessting relations are:
- // - IDENTITY : Pattern A and B are identical. The patterns are equal.
- // - DISJOINT : Pattern A and B have no intersection. A and B never match
- // a the origin of a URL at the same time.
- // - SUCCESSOR : Pattern A and B have an intersection. But pattern B has a
- // higher precedence than pattern A for URLs that are matched
- // by both pattern.
- // - PREDECESSOR : Pattern A and B have an intersection. But pattern A has a
- // higher precedence than pattern B for URLs that are matched
- // by both pattern.
+ // - IDENTITY :
+ // Pattern A and B are identical. The patterns are equal.
+ //
+ // - DISJOINT_DISPLAY_PRE :
Bernhard Bauer 2011/06/01 20:18:25 It's called _ORDER_ below.
markusheintz_ 2011/06/03 13:08:54 Done. In forked CL
+ // Pattern A and B have no intersection. A and B never match the origin of
+ // a URL at the same time. But pattern A has a higher precedence than
+ // pattern B when patterns are sorted.
+ //
+ // - DISJOINT_DISPLAY_POST :
+ // Pattern A and B have no intersection. A and B never match the origin of
+ // a URL at the same time. But pattern A has a lower precedence than
+ // pattern B when patterns are sorted.
+ //
+ // - SUCCESSOR :
+ // Pattern A and B have an intersection. But pattern B has a higher
+ // precedence than pattern A for URLs that are matched by both pattern.
+ //
+ // - PREDECESSOR :
+ // Pattern A and B have an intersection. But pattern A has a higher
+ // precedence than pattern B for URLs that are matched by both pattern.
enum Relation {
- DISJOINT = -2,
+ DISJOINT_ORDER_POST = -2,
SUCCESSOR = -1,
IDENTITY = 0,
PREDECESSOR = 1,
+ DISJOINT_ORDER_PRE = 2,
};
class BuilderInterface {
@@ -118,9 +130,17 @@ class ContentSettingsPattern {
// |Relation| of the two patterns.
Relation Compare(const ContentSettingsPattern& other) const;
- bool operator==(const ContentSettingsPattern& other) const {
- return Compare(other) == IDENTITY;
- }
+ // Returns true if the pattern and the |other| pattern are identical.
+ bool operator==(const ContentSettingsPattern& other) const;
+
+ // Returns true if the pattern and the |other| pattern are disjoint.
+ bool operator!=(const ContentSettingsPattern& other) const;
Bernhard Bauer 2011/06/01 20:18:25 That seems like it could cause very subtle problem
markusheintz_ 2011/06/03 13:08:54 I also have a bad feeling about his. So I removed
+
+ // Returns true if the pattern has a lower priority than the |other| pattern.
+ bool operator<(const ContentSettingsPattern& other) const;
+
+ // Returns true if the pattern has a higher priority than the |other| pattern.
+ bool operator>(const ContentSettingsPattern& other) const;
private:
friend class content_settings::PatternParser;

Powered by Google App Engine
This is Rietveld 408576698