OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 4 #ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
5 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 5 #define CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
6 #pragma once | 6 #pragma once |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 class EffectiveHostCompareFunctor { | 196 class EffectiveHostCompareFunctor { |
197 public: | 197 public: |
198 bool operator()(const URLPattern& a, const URLPattern& b) const { | 198 bool operator()(const URLPattern& a, const URLPattern& b) const { |
199 return EffectiveHostCompare(a, b); | 199 return EffectiveHostCompare(a, b); |
200 }; | 200 }; |
201 }; | 201 }; |
202 | 202 |
203 private: | 203 private: |
204 friend class std::vector<URLPattern>; | 204 friend class std::vector<URLPattern>; |
205 | 205 |
206 // See clang bug: http://llvm.org/bugs/show_bug.cgi?id=8479 | |
207 #if defined(__clang__) | |
208 public: | |
209 #endif | |
210 | |
211 // Note: don't use this directly. This exists so URLPattern can be used | 206 // Note: don't use this directly. This exists so URLPattern can be used |
212 // with STL containers. | 207 // with STL containers. |
213 URLPattern(); | 208 URLPattern(); |
214 | 209 |
215 #if defined(__clang__) | |
216 private: | |
217 #endif | |
218 | |
219 // A bitmask containing the schemes which are considered valid for this | 210 // A bitmask containing the schemes which are considered valid for this |
220 // pattern. Parse() uses this to decide whether a pattern contains a valid | 211 // pattern. Parse() uses this to decide whether a pattern contains a valid |
221 // scheme. MatchesScheme uses this to decide whether a wildcard scheme_ | 212 // scheme. MatchesScheme uses this to decide whether a wildcard scheme_ |
222 // matches a given test scheme. | 213 // matches a given test scheme. |
223 int valid_schemes_; | 214 int valid_schemes_; |
224 | 215 |
225 // True if this is a special-case "<all_urls>" pattern. | 216 // True if this is a special-case "<all_urls>" pattern. |
226 bool match_all_urls_; | 217 bool match_all_urls_; |
227 | 218 |
228 // The scheme for the pattern. | 219 // The scheme for the pattern. |
(...skipping 12 matching lines...) Expand all Loading... |
241 | 232 |
242 // The path with "?" and "\" characters escaped for use with the | 233 // The path with "?" and "\" characters escaped for use with the |
243 // MatchPattern() function. This is populated lazily, the first time it is | 234 // MatchPattern() function. This is populated lazily, the first time it is |
244 // needed. | 235 // needed. |
245 mutable std::string path_escaped_; | 236 mutable std::string path_escaped_; |
246 }; | 237 }; |
247 | 238 |
248 typedef std::vector<URLPattern> URLPatternList; | 239 typedef std::vector<URLPattern> URLPatternList; |
249 | 240 |
250 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ | 241 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |
OLD | NEW |