| 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 | 4 |
| 5 #include "extensions/common/url_pattern.h" | 5 #include "extensions/common/url_pattern.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 | 10 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 if (!MatchesScheme(test_url->scheme())) | 365 if (!MatchesScheme(test_url->scheme())) |
| 366 return false; | 366 return false; |
| 367 | 367 |
| 368 if (match_all_urls_) | 368 if (match_all_urls_) |
| 369 return true; | 369 return true; |
| 370 | 370 |
| 371 std::string path_for_request = test.PathForRequest(); | 371 std::string path_for_request = test.PathForRequest(); |
| 372 if (has_inner_url) | 372 if (has_inner_url) |
| 373 path_for_request = test_url->path() + path_for_request; | 373 path_for_request = test_url->path().as_string() + path_for_request; |
| 374 | 374 |
| 375 return MatchesSecurityOriginHelper(*test_url) && | 375 return MatchesSecurityOriginHelper(*test_url) && |
| 376 MatchesPath(path_for_request); | 376 MatchesPath(path_for_request); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool URLPattern::MatchesSecurityOrigin(const GURL& test) const { | 379 bool URLPattern::MatchesSecurityOrigin(const GURL& test) const { |
| 380 const GURL* test_url = &test; | 380 const GURL* test_url = &test; |
| 381 bool has_inner_url = test.inner_url() != NULL; | 381 bool has_inner_url = test.inner_url() != NULL; |
| 382 | 382 |
| 383 if (has_inner_url) { | 383 if (has_inner_url) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 } | 615 } |
| 616 | 616 |
| 617 return result; | 617 return result; |
| 618 } | 618 } |
| 619 | 619 |
| 620 // static | 620 // static |
| 621 const char* URLPattern::GetParseResultString( | 621 const char* URLPattern::GetParseResultString( |
| 622 URLPattern::ParseResult parse_result) { | 622 URLPattern::ParseResult parse_result) { |
| 623 return kParseResultMessages[parse_result]; | 623 return kParseResultMessages[parse_result]; |
| 624 } | 624 } |
| OLD | NEW |