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

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

Issue 2876009: Re-implement app overlap detection with new extent syntax. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: donk Created 10 years, 6 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 | « chrome/common/extensions/extension_extent_unittest.cc ('k') | chrome/common/extensions/url_pattern.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/url_pattern.h
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h
index 62d3d8fbe5cd565fb8b04ec3a482f34afe9526e1..fd1cefe277800654563b8745a611c8419c86f05c 100644
--- a/chrome/common/extensions/url_pattern.h
+++ b/chrome/common/extensions/url_pattern.h
@@ -78,15 +78,6 @@ class URLPattern {
URLPattern() : match_subdomains_(false) {}
- // Initializes this instance by parsing the provided string. On failure, the
- // instance will have some intermediate values and is in an invalid state.
- bool Parse(const std::string& pattern_str);
-
- // Returns true if this instance matches the specified URL.
- bool MatchesUrl(const GURL& url) const;
-
- std::string GetAsString() const;
-
// Get the scheme the pattern matches. This will always return a valid scheme
// if is_valid() returns true.
std::string scheme() const { return scheme_; }
@@ -109,12 +100,28 @@ class URLPattern {
path_escaped_ = "";
}
+ // Initializes this instance by parsing the provided string. On failure, the
+ // instance will have some intermediate values and is in an invalid state.
+ bool Parse(const std::string& pattern_str);
+
+ // Returns true if this instance matches the specified URL.
+ bool MatchesUrl(const GURL& url) const;
+
+ // Returns a string representing this instance.
+ 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.
+ bool OverlapsWith(const URLPattern& other) const;
+
private:
// Returns true if |test| matches our host.
+ bool MatchesHost(const std::string& host) const;
bool MatchesHost(const GURL& test) const;
// Returns true if |test| matches our path.
- bool MatchesPath(const GURL& test) const;
+ bool MatchesPath(const std::string& test) const;
// The scheme for the pattern.
std::string scheme_;
« no previous file with comments | « chrome/common/extensions/extension_extent_unittest.cc ('k') | chrome/common/extensions/url_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698