diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 19:43:47 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 19:43:47 +0000 |
commit | b56676dbdd2c6a548e0b67d54e02272390b9be41 (patch) | |
tree | 3f23a22165c56db3193be45f7a01f8223f9a0d7b /extensions/common/url_pattern.h | |
parent | 59295c036d31be1aab70b03f7f45036d7658a364 (diff) | |
download | chromium_src-b56676dbdd2c6a548e0b67d54e02272390b9be41.zip chromium_src-b56676dbdd2c6a548e0b67d54e02272390b9be41.tar.gz chromium_src-b56676dbdd2c6a548e0b67d54e02272390b9be41.tar.bz2 |
Support requesting subsets of host permissions using the permissions API.
BUG=158004
TBR=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12209094
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/url_pattern.h')
-rw-r--r-- | extensions/common/url_pattern.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/extensions/common/url_pattern.h b/extensions/common/url_pattern.h index 42188a5..a6dfa74 100644 --- a/extensions/common/url_pattern.h +++ b/extensions/common/url_pattern.h @@ -149,9 +149,6 @@ class URLPattern { // Returns true if |test| matches our path. bool MatchesPath(const std::string& test) const; - // Returns true if |port| matches our port. - bool MatchesPort(int port) const; - // Sets the port. Returns false if the port is invalid. bool SetPort(const std::string& port); const std::string& port() const { return port_; } @@ -159,12 +156,16 @@ class URLPattern { // Returns a string representing this instance. const std::string& GetAsString() const; - // Determine whether there is a URL that would match this instance and another - // instance. This method is symmetrical: Calling other.OverlapsWith(this) - // would result in the same answer. + // Determines whether there is a URL that would match this instance and + // another instance. This method is symmetrical: Calling + // other.OverlapsWith(this) would result in the same answer. bool OverlapsWith(const URLPattern& other) const; - // Convert this URLPattern into an equivalent set of URLPatterns that don't + // Returns true if this pattern matches all possible URLs that |other| can + // match. For example, http://*.google.com encompasses http://www.google.com. + bool Contains(const URLPattern& other) const; + + // Converts this URLPattern into an equivalent set of URLPatterns that don't // use a wildcard in the scheme component. If this URLPattern doesn't use a // wildcard scheme, then the returned set will contain one element that is // equivalent to this instance. @@ -191,8 +192,14 @@ class URLPattern { // Returns true if any of the |schemes| items matches our scheme. bool MatchesAnyScheme(const std::vector<std::string>& schemes) const; + // Returns true if all of the |schemes| items matches our scheme. + bool MatchesAllSchemes(const std::vector<std::string>& schemes) const; + bool MatchesSecurityOriginHelper(const GURL& test) const; + // Returns true if our port matches the |port| pattern (it may be "*"). + bool MatchesPortPattern(const std::string& port) const; + // If the URLPattern contains a wildcard scheme, returns a list of // equivalent literal schemes, otherwise returns the current scheme. std::vector<std::string> GetExplicitSchemes() const; |