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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // A collection of scheme bitmasks for use with valid_schemes. | 46 // A collection of scheme bitmasks for use with valid_schemes. |
47 enum SchemeMasks { | 47 enum SchemeMasks { |
48 SCHEME_NONE = 0, | 48 SCHEME_NONE = 0, |
49 SCHEME_HTTP = 1 << 0, | 49 SCHEME_HTTP = 1 << 0, |
50 SCHEME_HTTPS = 1 << 1, | 50 SCHEME_HTTPS = 1 << 1, |
51 SCHEME_FILE = 1 << 2, | 51 SCHEME_FILE = 1 << 2, |
52 SCHEME_FTP = 1 << 3, | 52 SCHEME_FTP = 1 << 3, |
53 SCHEME_CHROMEUI = 1 << 4, | 53 SCHEME_CHROMEUI = 1 << 4, |
54 SCHEME_EXTENSION = 1 << 5, | 54 SCHEME_EXTENSION = 1 << 5, |
55 SCHEME_FILESYSTEM = 1 << 6, | 55 SCHEME_FILESYSTEM = 1 << 6, |
| 56 SCHEME_WS = 1 << 7, |
| 57 SCHEME_WSS = 1 << 8, |
56 | 58 |
57 // IMPORTANT! | 59 // IMPORTANT! |
58 // SCHEME_ALL will match every scheme, including chrome://, chrome- | 60 // SCHEME_ALL will match every scheme, including chrome://, chrome- |
59 // extension://, about:, etc. Because this has lots of security | 61 // extension://, about:, etc. Because this has lots of security |
60 // implications, third-party extensions should usually not be able to get | 62 // implications, third-party extensions should usually not be able to get |
61 // access to URL patterns initialized this way. If there is a reason | 63 // access to URL patterns initialized this way. If there is a reason |
62 // for violating this general rule, document why this it safe. | 64 // for violating this general rule, document why this it safe. |
63 SCHEME_ALL = -1, | 65 SCHEME_ALL = -1, |
64 }; | 66 }; |
65 | 67 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 255 |
254 // A string representing this URLPattern. | 256 // A string representing this URLPattern. |
255 mutable std::string spec_; | 257 mutable std::string spec_; |
256 }; | 258 }; |
257 | 259 |
258 std::ostream& operator<<(std::ostream& out, const URLPattern& url_pattern); | 260 std::ostream& operator<<(std::ostream& out, const URLPattern& url_pattern); |
259 | 261 |
260 typedef std::vector<URLPattern> URLPatternList; | 262 typedef std::vector<URLPattern> URLPatternList; |
261 | 263 |
262 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ | 264 #endif // EXTENSIONS_COMMON_URL_PATTERN_H_ |
OLD | NEW |