| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, | 435 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, |
| 436 local_state, | 436 local_state, |
| 437 base::Bind(&IOThread::UpdateDnsClientEnabled, | 437 base::Bind(&IOThread::UpdateDnsClientEnabled, |
| 438 base::Unretained(this))); | 438 base::Unretained(this))); |
| 439 dns_client_enabled_.MoveToThread(io_thread_proxy); | 439 dns_client_enabled_.MoveToThread(io_thread_proxy); |
| 440 | 440 |
| 441 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, | 441 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, |
| 442 local_state); | 442 local_state); |
| 443 quick_check_enabled_.MoveToThread(io_thread_proxy); | 443 quick_check_enabled_.MoveToThread(io_thread_proxy); |
| 444 | 444 |
| 445 pac_https_url_stripping_enabled_.Init(prefs::kPacHttpsUrlStrippingEnabled, |
| 446 local_state); |
| 447 pac_https_url_stripping_enabled_.MoveToThread(io_thread_proxy); |
| 448 |
| 445 is_spdy_allowed_by_policy_ = | 449 is_spdy_allowed_by_policy_ = |
| 446 policy_service | 450 policy_service |
| 447 ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 451 ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
| 448 std::string())) | 452 std::string())) |
| 449 .Get(policy::key::kDisableSpdy) == nullptr; | 453 .Get(policy::key::kDisableSpdy) == nullptr; |
| 450 | 454 |
| 451 const base::Value* value = policy_service->GetPolicies( | 455 const base::Value* value = policy_service->GetPolicies( |
| 452 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 456 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
| 453 std::string())).GetValue(policy::key::kQuicAllowed); | 457 std::string())).GetValue(policy::key::kQuicAllowed); |
| 454 if (value) | 458 if (value) |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); | 1046 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
| 1043 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, | 1047 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, |
| 1044 std::string()); | 1048 std::string()); |
| 1045 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); | 1049 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); |
| 1046 registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, | 1050 registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, |
| 1047 std::string()); | 1051 std::string()); |
| 1048 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); | 1052 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); |
| 1049 data_reduction_proxy::RegisterPrefs(registry); | 1053 data_reduction_proxy::RegisterPrefs(registry); |
| 1050 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); | 1054 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); |
| 1051 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); | 1055 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); |
| 1056 registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true); |
| 1052 } | 1057 } |
| 1053 | 1058 |
| 1054 void IOThread::UpdateServerWhitelist() { | 1059 void IOThread::UpdateServerWhitelist() { |
| 1055 globals_->http_auth_preferences->set_server_whitelist( | 1060 globals_->http_auth_preferences->set_server_whitelist( |
| 1056 auth_server_whitelist_.GetValue()); | 1061 auth_server_whitelist_.GetValue()); |
| 1057 } | 1062 } |
| 1058 | 1063 |
| 1059 void IOThread::UpdateDelegateWhitelist() { | 1064 void IOThread::UpdateDelegateWhitelist() { |
| 1060 globals_->http_auth_preferences->set_delegate_whitelist( | 1065 globals_->http_auth_preferences->set_delegate_whitelist( |
| 1061 auth_delegate_whitelist_.GetValue()); | 1066 auth_delegate_whitelist_.GetValue()); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1157 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1153 DCHECK(!globals_->system_proxy_service.get()); | 1158 DCHECK(!globals_->system_proxy_service.get()); |
| 1154 DCHECK(system_proxy_config_service_.get()); | 1159 DCHECK(system_proxy_config_service_.get()); |
| 1155 | 1160 |
| 1156 const base::CommandLine& command_line = | 1161 const base::CommandLine& command_line = |
| 1157 *base::CommandLine::ForCurrentProcess(); | 1162 *base::CommandLine::ForCurrentProcess(); |
| 1158 globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( | 1163 globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( |
| 1159 net_log_, globals_->proxy_script_fetcher_context.get(), | 1164 net_log_, globals_->proxy_script_fetcher_context.get(), |
| 1160 globals_->system_network_delegate.get(), | 1165 globals_->system_network_delegate.get(), |
| 1161 std::move(system_proxy_config_service_), command_line, | 1166 std::move(system_proxy_config_service_), command_line, |
| 1162 quick_check_enabled_.GetValue()); | 1167 WpadQuickCheckEnabled(), PacHttpsUrlStrippingEnabled()); |
| 1163 | 1168 |
| 1164 globals_->system_request_context.reset( | 1169 globals_->system_request_context.reset( |
| 1165 ConstructSystemRequestContext(globals_, params_, net_log_)); | 1170 ConstructSystemRequestContext(globals_, params_, net_log_)); |
| 1166 } | 1171 } |
| 1167 | 1172 |
| 1168 void IOThread::UpdateDnsClientEnabled() { | 1173 void IOThread::UpdateDnsClientEnabled() { |
| 1169 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 1174 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
| 1170 } | 1175 } |
| 1171 | 1176 |
| 1172 // static | 1177 // static |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1556 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1552 net::QuicVersion version = supported_versions[i]; | 1557 net::QuicVersion version = supported_versions[i]; |
| 1553 if (net::QuicVersionToString(version) == quic_version) { | 1558 if (net::QuicVersionToString(version) == quic_version) { |
| 1554 return version; | 1559 return version; |
| 1555 } | 1560 } |
| 1556 } | 1561 } |
| 1557 | 1562 |
| 1558 return net::QUIC_VERSION_UNSUPPORTED; | 1563 return net::QUIC_VERSION_UNSUPPORTED; |
| 1559 } | 1564 } |
| 1560 | 1565 |
| 1566 bool IOThread::WpadQuickCheckEnabled() const { |
| 1567 return quick_check_enabled_.GetValue(); |
| 1568 } |
| 1569 |
| 1570 bool IOThread::PacHttpsUrlStrippingEnabled() const { |
| 1571 return pac_https_url_stripping_enabled_.GetValue(); |
| 1572 } |
| 1573 |
| 1561 // static | 1574 // static |
| 1562 net::URLRequestContext* IOThread::ConstructSystemRequestContext( | 1575 net::URLRequestContext* IOThread::ConstructSystemRequestContext( |
| 1563 IOThread::Globals* globals, | 1576 IOThread::Globals* globals, |
| 1564 const net::HttpNetworkSession::Params& params, | 1577 const net::HttpNetworkSession::Params& params, |
| 1565 net::NetLog* net_log) { | 1578 net::NetLog* net_log) { |
| 1566 net::URLRequestContext* context = new SystemURLRequestContext; | 1579 net::URLRequestContext* context = new SystemURLRequestContext; |
| 1567 context->set_net_log(net_log); | 1580 context->set_net_log(net_log); |
| 1568 context->set_host_resolver(globals->host_resolver.get()); | 1581 context->set_host_resolver(globals->host_resolver.get()); |
| 1569 context->set_cert_verifier(globals->cert_verifier.get()); | 1582 context->set_cert_verifier(globals->cert_verifier.get()); |
| 1570 context->set_transport_security_state( | 1583 context->set_transport_security_state( |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1709 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1697 // system URLRequestContext too. There's no reason this should be tied to a | 1710 // system URLRequestContext too. There's no reason this should be tied to a |
| 1698 // profile. | 1711 // profile. |
| 1699 return context; | 1712 return context; |
| 1700 } | 1713 } |
| 1701 | 1714 |
| 1702 const metrics::UpdateUsagePrefCallbackType& | 1715 const metrics::UpdateUsagePrefCallbackType& |
| 1703 IOThread::GetMetricsDataUseForwarder() { | 1716 IOThread::GetMetricsDataUseForwarder() { |
| 1704 return metrics_data_use_forwarder_; | 1717 return metrics_data_use_forwarder_; |
| 1705 } | 1718 } |
| OLD | NEW |