diff options
Diffstat (limited to 'chrome')
27 files changed, 52 insertions, 47 deletions
diff --git a/chrome/browser/android/history_report/delta_file_commons.cc b/chrome/browser/android/history_report/delta_file_commons.cc index d7d6cba..7f35cb6 100644 --- a/chrome/browser/android/history_report/delta_file_commons.cc +++ b/chrome/browser/android/history_report/delta_file_commons.cc @@ -110,7 +110,7 @@ std::string DeltaFileEntryWithData::Url() const { base::string16 DeltaFileEntryWithData::Title() const { if (!Valid()) return base::UTF8ToUTF16(""); if (is_bookmark_ && !bookmark_title_.empty()) return bookmark_title_; - if (data_.title().empty()) return base::UTF8ToUTF16(data_.url().host()); + if (data_.title().empty()) return base::UTF8ToUTF16(data_.url().host_piece()); return data_.title(); } diff --git a/chrome/browser/android/history_report/usage_report_util.cc b/chrome/browser/android/history_report/usage_report_util.cc index 0138426..c2c696e 100644 --- a/chrome/browser/android/history_report/usage_report_util.cc +++ b/chrome/browser/android/history_report/usage_report_util.cc @@ -41,7 +41,7 @@ bool ShouldIgnoreUrl(const GURL& url) { return true; // Ignore localhost URLs. - if (net::IsLocalhost(url.host())) + if (net::IsLocalhost(url.host_piece())) return true; return false; diff --git a/chrome/browser/android/tab_web_contents_delegate_android.cc b/chrome/browser/android/tab_web_contents_delegate_android.cc index d2a1e48..664328e 100644 --- a/chrome/browser/android/tab_web_contents_delegate_android.cc +++ b/chrome/browser/android/tab_web_contents_delegate_android.cc @@ -153,9 +153,9 @@ bool TabWebContentsDelegateAndroid::ShouldFocusLocationBarByDefault( GURL url = entry->GetURL(); GURL virtual_url = entry->GetVirtualURL(); if ((url.SchemeIs(chrome::kChromeUINativeScheme) && - url.host() == chrome::kChromeUINewTabHost) || + url.host_piece() == chrome::kChromeUINewTabHost) || (virtual_url.SchemeIs(chrome::kChromeUINativeScheme) && - virtual_url.host() == chrome::kChromeUINewTabHost)) { + virtual_url.host_piece() == chrome::kChromeUINewTabHost)) { return true; } } diff --git a/chrome/browser/android/url_utilities.cc b/chrome/browser/android/url_utilities.cc index 742cd09..1a3b673 100644 --- a/chrome/browser/android/url_utilities.cc +++ b/chrome/browser/android/url_utilities.cc @@ -52,7 +52,7 @@ static jboolean SameHost(JNIEnv* env, const JavaParamRef<jstring>& url_2_str) { GURL url_1 = ConvertJavaStringToGURL(env, url_1_str); GURL url_2 = ConvertJavaStringToGURL(env, url_2_str); - return url_1.host() == url_2.host(); + return url_1.host_piece() == url_2.host_piece(); } static ScopedJavaLocalRef<jstring> GetDomainAndRegistry( diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc index 683c5aa..0851507 100644 --- a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc @@ -93,7 +93,7 @@ class StopTestOnCallback { for (size_t i = 0; i < arraysize(kTestHosts); ++i) { for (const auto& info : local_storage_info) { ASSERT_TRUE(info.origin_url.SchemeIs("http")); - if (info.origin_url.host() == kTestHosts[i]) { + if (info.origin_url.host_piece() == kTestHosts[i]) { ASSERT_FALSE(test_hosts_found[i]); test_hosts_found[i] = true; } 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; diff --git a/chrome/browser/chromeos/file_system_provider/request_manager.cc b/chrome/browser/chromeos/file_system_provider/request_manager.cc index fb2f141..f54e906 100644 --- a/chrome/browser/chromeos/file_system_provider/request_manager.cc +++ b/chrome/browser/chromeos/file_system_provider/request_manager.cc @@ -239,8 +239,8 @@ bool RequestManager::IsInteractingWithUser() const { const content::WebContents* const web_contents = tabs->GetWebContentsAt(i); const GURL& url = web_contents->GetURL(); - if (url.scheme() == extensions::kExtensionScheme && - url.host() == extension_id_) { + if (url.SchemeIs(extensions::kExtensionScheme) && + url.host_piece() == extension_id_) { return true; } } diff --git a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc index 68a74d7..27d0f69 100644 --- a/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc +++ b/chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc @@ -172,7 +172,7 @@ bool ShouldDelayUrl(const GURL& url) { // we will show delayed loading page instead. return !net::NetworkChangeNotifier::IsOffline() && !AreAllSessionMergedAlready() && - google_util::IsGoogleHostname(url.host(), + google_util::IsGoogleHostname(url.host_piece(), google_util::ALLOW_SUBDOMAIN); } diff --git a/chrome/browser/custom_handlers/register_protocol_handler_permission_request.cc b/chrome/browser/custom_handlers/register_protocol_handler_permission_request.cc index 4713fde..1f57a8f 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_permission_request.cc +++ b/chrome/browser/custom_handlers/register_protocol_handler_permission_request.cc @@ -66,13 +66,13 @@ RegisterProtocolHandlerPermissionRequest::GetMessageText() const { return old_handler.IsEmpty() ? l10n_util::GetStringFUTF16( IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM, - base::UTF8ToUTF16(handler_.url().host()), + base::UTF8ToUTF16(handler_.url().host_piece()), GetProtocolName(handler_)) : l10n_util::GetStringFUTF16( IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE, - base::UTF8ToUTF16(handler_.url().host()), + base::UTF8ToUTF16(handler_.url().host_piece()), GetProtocolName(handler_), - base::UTF8ToUTF16(old_handler.url().host())); + base::UTF8ToUTF16(old_handler.url().host_piece())); } base::string16 @@ -85,7 +85,7 @@ RegisterProtocolHandlerPermissionRequest::GetMessageTextFragment() const { l10n_util::GetStringFUTF16( IDS_REGISTER_PROTOCOL_HANDLER_CONFIRM_REPLACE_FRAGMENT, GetProtocolName(handler_), - base::UTF8ToUTF16(old_handler.url().host())); + base::UTF8ToUTF16(old_handler.url().host_piece())); } bool RegisterProtocolHandlerPermissionRequest::HasUserGesture() const { diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc index db31447..c34bf4b 100644 --- a/chrome/browser/custom_home_pages_table_model.cc +++ b/chrome/browser/custom_home_pages_table_model.cc @@ -41,15 +41,15 @@ bool ShouldAddPage(const GURL& url) { return false; if (url.SchemeIs(content::kChromeUIScheme)) { - if (url.host() == chrome::kChromeUISettingsHost || - url.host() == chrome::kChromeUISettingsFrameHost) { + if (url.host_piece() == chrome::kChromeUISettingsHost || + url.host_piece() == chrome::kChromeUISettingsFrameHost) { return false; } // For a settings page, the path will start with "/settings" not "settings" // so find() will return 1, not 0. - if (url.host() == chrome::kChromeUIUberHost && - url.path().find(chrome::kChromeUISettingsHost) == 1) { + if (url.host_piece() == chrome::kChromeUIUberHost && + url.path_piece().find(chrome::kChromeUISettingsHost) == 1) { return false; } } diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc index 5d0fe00..202759c 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.cc @@ -175,7 +175,7 @@ void PasswordsPrivateDelegateImpl::SetPasswordList( if (!federation_url.is_empty()) { entry->federation_text.reset(new std::string(l10n_util::GetStringFUTF8( IDS_PASSWORDS_VIA_FEDERATION, - base::UTF8ToUTF16(federation_url.host())))); + base::UTF8ToUTF16(federation_url.host_piece())))); } current_entries_.push_back(entry); diff --git a/chrome/browser/extensions/extension_override_apitest.cc b/chrome/browser/extensions/extension_override_apitest.cc index 6c47fc9..2f5386f 100644 --- a/chrome/browser/extensions/extension_override_apitest.cc +++ b/chrome/browser/extensions/extension_override_apitest.cc @@ -63,7 +63,7 @@ class ExtensionOverrideTest : public ExtensionApiTest { GURL gurl = web_contents->GetController().GetLastCommittedEntry()->GetURL(); if (!gurl.SchemeIs(kExtensionScheme)) return testing::AssertionFailure() << gurl; - if (gurl.host() != extension_id) + if (gurl.host_piece() != extension_id) return testing::AssertionFailure() << gurl; return testing::AssertionSuccess(); } diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc index 5982232..a45cb9d 100644 --- a/chrome/browser/extensions/extension_special_storage_policy.cc +++ b/chrome/browser/extensions/extension_special_storage_policy.cc @@ -101,7 +101,7 @@ bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { return true; if (origin.SchemeIs(content::kChromeDevToolsScheme) && - origin.host() == chrome::kChromeUIDevToolsHost) + origin.host_piece() == chrome::kChromeUIDevToolsHost) return true; base::AutoLock locker(lock_); diff --git a/chrome/browser/extensions/ntp_overridden_bubble_delegate.cc b/chrome/browser/extensions/ntp_overridden_bubble_delegate.cc index c2baee0..74e0a4b 100644 --- a/chrome/browser/extensions/ntp_overridden_bubble_delegate.cc +++ b/chrome/browser/extensions/ntp_overridden_bubble_delegate.cc @@ -43,7 +43,7 @@ bool NtpOverriddenBubbleDelegate::ShouldIncludeExtension( if (!ExtensionWebUI::HandleChromeURLOverride(&url, profile())) return false; // No override for newtab found. - if (extension->id() != url.host()) + if (extension->id() != url.host_piece()) return false; if (HasBubbleInfoBeenAcknowledged(extension->id())) diff --git a/chrome/browser/favicon/favicon_utils.cc b/chrome/browser/favicon/favicon_utils.cc index 54b4d33..fc8cd05 100644 --- a/chrome/browser/favicon/favicon_utils.cc +++ b/chrome/browser/favicon/favicon_utils.cc @@ -40,7 +40,7 @@ bool ShouldDisplayFavicon(content::WebContents* web_contents) { GURL url = web_contents->GetURL(); if (url.SchemeIs(content::kChromeUIScheme) && - url.host() == chrome::kChromeUINewTabHost) { + url.host_piece() == chrome::kChromeUINewTabHost) { return false; } diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 61874cf..7323cae 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -398,13 +398,13 @@ void FirstRunBubbleLauncher::Observe( if (contents && contents->GetURL().SchemeIs(content::kChromeUIScheme)) { #if defined(OS_WIN) // Suppress the first run bubble if 'make chrome metro' flow is showing. - if (contents->GetURL().host() == chrome::kChromeUIMetroFlowHost) + if (contents->GetURL().host_piece() == chrome::kChromeUIMetroFlowHost) return; #endif // Suppress the first run bubble if the NTP sync promo bubble is showing // or if sign in is in progress. - if (contents->GetURL().host() == chrome::kChromeUINewTabHost) { + if (contents->GetURL().host_piece() == chrome::kChromeUINewTabHost) { Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); SigninManagerBase* manager = diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc index f2d91b9..42766b2 100644 --- a/chrome/browser/net/predictor.cc +++ b/chrome/browser/net/predictor.cc @@ -354,7 +354,7 @@ UrlList Predictor::GetPredictedUrlListAtStartup(PrefService* user_prefs) { if (SessionStartupPref::URLS == tab_start_pref.type) { for (size_t i = 0; i < tab_start_pref.urls.size(); i++) { GURL gurl = tab_start_pref.urls[i]; - if (!gurl.is_valid() || gurl.SchemeIsFile() || gurl.host().empty()) + if (!gurl.is_valid() || gurl.SchemeIsFile() || gurl.host_piece().empty()) continue; if (gurl.SchemeIsHTTPOrHTTPS()) urls.push_back(gurl.GetWithEmptyPath()); @@ -966,7 +966,7 @@ void Predictor::PrepareFrameSubresources(const GURL& original_url, evalution = PRECONNECTION; future_url->second.IncrementPreconnectionCount(); int count = static_cast<int>(std::ceil(connection_expectation)); - if (url.host() == future_url->first.host()) + if (url.host_piece() == future_url->first.host_piece()) ++count; PreconnectUrlOnIOThread(future_url->first, first_party_for_cookies, motivation, diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc index 583c2b1..d0a5e98 100644 --- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc @@ -17,9 +17,9 @@ bool IsFromGoogle(const GURL& url) { std::string domain = net::registry_controlled_domains::GetDomainAndRegistry( url, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); if (!base::StartsWith(domain, "google.", base::CompareCase::SENSITIVE) || - !base::StartsWith(url.host(), kGoogleSearchHostnamePrefix, + !base::StartsWith(url.host_piece(), kGoogleSearchHostnamePrefix, base::CompareCase::SENSITIVE) || - url.host().length() != + url.host_piece().length() != domain.length() + strlen(kGoogleSearchHostnamePrefix)) { return false; } diff --git a/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc b/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc index 9d47fd04..1cc5e45 100644 --- a/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc +++ b/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc @@ -34,11 +34,12 @@ void RecordGoogleCaptchaEvent(GoogleCaptchaEvent event) { } // namespace bool IsGoogleCaptcha(const GURL& url) { - return (base::StartsWith(url.host(), "ipv4.google.", + return (base::StartsWith(url.host_piece(), "ipv4.google.", base::CompareCase::SENSITIVE) - || base::StartsWith(url.host(), "ipv6.google.", + || base::StartsWith(url.host_piece(), "ipv6.google.", base::CompareCase::SENSITIVE)) - && base::StartsWith(url.path(), "/sorry", base::CompareCase::SENSITIVE); + && base::StartsWith(url.path_piece(), "/sorry", + base::CompareCase::SENSITIVE); } GoogleCaptchaObserver::GoogleCaptchaObserver() : saw_solution_(false) {} diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 4559fda..1ddedc2 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc @@ -184,7 +184,8 @@ bool ChromePasswordManagerClient::IsPasswordManagementEnabledForCurrentPage() // Do not fill nor save password when a user is signing in for sync. This // is because users need to remember their password if they are syncing as // this is effectively their master password. - is_enabled = entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; + is_enabled = + entry->GetURL().host_piece() != chrome::kChromeUIChromeSigninHost; } if (log_manager_->IsLoggingActive()) { password_manager::BrowserSavePasswordProgressLogger logger( diff --git a/chrome/browser/plugins/chrome_plugin_service_filter.cc b/chrome/browser/plugins/chrome_plugin_service_filter.cc index fd1fa51..38d87ec 100644 --- a/chrome/browser/plugins/chrome_plugin_service_filter.cc +++ b/chrome/browser/plugins/chrome_plugin_service_filter.cc @@ -281,9 +281,9 @@ bool ChromePluginServiceFilter::IsPluginAvailable( return false; const GURL& origin = it->second.second; if (!origin.is_empty() && - (policy_url.scheme() != origin.scheme() || - policy_url.host() != origin.host() || - policy_url.port() != origin.port())) { + (policy_url.scheme_piece() != origin.scheme_piece() || + policy_url.host_piece() != origin.host_piece() || + policy_url.port_piece() != origin.port_piece())) { return false; } } diff --git a/chrome/browser/policy/cloud/test_request_interceptor.cc b/chrome/browser/policy/cloud/test_request_interceptor.cc index 3da4012c7..e1b4752 100644 --- a/chrome/browser/policy/cloud/test_request_interceptor.cc +++ b/chrome/browser/policy/cloud/test_request_interceptor.cc @@ -208,7 +208,7 @@ net::URLRequestJob* TestRequestInterceptor::Delegate::MaybeInterceptRequest( net::NetworkDelegate* network_delegate) const { CHECK(io_task_runner_->RunsTasksOnCurrentThread()); - if (request->url().host() != hostname_) { + if (request->url().host_piece() != hostname_) { // Reject requests to other servers. return ErrorJobCallback( net::ERR_CONNECTION_REFUSED, request, network_delegate); diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index cc9d619..5c6e0da 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -271,7 +271,7 @@ PrerenderHandle* PrerenderManager::AddPrerenderFromLinkRelPrerender( if (!source_web_contents) return NULL; if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN && - source_web_contents->GetURL().host() == url.host()) { + source_web_contents->GetURL().host_piece() == url.host_piece()) { origin = ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN; } // TODO(ajwong): This does not correctly handle storage for isolated apps. diff --git a/chrome/browser/prerender/prerender_util.cc b/chrome/browser/prerender/prerender_util.cc index e708cfdb..503834a 100644 --- a/chrome/browser/prerender/prerender_util.cc +++ b/chrome/browser/prerender/prerender_util.cc @@ -72,18 +72,19 @@ bool MaybeGetQueryStringBasedAliasURL( } bool IsGoogleDomain(const GURL& url) { - return base::StartsWith(url.host(), "www.google.", + return base::StartsWith(url.host_piece(), "www.google.", base::CompareCase::SENSITIVE); } bool IsGoogleSearchResultURL(const GURL& url) { if (!IsGoogleDomain(url)) return false; - return (url.path().empty() || - base::StartsWith(url.path(), "/search", + return (url.path_piece().empty() || + base::StartsWith(url.path_piece(), "/search", base::CompareCase::SENSITIVE) || (url.path() == "/") || - base::StartsWith(url.path(), "/webhp", base::CompareCase::SENSITIVE)); + base::StartsWith(url.path_piece(), "/webhp", + base::CompareCase::SENSITIVE)); } void ReportPrerenderExternalURL() { diff --git a/chrome/browser/printing/print_preview_dialog_controller.cc b/chrome/browser/printing/print_preview_dialog_controller.cc index 7179c34..936cd77 100644 --- a/chrome/browser/printing/print_preview_dialog_controller.cc +++ b/chrome/browser/printing/print_preview_dialog_controller.cc @@ -259,7 +259,7 @@ bool PrintPreviewDialogController::IsPrintPreviewDialog(WebContents* contents) { // static bool PrintPreviewDialogController::IsPrintPreviewURL(const GURL& url) { return (url.SchemeIs(content::kChromeUIScheme) && - url.host() == chrome::kChromeUIPrintHost); + url.host_piece() == chrome::kChromeUIPrintHost); } void PrintPreviewDialogController::EraseInitiatorInfo( diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index 20d93b9..3bbb647 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -177,8 +177,8 @@ bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) { bundled_path_prefix = "/" + bundled_path_prefix + "/"; if (!url.SchemeIs(content::kChromeDevToolsScheme) || - url.host() != chrome::kChromeUIDevToolsHost || - !base::StartsWith(url.path(), bundled_path_prefix, + url.host_piece() != chrome::kChromeUIDevToolsHost || + !base::StartsWith(url.path_piece(), bundled_path_prefix, base::CompareCase::INSENSITIVE_ASCII)) { return false; } diff --git a/chrome/browser/ui/toolbar/toolbar_model_impl.cc b/chrome/browser/ui/toolbar/toolbar_model_impl.cc index ddfd315a..e27e2fa 100644 --- a/chrome/browser/ui/toolbar/toolbar_model_impl.cc +++ b/chrome/browser/ui/toolbar/toolbar_model_impl.cc @@ -96,7 +96,7 @@ base::string16 ToolbarModelImpl::GetCorpusNameForMobile() const { // If there is a query in the url fragment look for the corpus name there, // otherwise look for the corpus name in the query parameters. const std::string& query_str(google_util::HasGoogleSearchQueryParam( - url.ref()) ? url.ref() : url.query()); + url.ref_piece()) ? url.ref() : url.query()); url::Component query(0, query_str.length()), key, value; const char kChipKey[] = "sboxchip"; while (url::ExtractQueryKeyValue(query_str.c_str(), &query, &key, &value)) { |
