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 <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Error codes returned from Parse(). | 66 // Error codes returned from Parse(). |
67 enum ParseResult { | 67 enum ParseResult { |
68 PARSE_SUCCESS = 0, | 68 PARSE_SUCCESS = 0, |
69 PARSE_ERROR_MISSING_SCHEME_SEPARATOR, | 69 PARSE_ERROR_MISSING_SCHEME_SEPARATOR, |
70 PARSE_ERROR_INVALID_SCHEME, | 70 PARSE_ERROR_INVALID_SCHEME, |
71 PARSE_ERROR_WRONG_SCHEME_SEPARATOR, | 71 PARSE_ERROR_WRONG_SCHEME_SEPARATOR, |
72 PARSE_ERROR_EMPTY_HOST, | 72 PARSE_ERROR_EMPTY_HOST, |
73 PARSE_ERROR_INVALID_HOST_WILDCARD, | 73 PARSE_ERROR_INVALID_HOST_WILDCARD, |
74 PARSE_ERROR_EMPTY_PATH, | 74 PARSE_ERROR_EMPTY_PATH, |
75 PARSE_ERROR_INVALID_PORT, | 75 PARSE_ERROR_INVALID_PORT, |
| 76 PARSE_ERROR_INVALID_HOST, |
76 NUM_PARSE_RESULTS | 77 NUM_PARSE_RESULTS |
77 }; | 78 }; |
78 | 79 |
79 // The <all_urls> string pattern. | 80 // The <all_urls> string pattern. |
80 static const char kAllUrlsPattern[]; | 81 static const char kAllUrlsPattern[]; |
81 | 82 |
82 // Returns true if the given |scheme| is considered valid for extensions. | 83 // Returns true if the given |scheme| is considered valid for extensions. |
83 static bool IsValidSchemeForExtensions(const std::string& scheme); | 84 static bool IsValidSchemeForExtensions(const std::string& scheme); |
84 | 85 |
85 explicit URLPattern(int valid_schemes); | 86 explicit URLPattern(int valid_schemes); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 248 |
248 // A string representing this URLPattern. | 249 // A string representing this URLPattern. |
249 mutable std::string spec_; | 250 mutable std::string spec_; |
250 }; | 251 }; |
251 | 252 |
252 std::ostream& operator<<(std::ostream& out, const URLPattern& url_pattern); | 253 std::ostream& operator<<(std::ostream& out, const URLPattern& url_pattern); |
253 | 254 |
254 typedef std::vector<URLPattern> URLPatternList; | 255 typedef std::vector<URLPattern> URLPatternList; |
255 | 256 |
256 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ | 257 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ |
OLD | NEW |