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_; |