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

Side by Side Diff: extensions/common/url_pattern.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/renderer/script_context.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) 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
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
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 }
OLDNEW
« no previous file with comments | « extensions/common/file_util.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698