Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1129)

Side by Side Diff: chrome/common/extensions/url_pattern.h

Issue 7049032: Make URLPattern::OverlapsWith handle wildcards better by expanding them to explicit schemes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/url_pattern.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 private: 228 private:
229 #if !(defined(_MSC_VER) && _MSC_VER >= 1600) 229 #if !(defined(_MSC_VER) && _MSC_VER >= 1600)
230 friend class std::vector<URLPattern>; 230 friend class std::vector<URLPattern>;
231 231
232 // Note: don't use this directly. This exists so URLPattern can be used 232 // Note: don't use this directly. This exists so URLPattern can be used
233 // with STL containers. 233 // with STL containers.
234 URLPattern(); 234 URLPattern();
235 #endif 235 #endif
236 236
237 // Returns true if any of the |schemes| items matches our scheme.
238 bool MatchesAnyScheme(const std::vector<std::string>& schemes) const;
239
240 // If the URLPattern contains a wildcard scheme, returns a list of
241 // equivalent literal schemes, otherwise returns the current scheme.
242 std::vector<std::string> GetExplicitSchemes() const;
243
237 // A bitmask containing the schemes which are considered valid for this 244 // A bitmask containing the schemes which are considered valid for this
238 // pattern. Parse() uses this to decide whether a pattern contains a valid 245 // pattern. Parse() uses this to decide whether a pattern contains a valid
239 // scheme. MatchesScheme uses this to decide whether a wildcard scheme_ 246 // scheme. MatchesScheme uses this to decide whether a wildcard scheme_
240 // matches a given test scheme. 247 // matches a given test scheme.
241 int valid_schemes_; 248 int valid_schemes_;
242 249
243 // True if this is a special-case "<all_urls>" pattern. 250 // True if this is a special-case "<all_urls>" pattern.
244 bool match_all_urls_; 251 bool match_all_urls_;
245 252
246 // The scheme for the pattern. 253 // The scheme for the pattern.
(...skipping 11 matching lines...) Expand all
258 std::string path_; 265 std::string path_;
259 266
260 // The path with "?" and "\" characters escaped for use with the 267 // The path with "?" and "\" characters escaped for use with the
261 // MatchPattern() function. 268 // MatchPattern() function.
262 std::string path_escaped_; 269 std::string path_escaped_;
263 }; 270 };
264 271
265 typedef std::vector<URLPattern> URLPatternList; 272 typedef std::vector<URLPattern> URLPatternList;
266 273
267 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ 274 #endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/url_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698