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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/debug/leak_tracker.h" | 13 #include "base/debug/leak_tracker.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
17 #include "base/string_split.h" | 17 #include "base/string_split.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
20 #include "base/threading/worker_pool.h" | 20 #include "base/threading/worker_pool.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 23 #include "chrome/browser/extensions/event_router_forwarder.h" |
24 #include "chrome/browser/net/chrome_net_log.h" | 24 #include "chrome/browser/net/chrome_net_log.h" |
25 #include "chrome/browser/net/chrome_network_delegate.h" | 25 #include "chrome/browser/net/chrome_network_delegate.h" |
26 #include "chrome/browser/net/chrome_url_request_context.h" | 26 #include "chrome/browser/net/chrome_url_request_context.h" |
27 #include "chrome/browser/net/connect_interceptor.h" | 27 #include "chrome/browser/net/connect_interceptor.h" |
28 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 28 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
29 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 29 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
30 #include "chrome/browser/net/proxy_service_factory.h" | 30 #include "chrome/browser/net/proxy_service_factory.h" |
31 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 31 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
32 #include "chrome/browser/prefs/pref_service.h" | 32 #include "chrome/browser/prefs/pref_service.h" |
33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 IOThread::Globals::Globals() | 307 IOThread::Globals::Globals() |
308 : ALLOW_THIS_IN_INITIALIZER_LIST( | 308 : ALLOW_THIS_IN_INITIALIZER_LIST( |
309 system_request_context_leak_checker(this)) {} | 309 system_request_context_leak_checker(this)) {} |
310 IOThread::Globals::~Globals() {} | 310 IOThread::Globals::~Globals() {} |
311 | 311 |
312 // |local_state| is passed in explicitly in order to (1) reduce implicit | 312 // |local_state| is passed in explicitly in order to (1) reduce implicit |
313 // dependencies and (2) make IOThread more flexible for testing. | 313 // dependencies and (2) make IOThread more flexible for testing. |
314 IOThread::IOThread( | 314 IOThread::IOThread( |
315 PrefService* local_state, | 315 PrefService* local_state, |
316 ChromeNetLog* net_log, | 316 ChromeNetLog* net_log, |
317 ExtensionEventRouterForwarder* extension_event_router_forwarder) | 317 extensions::EventRouterForwarder* extension_event_router_forwarder) |
318 : net_log_(net_log), | 318 : net_log_(net_log), |
319 extension_event_router_forwarder_(extension_event_router_forwarder), | 319 extension_event_router_forwarder_(extension_event_router_forwarder), |
320 globals_(NULL), | 320 globals_(NULL), |
321 sdch_manager_(NULL), | 321 sdch_manager_(NULL), |
322 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 322 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
323 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make | 323 // We call RegisterPrefs() here (instead of inside browser_prefs.cc) to make |
324 // sure that everything is initialized in the right order. | 324 // sure that everything is initialized in the right order. |
325 RegisterPrefs(local_state); | 325 RegisterPrefs(local_state); |
326 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); | 326 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); |
327 negotiate_disable_cname_lookup_ = local_state->GetBoolean( | 327 negotiate_disable_cname_lookup_ = local_state->GetBoolean( |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 new net::HttpNetworkLayer( | 624 new net::HttpNetworkLayer( |
625 new net::HttpNetworkSession(system_params))); | 625 new net::HttpNetworkSession(system_params))); |
626 globals_->system_ftp_transaction_factory.reset( | 626 globals_->system_ftp_transaction_factory.reset( |
627 new net::FtpNetworkLayer(globals_->host_resolver.get())); | 627 new net::FtpNetworkLayer(globals_->host_resolver.get())); |
628 globals_->system_request_context.reset( | 628 globals_->system_request_context.reset( |
629 ConstructSystemRequestContext(globals_, net_log_)); | 629 ConstructSystemRequestContext(globals_, net_log_)); |
630 | 630 |
631 sdch_manager_->set_sdch_fetcher( | 631 sdch_manager_->set_sdch_fetcher( |
632 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); | 632 new SdchDictionaryFetcher(system_url_request_context_getter_.get())); |
633 } | 633 } |
OLD | NEW |