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 "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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 | 704 |
705 // static | 705 // static |
706 ProfileIOData* ProfileIOData::FromResourceContext( | 706 ProfileIOData* ProfileIOData::FromResourceContext( |
707 content::ResourceContext* rc) { | 707 content::ResourceContext* rc) { |
708 return (static_cast<ResourceContext*>(rc))->io_data_; | 708 return (static_cast<ResourceContext*>(rc))->io_data_; |
709 } | 709 } |
710 | 710 |
711 // static | 711 // static |
712 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { | 712 bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { |
713 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); | 713 DCHECK_EQ(scheme, base::ToLowerASCII(scheme)); |
| 714 // Keep in sync with ProfileIOData::SetUpJobFactoryDefaults() |
714 static const char* const kProtocolList[] = { | 715 static const char* const kProtocolList[] = { |
715 url::kFileScheme, | 716 url::kFileScheme, |
716 content::kChromeDevToolsScheme, | 717 content::kChromeDevToolsScheme, |
717 dom_distiller::kDomDistillerScheme, | 718 dom_distiller::kDomDistillerScheme, |
718 #if defined(ENABLE_EXTENSIONS) | 719 #if defined(ENABLE_EXTENSIONS) |
719 extensions::kExtensionScheme, | 720 extensions::kExtensionScheme, |
720 extensions::kExtensionResourceScheme, | 721 extensions::kExtensionResourceScheme, |
721 #endif | 722 #endif |
722 content::kChromeUIScheme, | 723 content::kChromeUIScheme, |
723 url::kDataScheme, | 724 url::kDataScheme, |
724 #if defined(OS_CHROMEOS) | 725 #if defined(OS_CHROMEOS) |
725 content::kExternalFileScheme, | 726 content::kExternalFileScheme, |
726 #endif // defined(OS_CHROMEOS) | 727 #endif // defined(OS_CHROMEOS) |
727 url::kAboutScheme, | 728 url::kAboutScheme, |
728 #if !defined(DISABLE_FTP_SUPPORT) | 729 #if !defined(DISABLE_FTP_SUPPORT) |
729 url::kFtpScheme, | 730 url::kFtpScheme, |
730 #endif // !defined(DISABLE_FTP_SUPPORT) | 731 #endif // !defined(DISABLE_FTP_SUPPORT) |
731 url::kBlobScheme, | 732 url::kBlobScheme, |
732 url::kFileSystemScheme, | 733 url::kFileSystemScheme, |
733 chrome::kChromeSearchScheme, | 734 chrome::kChromeSearchScheme, |
| 735 url::kHttpScheme, |
| 736 url::kHttpsScheme, |
| 737 url::kWsScheme, |
| 738 url::kWssScheme, |
734 }; | 739 }; |
735 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { | 740 for (size_t i = 0; i < arraysize(kProtocolList); ++i) { |
736 if (scheme == kProtocolList[i]) | 741 if (scheme == kProtocolList[i]) |
737 return true; | 742 return true; |
738 } | 743 } |
739 return net::URLRequest::IsHandledProtocol(scheme); | 744 return false; |
740 } | 745 } |
741 | 746 |
742 // static | 747 // static |
743 bool ProfileIOData::IsHandledURL(const GURL& url) { | 748 bool ProfileIOData::IsHandledURL(const GURL& url) { |
744 if (!url.is_valid()) { | 749 if (!url.is_valid()) { |
745 // We handle error cases. | 750 // We handle error cases. |
746 return true; | 751 return true; |
747 } | 752 } |
748 | 753 |
749 return IsHandledProtocol(url.scheme()); | 754 return IsHandledProtocol(url.scheme()); |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 base::WrapUnique(new DevToolsNetworkTransactionFactory( | 1332 base::WrapUnique(new DevToolsNetworkTransactionFactory( |
1328 network_controller_handle_.GetController(), shared_session)), | 1333 network_controller_handle_.GetController(), shared_session)), |
1329 std::move(backend), true /* set_up_quic_server_info */)); | 1334 std::move(backend), true /* set_up_quic_server_info */)); |
1330 } | 1335 } |
1331 | 1336 |
1332 void ProfileIOData::SetCookieSettingsForTesting( | 1337 void ProfileIOData::SetCookieSettingsForTesting( |
1333 content_settings::CookieSettings* cookie_settings) { | 1338 content_settings::CookieSettings* cookie_settings) { |
1334 DCHECK(!cookie_settings_.get()); | 1339 DCHECK(!cookie_settings_.get()); |
1335 cookie_settings_ = cookie_settings; | 1340 cookie_settings_ = cookie_settings; |
1336 } | 1341 } |
OLD | NEW |