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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #if !defined(USE_OPENSSL) | 88 #if !defined(USE_OPENSSL) |
89 #include "net/cert/ct_log_verifier.h" | 89 #include "net/cert/ct_log_verifier.h" |
90 #include "net/cert/multi_log_ct_verifier.h" | 90 #include "net/cert/multi_log_ct_verifier.h" |
91 #endif | 91 #endif |
92 | 92 |
93 #if defined(USE_NSS) || defined(OS_IOS) | 93 #if defined(USE_NSS) || defined(OS_IOS) |
94 #include "net/ocsp/nss_ocsp.h" | 94 #include "net/ocsp/nss_ocsp.h" |
95 #endif | 95 #endif |
96 | 96 |
97 #if defined(OS_ANDROID) || defined(OS_IOS) | 97 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 98 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
98 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 99 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
99 #endif | 100 #endif |
100 | 101 |
101 #if defined(OS_CHROMEOS) | 102 #if defined(OS_CHROMEOS) |
102 #include "chrome/browser/chromeos/login/users/user_manager.h" | 103 #include "chrome/browser/chromeos/login/users/user_manager.h" |
103 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 104 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
104 #endif | 105 #endif |
105 | 106 |
106 using content::BrowserThread; | 107 using content::BrowserThread; |
107 | 108 |
108 #if defined(OS_ANDROID) || defined(OS_IOS) | 109 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 110 using data_reduction_proxy::DataReductionProxyParams; |
109 using data_reduction_proxy::DataReductionProxySettings; | 111 using data_reduction_proxy::DataReductionProxySettings; |
110 #endif | 112 #endif |
111 | 113 |
112 class SafeBrowsingURLRequestContext; | 114 class SafeBrowsingURLRequestContext; |
113 | 115 |
114 // The IOThread object must outlive any tasks posted to the IO thread before the | 116 // The IOThread object must outlive any tasks posted to the IO thread before the |
115 // Quit task, so base::Bind() calls are not refcounted. | 117 // Quit task, so base::Bind() calls are not refcounted. |
116 | 118 |
117 namespace { | 119 namespace { |
118 | 120 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 } | 590 } |
589 } | 591 } |
590 #else | 592 #else |
591 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) { | 593 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) { |
592 LOG(DFATAL) << "Certificate Transparency is not yet supported in Chrome " | 594 LOG(DFATAL) << "Certificate Transparency is not yet supported in Chrome " |
593 "builds using OpenSSL."; | 595 "builds using OpenSSL."; |
594 } | 596 } |
595 #endif | 597 #endif |
596 globals_->ssl_config_service = GetSSLConfigService(); | 598 globals_->ssl_config_service = GetSSLConfigService(); |
597 #if defined(OS_ANDROID) || defined(OS_IOS) | 599 #if defined(OS_ANDROID) || defined(OS_IOS) |
598 if (DataReductionProxySettings::IsIncludedInFieldTrialOrFlags()) { | 600 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
599 spdyproxy_auth_origins_ = | 601 int drp_flags = DataReductionProxyParams::kFallbackAllowed; |
600 DataReductionProxySettings::GetDataReductionProxies(); | 602 if (DataReductionProxyParams::IsIncludedInFieldTrial()) |
601 } | 603 drp_flags |= DataReductionProxyParams::kAllowed; |
| 604 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) |
| 605 drp_flags |= DataReductionProxyParams::kAlternativeAllowed; |
| 606 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) |
| 607 drp_flags |= DataReductionProxyParams::kPromoAllowed; |
| 608 globals_->data_reduction_proxy_params.reset( |
| 609 new DataReductionProxyParams(drp_flags)); |
| 610 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
602 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 611 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
603 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( | 612 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( |
604 globals_->host_resolver.get())); | 613 globals_->host_resolver.get())); |
605 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); | 614 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
606 // For the ProxyScriptFetcher, we use a direct ProxyService. | 615 // For the ProxyScriptFetcher, we use a direct ProxyService. |
607 globals_->proxy_script_fetcher_proxy_service.reset( | 616 globals_->proxy_script_fetcher_proxy_service.reset( |
608 net::ProxyService::CreateDirectWithNetLog(net_log_)); | 617 net::ProxyService::CreateDirectWithNetLog(net_log_)); |
609 // In-memory cookie store. | 618 // In-memory cookie store. |
610 globals_->system_cookie_store = | 619 globals_->system_cookie_store = |
611 content::CreateCookieStore(content::CookieStoreConfig()); | 620 content::CreateCookieStore(content::CookieStoreConfig()); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 auth_filter_delegate)); | 903 auth_filter_delegate)); |
895 std::vector<std::string> supported_schemes; | 904 std::vector<std::string> supported_schemes; |
896 base::SplitString(auth_schemes_, ',', &supported_schemes); | 905 base::SplitString(auth_schemes_, ',', &supported_schemes); |
897 | 906 |
898 scoped_ptr<net::HttpAuthHandlerRegistryFactory> registry_factory( | 907 scoped_ptr<net::HttpAuthHandlerRegistryFactory> registry_factory( |
899 net::HttpAuthHandlerRegistryFactory::Create( | 908 net::HttpAuthHandlerRegistryFactory::Create( |
900 supported_schemes, globals_->url_security_manager.get(), | 909 supported_schemes, globals_->url_security_manager.get(), |
901 resolver, gssapi_library_name_, negotiate_disable_cname_lookup_, | 910 resolver, gssapi_library_name_, negotiate_disable_cname_lookup_, |
902 negotiate_enable_port_)); | 911 negotiate_enable_port_)); |
903 | 912 |
904 if (!spdyproxy_auth_origins_.empty()) { | 913 if (globals_->data_reduction_proxy_params.get()) { |
905 registry_factory->RegisterSchemeFactory( | 914 std::vector<GURL> data_reduction_proxies = |
906 "spdyproxy", | 915 globals_->data_reduction_proxy_params->GetAllowedProxies(); |
907 new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory( | 916 if (!data_reduction_proxies.empty()) { |
908 spdyproxy_auth_origins_)); | 917 registry_factory->RegisterSchemeFactory( |
| 918 "spdyproxy", |
| 919 new data_reduction_proxy::HttpAuthHandlerDataReductionProxy::Factory( |
| 920 data_reduction_proxies)); |
| 921 } |
909 } | 922 } |
910 | 923 |
911 return registry_factory.release(); | 924 return registry_factory.release(); |
912 } | 925 } |
913 | 926 |
914 void IOThread::ClearHostCache() { | 927 void IOThread::ClearHostCache() { |
915 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 928 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
916 | 929 |
917 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); | 930 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); |
918 if (host_cache) | 931 if (host_cache) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 std::string version_flag = | 1213 std::string version_flag = |
1201 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1214 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1202 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1215 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1203 net::QuicVersion version = supported_versions[i]; | 1216 net::QuicVersion version = supported_versions[i]; |
1204 if (net::QuicVersionToString(version) == version_flag) { | 1217 if (net::QuicVersionToString(version) == version_flag) { |
1205 return version; | 1218 return version; |
1206 } | 1219 } |
1207 } | 1220 } |
1208 return net::QUIC_VERSION_UNSUPPORTED; | 1221 return net::QUIC_VERSION_UNSUPPORTED; |
1209 } | 1222 } |
OLD | NEW |