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/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
23 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.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_sdch_policy.h" | 26 #include "chrome/browser/net/chrome_sdch_policy.h" |
27 #include "chrome/browser/net/connect_interceptor.h" | 27 #include "chrome/browser/net/connect_interceptor.h" |
28 #include "chrome/browser/net/cookie_store_util.h" | 28 #include "chrome/browser/net/cookie_store_util.h" |
29 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 29 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
30 #include "chrome/browser/net/predictor.h" | 30 #include "chrome/browser/net/predictor.h" |
31 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 31 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | |
33 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
34 #include "chrome/browser/profiles/profile.h" | 33 #include "chrome/browser/profiles/profile.h" |
35 #include "chrome/common/chrome_constants.h" | 34 #include "chrome/common/chrome_constants.h" |
36 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
38 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
39 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" | 38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" |
| 39 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator.h" |
40 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte
rceptor.h" | 40 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte
rceptor.h" |
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" | 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" |
42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot
ocol.h" | 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot
ocol.h" |
43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" | 43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" |
44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag
e_stats.h" | 44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag
e_stats.h" |
45 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 45 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
47 #include "components/domain_reliability/monitor.h" | 47 #include "components/domain_reliability/monitor.h" |
48 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
49 #include "content/public/browser/cookie_store_factory.h" | 49 #include "content/public/browser/cookie_store_factory.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 int media_cache_max_size, | 133 int media_cache_max_size, |
134 const base::FilePath& extensions_cookie_path, | 134 const base::FilePath& extensions_cookie_path, |
135 const base::FilePath& profile_path, | 135 const base::FilePath& profile_path, |
136 const base::FilePath& infinite_cache_path, | 136 const base::FilePath& infinite_cache_path, |
137 chrome_browser_net::Predictor* predictor, | 137 chrome_browser_net::Predictor* predictor, |
138 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 138 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
139 storage::SpecialStoragePolicy* special_storage_policy, | 139 storage::SpecialStoragePolicy* special_storage_policy, |
140 scoped_ptr<domain_reliability::DomainReliabilityMonitor> | 140 scoped_ptr<domain_reliability::DomainReliabilityMonitor> |
141 domain_reliability_monitor, | 141 domain_reliability_monitor, |
142 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, | 142 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, |
143 scoped_ptr<DataReductionProxyChromeConfigurator> | 143 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> |
144 data_reduction_proxy_chrome_configurator, | 144 data_reduction_proxy_configurator, |
145 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 145 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
146 data_reduction_proxy_params, | 146 data_reduction_proxy_params, |
147 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 147 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
148 data_reduction_proxy_statistics_prefs, | 148 data_reduction_proxy_statistics_prefs, |
149 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> | 149 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> |
150 data_reduction_proxy_event_store) { | 150 data_reduction_proxy_event_store) { |
151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
152 DCHECK(!io_data_->lazy_params_); | 152 DCHECK(!io_data_->lazy_params_); |
153 DCHECK(predictor); | 153 DCHECK(predictor); |
154 | 154 |
(...skipping 20 matching lines...) Expand all Loading... |
175 | 175 |
176 io_data_->predictor_.reset(predictor); | 176 io_data_->predictor_.reset(predictor); |
177 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 177 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
178 | 178 |
179 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 179 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
180 if (io_data_->domain_reliability_monitor_) | 180 if (io_data_->domain_reliability_monitor_) |
181 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 181 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
182 | 182 |
183 io_data_->set_data_reduction_proxy_unavailable_callback( | 183 io_data_->set_data_reduction_proxy_unavailable_callback( |
184 data_reduction_proxy_unavailable); | 184 data_reduction_proxy_unavailable); |
185 io_data_->set_data_reduction_proxy_chrome_configurator( | 185 io_data_->set_data_reduction_proxy_configurator( |
186 data_reduction_proxy_chrome_configurator.Pass()); | 186 data_reduction_proxy_configurator.Pass()); |
187 io_data_->set_data_reduction_proxy_params(data_reduction_proxy_params.Pass()); | 187 io_data_->set_data_reduction_proxy_params(data_reduction_proxy_params.Pass()); |
188 io_data_->set_data_reduction_proxy_statistics_prefs( | 188 io_data_->set_data_reduction_proxy_statistics_prefs( |
189 data_reduction_proxy_statistics_prefs.Pass()); | 189 data_reduction_proxy_statistics_prefs.Pass()); |
190 io_data_->set_data_reduction_proxy_event_store( | 190 io_data_->set_data_reduction_proxy_event_store( |
191 data_reduction_proxy_event_store.Pass()); | 191 data_reduction_proxy_event_store.Pass()); |
192 } | 192 } |
193 | 193 |
194 content::ResourceContext* | 194 content::ResourceContext* |
195 ProfileImplIOData::Handle::GetResourceContext() const { | 195 ProfileImplIOData::Handle::GetResourceContext() const { |
196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 479 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
480 "436671 ProfileImplIOData::InitializeInternal3")); | 480 "436671 ProfileImplIOData::InitializeInternal3")); |
481 | 481 |
482 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> | 482 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> |
483 data_reduction_proxy_network_delegate( | 483 data_reduction_proxy_network_delegate( |
484 new data_reduction_proxy::DataReductionProxyNetworkDelegate( | 484 new data_reduction_proxy::DataReductionProxyNetworkDelegate( |
485 chrome_network_delegate.Pass(), | 485 chrome_network_delegate.Pass(), |
486 data_reduction_proxy_params(), | 486 data_reduction_proxy_params(), |
487 data_reduction_proxy_auth_request_handler(), | 487 data_reduction_proxy_auth_request_handler(), |
488 base::Bind( | 488 base::Bind( |
489 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIOThread, | 489 &data_reduction_proxy::DataReductionProxyConfigurator:: |
490 base::Unretained(data_reduction_proxy_chrome_configurator())))); | 490 GetProxyConfigOnIOThread, |
| 491 base::Unretained(data_reduction_proxy_configurator())))); |
491 data_reduction_proxy_network_delegate->InitProxyConfigOverrider( | 492 data_reduction_proxy_network_delegate->InitProxyConfigOverrider( |
492 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | 493 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); |
493 data_reduction_proxy_network_delegate->InitStatisticsPrefsAndUMA( | 494 data_reduction_proxy_network_delegate->InitStatisticsPrefsAndUMA( |
494 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 495 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
495 data_reduction_proxy_statistics_prefs(), | 496 data_reduction_proxy_statistics_prefs(), |
496 &data_reduction_proxy_enabled_, | 497 &data_reduction_proxy_enabled_, |
497 data_reduction_proxy_usage_stats()); | 498 data_reduction_proxy_usage_stats()); |
498 network_delegate_ = data_reduction_proxy_network_delegate.Pass(); | 499 network_delegate_ = data_reduction_proxy_network_delegate.Pass(); |
499 | 500 |
500 // Initialize context members. | 501 // Initialize context members. |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 transport_security_state()->DeleteAllDynamicDataSince(time); | 910 transport_security_state()->DeleteAllDynamicDataSince(time); |
910 DCHECK(http_server_properties_manager_); | 911 DCHECK(http_server_properties_manager_); |
911 http_server_properties_manager_->Clear(completion); | 912 http_server_properties_manager_->Clear(completion); |
912 } | 913 } |
913 | 914 |
914 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 915 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
915 return data_reduction_proxy_enabled_.GetValue() || | 916 return data_reduction_proxy_enabled_.GetValue() || |
916 base::CommandLine::ForCurrentProcess()->HasSwitch( | 917 base::CommandLine::ForCurrentProcess()->HasSwitch( |
917 data_reduction_proxy::switches::kEnableDataReductionProxy); | 918 data_reduction_proxy::switches::kEnableDataReductionProxy); |
918 } | 919 } |
OLD | NEW |