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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1868763002: Remove URLRequest::IsHandledProtocol and IsHandledURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase (needs fixing) Created 4 years, 2 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
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 "chrome/browser/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 720
721 // static 721 // static
722 ProfileIOData* ProfileIOData::FromResourceContext( 722 ProfileIOData* ProfileIOData::FromResourceContext(
723 content::ResourceContext* rc) { 723 content::ResourceContext* rc) {
724 return (static_cast<ResourceContext*>(rc))->io_data_; 724 return (static_cast<ResourceContext*>(rc))->io_data_;
725 } 725 }
726 726
727 // static 727 // static
728 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { 728 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) {
729 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); 729 DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
730 // Keep in sync with ProfileIOData::SetUpJobFactoryDefaults()
730 static const char* const kProtocolList[] = { 731 static const char* const kProtocolList[] = {
731 url::kFileScheme, 732 url::kFileScheme,
732 content::kChromeDevToolsScheme, 733 content::kChromeDevToolsScheme,
733 dom_distiller::kDomDistillerScheme, 734 dom_distiller::kDomDistillerScheme,
734 #if defined(ENABLE_EXTENSIONS) 735 #if defined(ENABLE_EXTENSIONS)
735 extensions::kExtensionScheme, 736 extensions::kExtensionScheme,
736 extensions::kExtensionResourceScheme, 737 extensions::kExtensionResourceScheme,
737 #endif 738 #endif
738 content::kChromeUIScheme, 739 content::kChromeUIScheme,
739 url::kDataScheme, 740 url::kDataScheme,
740 #if defined(OS_CHROMEOS) 741 #if defined(OS_CHROMEOS)
741 content::kExternalFileScheme, 742 content::kExternalFileScheme,
742 #endif // defined(OS_CHROMEOS) 743 #endif // defined(OS_CHROMEOS)
743 url::kAboutScheme, 744 url::kAboutScheme,
744 #if !defined(DISABLE_FTP_SUPPORT) 745 #if !defined(DISABLE_FTP_SUPPORT)
745 url::kFtpScheme, 746 url::kFtpScheme,
746 #endif // !defined(DISABLE_FTP_SUPPORT) 747 #endif // !defined(DISABLE_FTP_SUPPORT)
747 url::kBlobScheme, 748 url::kBlobScheme,
748 url::kFileSystemScheme, 749 url::kFileSystemScheme,
749 chrome::kChromeSearchScheme, 750 chrome::kChromeSearchScheme,
751 url::kHttpScheme,
752 url::kHttpsScheme,
753 url::kWsScheme,
754 url::kWssScheme,
750 }; 755 };
751 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { 756 for (size_t i = 0; i < arraysize(kProtocolList); ++i) {
752 if (scheme == kProtocolList[i]) 757 if (scheme == kProtocolList[i])
753 return true; 758 return true;
754 } 759 }
755 return net::URLRequest::IsHandledProtocol(scheme); 760 return false;
756 } 761 }
757 762
758 // static 763 // static
759 bool ProfileIOData::IsHandledURL(const GURL& url) { 764 bool ProfileIOData::IsHandledURL(const GURL& url) {
760 if (!url.is_valid()) { 765 if (!url.is_valid()) {
761 // We handle error cases. 766 // We handle error cases.
762 return true; 767 return true;
763 } 768 }
764 769
765 return IsHandledProtocol(url.scheme()); 770 return IsHandledProtocol(url.scheme());
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 void ProfileIOData::SetCookieSettingsForTesting( 1357 void ProfileIOData::SetCookieSettingsForTesting(
1353 content_settings::CookieSettings* cookie_settings) { 1358 content_settings::CookieSettings* cookie_settings) {
1354 DCHECK(!cookie_settings_.get()); 1359 DCHECK(!cookie_settings_.get());
1355 cookie_settings_ = cookie_settings; 1360 cookie_settings_ = cookie_settings;
1356 } 1361 }
1357 1362
1358 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1363 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1359 const GURL& url) const { 1364 const GURL& url) const {
1360 return url_blacklist_manager_->GetURLBlacklistState(url); 1365 return url_blacklist_manager_->GetURLBlacklistState(url);
1361 } 1366 }
OLDNEW
« no previous file with comments | « android_webview/browser/net/aw_url_request_job_factory.cc ('k') | chromecast/browser/cast_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698