From b65cd5c1a3b0d3fa5700d808afeb111d2f0ef2d0 Mon Sep 17 00:00:00 2001 From: brettw Date: Fri, 22 Jan 2016 16:46:38 -0800 Subject: Convert some URL accessors to use StringPieces Updates some google util, registry controlled domain, and net util code to use string pieces in their APIs. Convert some google util functions to take a const ref GURL instead of a copy. Review URL: https://codereview.chromium.org/1614223003 Cr-Commit-Position: refs/heads/master@{#371101} --- chrome/browser/chrome_content_browser_client.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'chrome/browser/chrome_content_browser_client.cc') diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index b3cdde7..4ef4c6f 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -384,7 +384,9 @@ GURL ReplaceURLHostAndPath(const GURL& url, // Maps "foo://bar/baz/" to "foo://chrome/bar/baz/". GURL AddUberHost(const GURL& url) { const std::string uber_host = chrome::kChromeUIUberHost; - const std::string new_path = url.host() + url.path(); + std::string new_path; + url.host_piece().AppendToString(&new_path); + url.path_piece().AppendToString(&new_path); return ReplaceURLHostAndPath(url, uber_host, new_path); } @@ -1118,7 +1120,7 @@ bool ChromeContentBrowserClient::ShouldAllowOpenURL( // the signin page may host untrusted web content. if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL && url.SchemeIs(content::kChromeUIScheme) && - url.host() != chrome::kChromeUIChromeSigninHost) { + url.host_piece() != chrome::kChromeUIChromeSigninHost) { VLOG(1) << "Blocked navigation to " << url.spec() << " from " << chrome::kChromeUIChromeSigninURL; return false; -- cgit v1.1