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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 #include "components/prefs/pref_registry_simple.h" | 58 #include "components/prefs/pref_registry_simple.h" |
59 #include "components/prefs/pref_service.h" | 59 #include "components/prefs/pref_service.h" |
60 #include "components/proxy_config/pref_proxy_config_tracker.h" | 60 #include "components/proxy_config/pref_proxy_config_tracker.h" |
61 #include "components/variations/variations_associated_data.h" | 61 #include "components/variations/variations_associated_data.h" |
62 #include "components/version_info/version_info.h" | 62 #include "components/version_info/version_info.h" |
63 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
64 #include "content/public/browser/cookie_store_factory.h" | 64 #include "content/public/browser/cookie_store_factory.h" |
65 #include "content/public/common/content_features.h" | 65 #include "content/public/common/content_features.h" |
66 #include "content/public/common/content_switches.h" | 66 #include "content/public/common/content_switches.h" |
67 #include "content/public/common/user_agent.h" | 67 #include "content/public/common/user_agent.h" |
| 68 #include "extensions/features/features.h" |
68 #include "net/base/host_mapping_rules.h" | 69 #include "net/base/host_mapping_rules.h" |
69 #include "net/base/logging_network_change_observer.h" | 70 #include "net/base/logging_network_change_observer.h" |
70 #include "net/base/sdch_manager.h" | 71 #include "net/base/sdch_manager.h" |
71 #include "net/cert/caching_cert_verifier.h" | 72 #include "net/cert/caching_cert_verifier.h" |
72 #include "net/cert/cert_verifier.h" | 73 #include "net/cert/cert_verifier.h" |
73 #include "net/cert/cert_verify_proc.h" | 74 #include "net/cert/cert_verify_proc.h" |
74 #include "net/cert/ct_known_logs.h" | 75 #include "net/cert/ct_known_logs.h" |
75 #include "net/cert/ct_log_verifier.h" | 76 #include "net/cert/ct_log_verifier.h" |
76 #include "net/cert/ct_policy_enforcer.h" | 77 #include "net/cert/ct_policy_enforcer.h" |
77 #include "net/cert/ct_verifier.h" | 78 #include "net/cert/ct_verifier.h" |
(...skipping 24 matching lines...) Expand all Loading... |
102 #include "net/url_request/file_protocol_handler.h" | 103 #include "net/url_request/file_protocol_handler.h" |
103 #include "net/url_request/ftp_protocol_handler.h" | 104 #include "net/url_request/ftp_protocol_handler.h" |
104 #include "net/url_request/static_http_user_agent_settings.h" | 105 #include "net/url_request/static_http_user_agent_settings.h" |
105 #include "net/url_request/url_fetcher.h" | 106 #include "net/url_request/url_fetcher.h" |
106 #include "net/url_request/url_request_context.h" | 107 #include "net/url_request/url_request_context.h" |
107 #include "net/url_request/url_request_context_builder.h" | 108 #include "net/url_request/url_request_context_builder.h" |
108 #include "net/url_request/url_request_context_getter.h" | 109 #include "net/url_request/url_request_context_getter.h" |
109 #include "net/url_request/url_request_job_factory_impl.h" | 110 #include "net/url_request/url_request_job_factory_impl.h" |
110 #include "url/url_constants.h" | 111 #include "url/url_constants.h" |
111 | 112 |
112 #if defined(ENABLE_EXTENSIONS) | 113 #if BUILDFLAG(ENABLE_EXTENSIONS) |
113 #include "chrome/browser/extensions/event_router_forwarder.h" | 114 #include "chrome/browser/extensions/event_router_forwarder.h" |
114 #endif | 115 #endif |
115 | 116 |
116 #if defined(USE_NSS_CERTS) | 117 #if defined(USE_NSS_CERTS) |
117 #include "net/cert_net/nss_ocsp.h" | 118 #include "net/cert_net/nss_ocsp.h" |
118 #endif | 119 #endif |
119 | 120 |
120 #if BUILDFLAG(ANDROID_JAVA_UI) | 121 #if BUILDFLAG(ANDROID_JAVA_UI) |
121 #include "base/android/build_info.h" | 122 #include "base/android/build_info.h" |
122 #include "chrome/browser/android/data_usage/external_data_use_observer.h" | 123 #include "chrome/browser/android/data_usage/external_data_use_observer.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 IOThread::Globals::~Globals() {} | 311 IOThread::Globals::~Globals() {} |
311 | 312 |
312 // |local_state| is passed in explicitly in order to (1) reduce implicit | 313 // |local_state| is passed in explicitly in order to (1) reduce implicit |
313 // dependencies and (2) make IOThread more flexible for testing. | 314 // dependencies and (2) make IOThread more flexible for testing. |
314 IOThread::IOThread( | 315 IOThread::IOThread( |
315 PrefService* local_state, | 316 PrefService* local_state, |
316 policy::PolicyService* policy_service, | 317 policy::PolicyService* policy_service, |
317 net_log::ChromeNetLog* net_log, | 318 net_log::ChromeNetLog* net_log, |
318 extensions::EventRouterForwarder* extension_event_router_forwarder) | 319 extensions::EventRouterForwarder* extension_event_router_forwarder) |
319 : net_log_(net_log), | 320 : net_log_(net_log), |
320 #if defined(ENABLE_EXTENSIONS) | 321 #if BUILDFLAG(ENABLE_EXTENSIONS) |
321 extension_event_router_forwarder_(extension_event_router_forwarder), | 322 extension_event_router_forwarder_(extension_event_router_forwarder), |
322 #endif | 323 #endif |
323 globals_(nullptr), | 324 globals_(nullptr), |
324 is_quic_allowed_by_policy_(true), | 325 is_quic_allowed_by_policy_(true), |
325 http_09_on_non_default_ports_enabled_(false), | 326 http_09_on_non_default_ports_enabled_(false), |
326 creation_time_(base::TimeTicks::Now()), | 327 creation_time_(base::TimeTicks::Now()), |
327 weak_factory_(this) { | 328 weak_factory_(this) { |
328 scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy = | 329 scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy = |
329 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 330 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
330 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); | 331 auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 488 |
488 // Add an observer that will emit network change events to the ChromeNetLog. | 489 // Add an observer that will emit network change events to the ChromeNetLog. |
489 // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be | 490 // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be |
490 // logging the network change before other IO thread consumers respond to it. | 491 // logging the network change before other IO thread consumers respond to it. |
491 network_change_observer_.reset( | 492 network_change_observer_.reset( |
492 new net::LoggingNetworkChangeObserver(net_log_)); | 493 new net::LoggingNetworkChangeObserver(net_log_)); |
493 | 494 |
494 // Setup the HistogramWatcher to run on the IO thread. | 495 // Setup the HistogramWatcher to run on the IO thread. |
495 net::NetworkChangeNotifier::InitHistogramWatcher(); | 496 net::NetworkChangeNotifier::InitHistogramWatcher(); |
496 | 497 |
497 #if defined(ENABLE_EXTENSIONS) | 498 #if BUILDFLAG(ENABLE_EXTENSIONS) |
498 globals_->extension_event_router_forwarder = | 499 globals_->extension_event_router_forwarder = |
499 extension_event_router_forwarder_; | 500 extension_event_router_forwarder_; |
500 #endif | 501 #endif |
501 | 502 |
502 std::unique_ptr<data_usage::DataUseAmortizer> data_use_amortizer; | 503 std::unique_ptr<data_usage::DataUseAmortizer> data_use_amortizer; |
503 #if BUILDFLAG(ANDROID_JAVA_UI) | 504 #if BUILDFLAG(ANDROID_JAVA_UI) |
504 data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); | 505 data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); |
505 #endif | 506 #endif |
506 | 507 |
507 globals_->data_use_ascriber = | 508 globals_->data_use_ascriber = |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1076 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1076 // system URLRequestContext too. There's no reason this should be tied to a | 1077 // system URLRequestContext too. There's no reason this should be tied to a |
1077 // profile. | 1078 // profile. |
1078 return context; | 1079 return context; |
1079 } | 1080 } |
1080 | 1081 |
1081 const metrics::UpdateUsagePrefCallbackType& | 1082 const metrics::UpdateUsagePrefCallbackType& |
1082 IOThread::GetMetricsDataUseForwarder() { | 1083 IOThread::GetMetricsDataUseForwarder() { |
1083 return metrics_data_use_forwarder_; | 1084 return metrics_data_use_forwarder_; |
1084 } | 1085 } |
OLD | NEW |