Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 ignore_certificate_errors(false), 350 ignore_certificate_errors(false),
351 http_pipelining_enabled(false), 351 http_pipelining_enabled(false),
352 testing_fixed_http_port(0), 352 testing_fixed_http_port(0),
353 testing_fixed_https_port(0) {} 353 testing_fixed_https_port(0) {}
354 354
355 IOThread::Globals::~Globals() {} 355 IOThread::Globals::~Globals() {}
356 356
357 // |local_state| is passed in explicitly in order to (1) reduce implicit 357 // |local_state| is passed in explicitly in order to (1) reduce implicit
358 // dependencies and (2) make IOThread more flexible for testing. 358 // dependencies and (2) make IOThread more flexible for testing.
359 IOThread::IOThread( 359 IOThread::IOThread(
360 PrefService* local_state, 360 PrefServiceSimple* local_state,
361 policy::PolicyService* policy_service, 361 policy::PolicyService* policy_service,
362 ChromeNetLog* net_log, 362 ChromeNetLog* net_log,
363 extensions::EventRouterForwarder* extension_event_router_forwarder) 363 extensions::EventRouterForwarder* extension_event_router_forwarder)
364 : net_log_(net_log), 364 : net_log_(net_log),
365 extension_event_router_forwarder_(extension_event_router_forwarder), 365 extension_event_router_forwarder_(extension_event_router_forwarder),
366 globals_(NULL), 366 globals_(NULL),
367 sdch_manager_(NULL), 367 sdch_manager_(NULL),
368 is_spdy_disabled_by_policy_(false), 368 is_spdy_disabled_by_policy_(false),
369 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 369 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
370 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make 370 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make
371 // sure that everything is initialized in the right order. 371 // sure that everything is initialized in the right order.
372 //
373 // TODO(joi): See if we can fix so it does get registered from
374 // browser_prefs::RegisterLocalState.
372 RegisterPrefs(local_state); 375 RegisterPrefs(local_state);
373 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); 376 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes);
374 negotiate_disable_cname_lookup_ = local_state->GetBoolean( 377 negotiate_disable_cname_lookup_ = local_state->GetBoolean(
375 prefs::kDisableAuthNegotiateCnameLookup); 378 prefs::kDisableAuthNegotiateCnameLookup);
376 negotiate_enable_port_ = local_state->GetBoolean( 379 negotiate_enable_port_ = local_state->GetBoolean(
377 prefs::kEnableAuthNegotiatePort); 380 prefs::kEnableAuthNegotiatePort);
378 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist); 381 auth_server_whitelist_ = local_state->GetString(prefs::kAuthServerWhitelist);
379 auth_delegate_whitelist_ = local_state->GetString( 382 auth_delegate_whitelist_ = local_state->GetString(
380 prefs::kAuthNegotiateDelegateWhitelist); 383 prefs::kAuthNegotiateDelegateWhitelist);
381 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); 384 gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName);
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 globals_->initial_max_spdy_concurrent_streams.set(streams); 714 globals_->initial_max_spdy_concurrent_streams.set(streams);
712 } else if (option.empty() && it == spdy_options.begin()) { 715 } else if (option.empty() && it == spdy_options.begin()) {
713 continue; 716 continue;
714 } else { 717 } else {
715 LOG(DFATAL) << "Unrecognized spdy option: " << option; 718 LOG(DFATAL) << "Unrecognized spdy option: " << option;
716 } 719 }
717 } 720 }
718 } 721 }
719 722
720 // static 723 // static
721 void IOThread::RegisterPrefs(PrefService* local_state) { 724 void IOThread::RegisterPrefs(PrefServiceSimple* local_state) {
722 local_state->RegisterStringPref(prefs::kAuthSchemes, 725 local_state->RegisterStringPref(prefs::kAuthSchemes,
723 "basic,digest,ntlm,negotiate," 726 "basic,digest,ntlm,negotiate,"
724 "spdyproxy"); 727 "spdyproxy");
725 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, 728 local_state->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup,
726 false); 729 false);
727 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); 730 local_state->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false);
728 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, ""); 731 local_state->RegisterStringPref(prefs::kAuthServerWhitelist, "");
729 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); 732 local_state->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, "");
730 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, ""); 733 local_state->RegisterStringPref(prefs::kGSSAPILibraryName, "");
731 local_state->RegisterStringPref(prefs::kSpdyProxyOrigin, ""); 734 local_state->RegisterStringPref(prefs::kSpdyProxyOrigin, "");
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 globals_->system_request_context.reset( 890 globals_->system_request_context.reset(
888 ConstructSystemRequestContext(globals_, net_log_)); 891 ConstructSystemRequestContext(globals_, net_log_));
889 892
890 sdch_manager_->set_sdch_fetcher( 893 sdch_manager_->set_sdch_fetcher(
891 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); 894 new SdchDictionaryFetcher(system_url_request_context_getter_.get()));
892 } 895 }
893 896
894 void IOThread::UpdateDnsClientEnabled() { 897 void IOThread::UpdateDnsClientEnabled() {
895 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); 898 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_);
896 } 899 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698