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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/net/chrome_url_request_context.h" | 28 #include "chrome/browser/net/chrome_url_request_context.h" |
29 #include "chrome/browser/net/connect_interceptor.h" | 29 #include "chrome/browser/net/connect_interceptor.h" |
30 #include "chrome/browser/net/dns_probe_service.h" | 30 #include "chrome/browser/net/dns_probe_service.h" |
31 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 31 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
32 #include "chrome/browser/net/load_time_stats.h" | 32 #include "chrome/browser/net/load_time_stats.h" |
33 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 33 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
34 #include "chrome/browser/net/proxy_service_factory.h" | 34 #include "chrome/browser/net/proxy_service_factory.h" |
35 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 35 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
36 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" | 36 #include "chrome/browser/net/spdyproxy/http_auth_handler_spdyproxy.h" |
37 #include "chrome/browser/policy/policy_service.h" | 37 #include "chrome/browser/policy/policy_service.h" |
| 38 #include "chrome/browser/prefs/pref_registry_simple.h" |
38 #include "chrome/browser/prefs/pref_service.h" | 39 #include "chrome/browser/prefs/pref_service.h" |
39 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
41 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
42 #include "net/base/cert_verifier.h" | 43 #include "net/base/cert_verifier.h" |
43 #include "net/base/default_server_bound_cert_store.h" | 44 #include "net/base/default_server_bound_cert_store.h" |
44 #include "net/base/host_cache.h" | 45 #include "net/base/host_cache.h" |
45 #include "net/base/host_mapping_rules.h" | 46 #include "net/base/host_mapping_rules.h" |
46 #include "net/base/host_resolver.h" | 47 #include "net/base/host_resolver.h" |
47 #include "net/base/mapped_host_resolver.h" | 48 #include "net/base/mapped_host_resolver.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 ignore_certificate_errors(false), | 351 ignore_certificate_errors(false), |
351 http_pipelining_enabled(false), | 352 http_pipelining_enabled(false), |
352 testing_fixed_http_port(0), | 353 testing_fixed_http_port(0), |
353 testing_fixed_https_port(0) {} | 354 testing_fixed_https_port(0) {} |
354 | 355 |
355 IOThread::Globals::~Globals() {} | 356 IOThread::Globals::~Globals() {} |
356 | 357 |
357 // |local_state| is passed in explicitly in order to (1) reduce implicit | 358 // |local_state| is passed in explicitly in order to (1) reduce implicit |
358 // dependencies and (2) make IOThread more flexible for testing. | 359 // dependencies and (2) make IOThread more flexible for testing. |
359 IOThread::IOThread( | 360 IOThread::IOThread( |
360 PrefServiceSimple* local_state, | 361 PrefService* local_state, |
361 policy::PolicyService* policy_service, | 362 policy::PolicyService* policy_service, |
362 ChromeNetLog* net_log, | 363 ChromeNetLog* net_log, |
363 extensions::EventRouterForwarder* extension_event_router_forwarder) | 364 extensions::EventRouterForwarder* extension_event_router_forwarder) |
364 : net_log_(net_log), | 365 : net_log_(net_log), |
365 extension_event_router_forwarder_(extension_event_router_forwarder), | 366 extension_event_router_forwarder_(extension_event_router_forwarder), |
366 globals_(NULL), | 367 globals_(NULL), |
367 sdch_manager_(NULL), | 368 sdch_manager_(NULL), |
368 is_spdy_disabled_by_policy_(false), | 369 is_spdy_disabled_by_policy_(false), |
369 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 370 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
370 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make | 371 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make |
371 // sure that everything is initialized in the right order. | 372 // sure that everything is initialized in the right order. |
372 // | 373 // |
373 // TODO(joi): See if we can fix so it does get registered from | 374 // TODO(joi): See if we can fix so it does get registered from |
374 // browser_prefs::RegisterLocalState. | 375 // browser_prefs::RegisterLocalState. |
375 RegisterPrefs(local_state); | 376 PrefRegistrySimple* registry = static_cast<PrefRegistrySimple*>( |
| 377 local_state->DeprecatedGetPrefRegistry()); |
| 378 RegisterPrefs(registry); |
376 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); | 379 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); |
377 negotiate_disable_cname_lookup_ = local_state->GetBoolean( | 380 negotiate_disable_cname_lookup_ = local_state->GetBoolean( |
378 prefs::kDisableAuthNegotiateCnameLookup); | 381 prefs::kDisableAuthNegotiateCnameLookup); |
379 negotiate_enable_port_ = local_state->GetBoolean( | 382 negotiate_enable_port_ = local_state->GetBoolean( |
380 prefs::kEnableAuthNegotiatePort); | 383 prefs::kEnableAuthNegotiatePort); |
381 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist); | 384 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist); |
382 auth_delegate_whitelist_ = local_state->GetString( | 385 auth_delegate_whitelist_ = local_state->GetString( |
383 prefs::kAuthNegotiateDelegateWhitelist); | 386 prefs::kAuthNegotiateDelegateWhitelist); |
384 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); | 387 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); |
385 pref_proxy_config_tracker_.reset( | 388 pref_proxy_config_tracker_.reset( |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 globals_->initial_max_spdy_concurrent_streams.set(streams); | 722 globals_->initial_max_spdy_concurrent_streams.set(streams); |
720 } else if (option.empty() && it == spdy_options.begin()) { | 723 } else if (option.empty() && it == spdy_options.begin()) { |
721 continue; | 724 continue; |
722 } else { | 725 } else { |
723 LOG(DFATAL) << "Unrecognized spdy option: " << option; | 726 LOG(DFATAL) << "Unrecognized spdy option: " << option; |
724 } | 727 } |
725 } | 728 } |
726 } | 729 } |
727 | 730 |
728 // static | 731 // static |
729 void IOThread::RegisterPrefs(PrefServiceSimple* local_state) { | 732 void IOThread::RegisterPrefs(PrefRegistrySimple* local_state) { |
730 local_state->RegisterStringPref(prefs::kAuthSchemes, | 733 local_state->RegisterStringPref(prefs::kAuthSchemes, |
731 "basic,digest,ntlm,negotiate," | 734 "basic,digest,ntlm,negotiate," |
732 "spdyproxy"); | 735 "spdyproxy"); |
733 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, | 736 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, |
734 false); | 737 false); |
735 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); | 738 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); |
736 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, ""); | 739 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, ""); |
737 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); | 740 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); |
738 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, ""); | 741 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, ""); |
739 local_state->RegisterStringPref(prefs::kSpdyProxyOrigin, ""); | 742 local_state->RegisterStringPref(prefs::kSpdyProxyOrigin, ""); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 globals_->system_request_context.reset( | 896 globals_->system_request_context.reset( |
894 ConstructSystemRequestContext(globals_, net_log_)); | 897 ConstructSystemRequestContext(globals_, net_log_)); |
895 | 898 |
896 sdch_manager_->set_sdch_fetcher( | 899 sdch_manager_->set_sdch_fetcher( |
897 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); | 900 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); |
898 } | 901 } |
899 | 902 |
900 void IOThread::UpdateDnsClientEnabled() { | 903 void IOThread::UpdateDnsClientEnabled() { |
901 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 904 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
902 } | 905 } |
OLD | NEW |