Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #ifndef EXTENSIONS_COMMON_URL_PATTERN_H_ | 4 #ifndef EXTENSIONS_COMMON_URL_PATTERN_H_ |
| 5 #define EXTENSIONS_COMMON_URL_PATTERN_H_ | 5 #define EXTENSIONS_COMMON_URL_PATTERN_H_ |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 // of the outer "filesystem:" part. | 146 // of the outer "filesystem:" part. |
| 147 bool MatchesScheme(const std::string& test) const; | 147 bool MatchesScheme(const std::string& test) const; |
| 148 | 148 |
| 149 // Returns true if |test| matches our host. | 149 // Returns true if |test| matches our host. |
| 150 bool MatchesHost(const std::string& test) const; | 150 bool MatchesHost(const std::string& test) const; |
| 151 bool MatchesHost(const GURL& test) const; | 151 bool MatchesHost(const GURL& test) const; |
| 152 | 152 |
| 153 // Returns true if |test| matches our path. | 153 // Returns true if |test| matches our path. |
| 154 bool MatchesPath(const std::string& test) const; | 154 bool MatchesPath(const std::string& test) const; |
| 155 | 155 |
| 156 // Returns true if the pattern is vague enough that it implies all hosts, | |
| 157 // such as *://*/*. | |
| 158 // This is an expensive method, and should be used sparingly! | |
|
not at google - send to devlin
2014/06/27 23:24:34
it's cached somewhere right? could you call that p
Devlin
2014/06/30 17:06:11
Done.
| |
| 159 bool ImpliesAllHosts() const; | |
| 160 | |
| 156 // Sets the port. Returns false if the port is invalid. | 161 // Sets the port. Returns false if the port is invalid. |
| 157 bool SetPort(const std::string& port); | 162 bool SetPort(const std::string& port); |
| 158 const std::string& port() const { return port_; } | 163 const std::string& port() const { return port_; } |
| 159 | 164 |
| 160 // Returns a string representing this instance. | 165 // Returns a string representing this instance. |
| 161 const std::string& GetAsString() const; | 166 const std::string& GetAsString() const; |
| 162 | 167 |
| 163 // Determines whether there is a URL that would match this instance and | 168 // Determines whether there is a URL that would match this instance and |
| 164 // another instance. This method is symmetrical: Calling | 169 // another instance. This method is symmetrical: Calling |
| 165 // other.OverlapsWith(this) would result in the same answer. | 170 // other.OverlapsWith(this) would result in the same answer. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 // MatchPattern() function. | 242 // MatchPattern() function. |
| 238 std::string path_escaped_; | 243 std::string path_escaped_; |
| 239 | 244 |
| 240 // A string representing this URLPattern. | 245 // A string representing this URLPattern. |
| 241 mutable std::string spec_; | 246 mutable std::string spec_; |
| 242 }; | 247 }; |
| 243 | 248 |
| 244 typedef std::vector<URLPattern> URLPatternList; | 249 typedef std::vector<URLPattern> URLPatternList; |
| 245 | 250 |
| 246 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ | 251 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ |
| OLD | NEW |