| 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/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/debug/leak_tracker.h" | 14 #include "base/debug/leak_tracker.h" |
| 15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
| 18 #include "base/prefs/pref_registry_simple.h" | 18 #include "base/prefs/pref_registry_simple.h" |
| 19 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| 23 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
| 24 #include "base/threading/sequenced_worker_pool.h" | 24 #include "base/threading/sequenced_worker_pool.h" |
| 25 #include "base/threading/thread.h" | 25 #include "base/threading/thread.h" |
| 26 #include "base/threading/worker_pool.h" | 26 #include "base/threading/worker_pool.h" |
| 27 #include "base/time/default_tick_clock.h" | |
| 28 #include "base/time/time.h" | 27 #include "base/time/time.h" |
| 29 #include "build/build_config.h" | 28 #include "build/build_config.h" |
| 30 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
| 31 #include "chrome/browser/extensions/event_router_forwarder.h" | 30 #include "chrome/browser/extensions/event_router_forwarder.h" |
| 32 #include "chrome/browser/net/async_dns_field_trial.h" | 31 #include "chrome/browser/net/async_dns_field_trial.h" |
| 33 #include "chrome/browser/net/chrome_net_log.h" | 32 #include "chrome/browser/net/chrome_net_log.h" |
| 34 #include "chrome/browser/net/chrome_network_delegate.h" | 33 #include "chrome/browser/net/chrome_network_delegate.h" |
| 35 #include "chrome/browser/net/chrome_url_request_context.h" | 34 #include "chrome/browser/net/chrome_url_request_context.h" |
| 36 #include "chrome/browser/net/connect_interceptor.h" | 35 #include "chrome/browser/net/connect_interceptor.h" |
| 37 #include "chrome/browser/net/dns_probe_service.h" | 36 #include "chrome/browser/net/dns_probe_service.h" |
| 38 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 37 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
| 39 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 38 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 40 #include "chrome/browser/net/proxy_service_factory.h" | 39 #include "chrome/browser/net/proxy_service_factory.h" |
| 41 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 40 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| 42 #include "chrome/common/chrome_content_client.h" | 41 #include "chrome/common/chrome_content_client.h" |
| 43 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 44 #include "chrome/common/chrome_version_info.h" | 43 #include "chrome/common/chrome_version_info.h" |
| 45 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 46 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 47 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" | 46 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
| 48 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti
on_proxy.h" | 47 #include "components/data_reduction_proxy/browser/http_auth_handler_data_reducti
on_proxy.h" |
| 49 #include "components/policy/core/common/policy_service.h" | 48 #include "components/policy/core/common/policy_service.h" |
| 50 #include "content/public/browser/browser_thread.h" | 49 #include "content/public/browser/browser_thread.h" |
| 51 #include "content/public/browser/cookie_store_factory.h" | 50 #include "content/public/browser/cookie_store_factory.h" |
| 52 #include "net/base/host_mapping_rules.h" | 51 #include "net/base/host_mapping_rules.h" |
| 53 #include "net/base/net_util.h" | 52 #include "net/base/net_util.h" |
| 54 #include "net/base/network_time_notifier.h" | |
| 55 #include "net/base/sdch_manager.h" | 53 #include "net/base/sdch_manager.h" |
| 56 #include "net/cert/cert_verifier.h" | 54 #include "net/cert/cert_verifier.h" |
| 57 #include "net/cert/cert_verify_proc.h" | 55 #include "net/cert/cert_verify_proc.h" |
| 58 #include "net/cert/ct_known_logs.h" | 56 #include "net/cert/ct_known_logs.h" |
| 59 #include "net/cert/ct_verifier.h" | 57 #include "net/cert/ct_verifier.h" |
| 60 #include "net/cert/multi_threaded_cert_verifier.h" | 58 #include "net/cert/multi_threaded_cert_verifier.h" |
| 61 #include "net/cookies/cookie_store.h" | 59 #include "net/cookies/cookie_store.h" |
| 62 #include "net/dns/host_cache.h" | 60 #include "net/dns/host_cache.h" |
| 63 #include "net/dns/host_resolver.h" | 61 #include "net/dns/host_resolver.h" |
| 64 #include "net/dns/mapped_host_resolver.h" | 62 #include "net/dns/mapped_host_resolver.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 job_factory.PassAs<net::URLRequestJobFactory>(); | 677 job_factory.PassAs<net::URLRequestJobFactory>(); |
| 680 | 678 |
| 681 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); | 679 globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); |
| 682 globals_->throttler_manager->set_net_log(net_log_); | 680 globals_->throttler_manager->set_net_log(net_log_); |
| 683 // Always done in production, disabled only for unit tests. | 681 // Always done in production, disabled only for unit tests. |
| 684 globals_->throttler_manager->set_enable_thread_checks(true); | 682 globals_->throttler_manager->set_enable_thread_checks(true); |
| 685 | 683 |
| 686 globals_->proxy_script_fetcher_context.reset( | 684 globals_->proxy_script_fetcher_context.reset( |
| 687 ConstructProxyScriptFetcherContext(globals_, net_log_)); | 685 ConstructProxyScriptFetcherContext(globals_, net_log_)); |
| 688 | 686 |
| 689 globals_->network_time_notifier.reset( | |
| 690 new net::NetworkTimeNotifier( | |
| 691 scoped_ptr<base::TickClock>(new base::DefaultTickClock()))); | |
| 692 | |
| 693 sdch_manager_ = new net::SdchManager(); | 687 sdch_manager_ = new net::SdchManager(); |
| 694 | 688 |
| 695 #if defined(OS_MACOSX) && !defined(OS_IOS) | 689 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 696 // Start observing Keychain events. This needs to be done on the UI thread, | 690 // Start observing Keychain events. This needs to be done on the UI thread, |
| 697 // as Keychain services requires a CFRunLoop. | 691 // as Keychain services requires a CFRunLoop. |
| 698 BrowserThread::PostTask(BrowserThread::UI, | 692 BrowserThread::PostTask(BrowserThread::UI, |
| 699 FROM_HERE, | 693 FROM_HERE, |
| 700 base::Bind(&ObserveKeychainEvents)); | 694 base::Bind(&ObserveKeychainEvents)); |
| 701 #endif | 695 #endif |
| 702 | 696 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 std::string version_flag = | 1209 std::string version_flag = |
| 1216 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1210 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
| 1217 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1211 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1218 net::QuicVersion version = supported_versions[i]; | 1212 net::QuicVersion version = supported_versions[i]; |
| 1219 if (net::QuicVersionToString(version) == version_flag) { | 1213 if (net::QuicVersionToString(version) == version_flag) { |
| 1220 return version; | 1214 return version; |
| 1221 } | 1215 } |
| 1222 } | 1216 } |
| 1223 return net::QUIC_VERSION_UNSUPPORTED; | 1217 return net::QUIC_VERSION_UNSUPPORTED; |
| 1224 } | 1218 } |
| OLD | NEW |