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