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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, | 370 dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, |
371 local_state, | 371 local_state, |
372 base::Bind(&IOThread::UpdateDnsClientEnabled, | 372 base::Bind(&IOThread::UpdateDnsClientEnabled, |
373 base::Unretained(this))); | 373 base::Unretained(this))); |
374 dns_client_enabled_.MoveToThread(io_thread_proxy); | 374 dns_client_enabled_.MoveToThread(io_thread_proxy); |
375 | 375 |
376 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, | 376 quick_check_enabled_.Init(prefs::kQuickCheckEnabled, |
377 local_state); | 377 local_state); |
378 quick_check_enabled_.MoveToThread(io_thread_proxy); | 378 quick_check_enabled_.MoveToThread(io_thread_proxy); |
379 | 379 |
| 380 pac_https_url_stripping_enabled_.Init(prefs::kPacHttpsUrlStrippingEnabled, |
| 381 local_state); |
| 382 pac_https_url_stripping_enabled_.MoveToThread(io_thread_proxy); |
| 383 |
380 is_spdy_allowed_by_policy_ = | 384 is_spdy_allowed_by_policy_ = |
381 policy_service | 385 policy_service |
382 ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 386 ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
383 std::string())) | 387 std::string())) |
384 .Get(policy::key::kDisableSpdy) == nullptr; | 388 .Get(policy::key::kDisableSpdy) == nullptr; |
385 | 389 |
386 const base::Value* value = policy_service->GetPolicies( | 390 const base::Value* value = policy_service->GetPolicies( |
387 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, | 391 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, |
388 std::string())).GetValue(policy::key::kQuicAllowed); | 392 std::string())).GetValue(policy::key::kQuicAllowed); |
389 if (value) | 393 if (value) |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); | 821 registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
818 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, | 822 registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, |
819 std::string()); | 823 std::string()); |
820 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); | 824 registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); |
821 registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, | 825 registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, |
822 std::string()); | 826 std::string()); |
823 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); | 827 registry->RegisterBooleanPref(prefs::kEnableReferrers, true); |
824 data_reduction_proxy::RegisterPrefs(registry); | 828 data_reduction_proxy::RegisterPrefs(registry); |
825 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); | 829 registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); |
826 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); | 830 registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); |
| 831 registry->RegisterBooleanPref(prefs::kPacHttpsUrlStrippingEnabled, true); |
827 } | 832 } |
828 | 833 |
829 void IOThread::UpdateServerWhitelist() { | 834 void IOThread::UpdateServerWhitelist() { |
830 globals_->http_auth_preferences->set_server_whitelist( | 835 globals_->http_auth_preferences->set_server_whitelist( |
831 auth_server_whitelist_.GetValue()); | 836 auth_server_whitelist_.GetValue()); |
832 } | 837 } |
833 | 838 |
834 void IOThread::UpdateDelegateWhitelist() { | 839 void IOThread::UpdateDelegateWhitelist() { |
835 globals_->http_auth_preferences->set_delegate_whitelist( | 840 globals_->http_auth_preferences->set_delegate_whitelist( |
836 auth_delegate_whitelist_.GetValue()); | 841 auth_delegate_whitelist_.GetValue()); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 931 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
927 DCHECK(!globals_->system_proxy_service.get()); | 932 DCHECK(!globals_->system_proxy_service.get()); |
928 DCHECK(system_proxy_config_service_.get()); | 933 DCHECK(system_proxy_config_service_.get()); |
929 | 934 |
930 const base::CommandLine& command_line = | 935 const base::CommandLine& command_line = |
931 *base::CommandLine::ForCurrentProcess(); | 936 *base::CommandLine::ForCurrentProcess(); |
932 globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( | 937 globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( |
933 net_log_, globals_->proxy_script_fetcher_context.get(), | 938 net_log_, globals_->proxy_script_fetcher_context.get(), |
934 globals_->system_network_delegate.get(), | 939 globals_->system_network_delegate.get(), |
935 std::move(system_proxy_config_service_), command_line, | 940 std::move(system_proxy_config_service_), command_line, |
936 quick_check_enabled_.GetValue()); | 941 WpadQuickCheckEnabled(), PacHttpsUrlStrippingEnabled()); |
937 | 942 |
938 globals_->system_request_context.reset( | 943 globals_->system_request_context.reset( |
939 ConstructSystemRequestContext(globals_, params_, net_log_)); | 944 ConstructSystemRequestContext(globals_, params_, net_log_)); |
940 } | 945 } |
941 | 946 |
942 void IOThread::UpdateDnsClientEnabled() { | 947 void IOThread::UpdateDnsClientEnabled() { |
943 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 948 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
944 } | 949 } |
945 | 950 |
946 void IOThread::RegisterSTHObserver(net::ct::STHObserver* observer) { | 951 void IOThread::RegisterSTHObserver(net::ct::STHObserver* observer) { |
947 chrome_browser_net::GetGlobalSTHDistributor()->RegisterObserver(observer); | 952 chrome_browser_net::GetGlobalSTHDistributor()->RegisterObserver(observer); |
948 } | 953 } |
949 | 954 |
950 void IOThread::UnregisterSTHObserver(net::ct::STHObserver* observer) { | 955 void IOThread::UnregisterSTHObserver(net::ct::STHObserver* observer) { |
951 chrome_browser_net::GetGlobalSTHDistributor()->UnregisterObserver(observer); | 956 chrome_browser_net::GetGlobalSTHDistributor()->UnregisterObserver(observer); |
952 } | 957 } |
953 | 958 |
| 959 bool IOThread::WpadQuickCheckEnabled() const { |
| 960 return quick_check_enabled_.GetValue(); |
| 961 } |
| 962 |
| 963 bool IOThread::PacHttpsUrlStrippingEnabled() const { |
| 964 return pac_https_url_stripping_enabled_.GetValue(); |
| 965 } |
| 966 |
954 // static | 967 // static |
955 net::URLRequestContext* IOThread::ConstructSystemRequestContext( | 968 net::URLRequestContext* IOThread::ConstructSystemRequestContext( |
956 IOThread::Globals* globals, | 969 IOThread::Globals* globals, |
957 const net::HttpNetworkSession::Params& params, | 970 const net::HttpNetworkSession::Params& params, |
958 net::NetLog* net_log) { | 971 net::NetLog* net_log) { |
959 net::URLRequestContext* context = new SystemURLRequestContext; | 972 net::URLRequestContext* context = new SystemURLRequestContext; |
960 context->set_net_log(net_log); | 973 context->set_net_log(net_log); |
961 context->set_host_resolver(globals->host_resolver.get()); | 974 context->set_host_resolver(globals->host_resolver.get()); |
962 context->set_cert_verifier(globals->cert_verifier.get()); | 975 context->set_cert_verifier(globals->cert_verifier.get()); |
963 context->set_transport_security_state( | 976 context->set_transport_security_state( |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1102 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1090 // system URLRequestContext too. There's no reason this should be tied to a | 1103 // system URLRequestContext too. There's no reason this should be tied to a |
1091 // profile. | 1104 // profile. |
1092 return context; | 1105 return context; |
1093 } | 1106 } |
1094 | 1107 |
1095 const metrics::UpdateUsagePrefCallbackType& | 1108 const metrics::UpdateUsagePrefCallbackType& |
1096 IOThread::GetMetricsDataUseForwarder() { | 1109 IOThread::GetMetricsDataUseForwarder() { |
1097 return metrics_data_use_forwarder_; | 1110 return metrics_data_use_forwarder_; |
1098 } | 1111 } |
OLD | NEW |