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

Unified Diff: chrome/common/extensions/url_pattern_set.h

Issue 7432006: Add an experimental permissions API for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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: chrome/common/extensions/url_pattern_set.h
diff --git a/chrome/common/extensions/url_pattern_set.h b/chrome/common/extensions/url_pattern_set.h
index 1848e746247f042223c9a4cfa2d8fdedec1ca1c4..d26321c522b9d1125c2624a3a8c20a9e235853eb 100644
--- a/chrome/common/extensions/url_pattern_set.h
+++ b/chrome/common/extensions/url_pattern_set.h
@@ -18,6 +18,17 @@ class URLPatternSet {
typedef std::set<URLPattern>::const_iterator const_iterator;
typedef std::set<URLPattern>::iterator iterator;
+ // Clears |out| and populates the set with |set1| - |set2|.
+ static void CreateDifference(const URLPatternSet& set1,
+ const URLPatternSet& set2,
+ URLPatternSet* out);
+
+ // Clears |out| and populates the set with the intersection of |set1|
+ // and |set2|.
+ static void CreateIntersection(const URLPatternSet& set1,
+ const URLPatternSet& set2,
+ URLPatternSet* out);
+
// Clears |out| and populates the set with the union of |set1| and |set2|.
static void CreateUnion(const URLPatternSet& set1,
const URLPatternSet& set2,
@@ -39,6 +50,9 @@ class URLPatternSet {
void AddPattern(const URLPattern& pattern);
void ClearPatterns();
+ // Returns true if the permission |set| is a subset of this.
+ bool Contains(const URLPatternSet& set) const;
+
// Test if the extent contains a URL.
bool MatchesURL(const GURL& url) const;

Powered by Google App Engine
This is Rietveld 408576698