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

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

Issue 7229012: Use extension match pattern syntax in content settings extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 9 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
Index: chrome/common/extensions/url_pattern.h
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h
index 264da1fb24b36154a59c46f7c0b07f366327bc31..e34956fab44ba4199961c27940841a74ccafeee3 100644
--- a/chrome/common/extensions/url_pattern.h
+++ b/chrome/common/extensions/url_pattern.h
@@ -108,6 +108,7 @@ class URLPattern {
PARSE_ERROR_INVALID_HOST_WILDCARD,
PARSE_ERROR_EMPTY_PATH,
PARSE_ERROR_HAS_COLON, // Only checked when strict checks are enabled.
+ PARSE_ERROR_INVALID_PORT,
NUM_PARSE_RESULTS
};
@@ -194,6 +195,10 @@ class URLPattern {
// Returns true if |test| matches our path.
bool MatchesPath(const std::string& test) const;
+ // Sets the port. Returns false if the port is invalid.
+ bool SetPort(const std::string& port);
+ const std::string& port() const { return port_; }
+
// Returns a string representing this instance.
std::string GetAsString() const;
@@ -260,6 +265,10 @@ class URLPattern {
// component of the pattern's host was "*".
bool match_subdomains_;
+ // The port. URL patterns only support ports if they are parsed with the
+ // |PARSE_LENIENT| option.
+ std::string port_;
+
// The path to match. This is everything after the host of the URL, or
// everything after the scheme in the case of file:// URLs.
std::string path_;

Powered by Google App Engine
This is Rietveld 408576698