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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 473723002: Update data reduction proxy statistics prefs less often on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tooManyWritesPatch
Patch Set: Addressed bengr nits Created 6 years, 3 months 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
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/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 16 matching lines...) Expand all
27 #include "chrome/browser/net/http_server_properties_manager_factory.h" 27 #include "chrome/browser/net/http_server_properties_manager_factory.h"
28 #include "chrome/browser/net/predictor.h" 28 #include "chrome/browser/net/predictor.h"
29 #include "chrome/browser/net/quota_policy_channel_id_store.h" 29 #include "chrome/browser/net/quota_policy_channel_id_store.h"
30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" 30 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
31 #include "chrome/browser/profiles/profile.h" 31 #include "chrome/browser/profiles/profile.h"
32 #include "chrome/common/chrome_constants.h" 32 #include "chrome/common/chrome_constants.h"
33 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/chrome_version_info.h" 34 #include "chrome/common/chrome_version_info.h"
35 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
36 #include "chrome/common/url_constants.h" 36 #include "chrome/common/url_constants.h"
37 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic s_prefs.h"
37 #include "components/domain_reliability/monitor.h" 38 #include "components/domain_reliability/monitor.h"
38 #include "content/public/browser/browser_thread.h" 39 #include "content/public/browser/browser_thread.h"
39 #include "content/public/browser/cookie_store_factory.h" 40 #include "content/public/browser/cookie_store_factory.h"
40 #include "content/public/browser/notification_service.h" 41 #include "content/public/browser/notification_service.h"
41 #include "content/public/browser/resource_context.h" 42 #include "content/public/browser/resource_context.h"
42 #include "content/public/browser/storage_partition.h" 43 #include "content/public/browser/storage_partition.h"
43 #include "extensions/browser/extension_protocols.h" 44 #include "extensions/browser/extension_protocols.h"
44 #include "extensions/common/constants.h" 45 #include "extensions/common/constants.h"
45 #include "net/base/cache_type.h" 46 #include "net/base/cache_type.h"
46 #include "net/base/sdch_dictionary_fetcher.h" 47 #include "net/base/sdch_dictionary_fetcher.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const base::FilePath& infinite_cache_path, 136 const base::FilePath& infinite_cache_path,
136 chrome_browser_net::Predictor* predictor, 137 chrome_browser_net::Predictor* predictor,
137 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, 138 content::CookieStoreConfig::SessionCookieMode session_cookie_mode,
138 storage::SpecialStoragePolicy* special_storage_policy, 139 storage::SpecialStoragePolicy* special_storage_policy,
139 scoped_ptr<domain_reliability::DomainReliabilityMonitor> 140 scoped_ptr<domain_reliability::DomainReliabilityMonitor>
140 domain_reliability_monitor, 141 domain_reliability_monitor,
141 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, 142 const base::Callback<void(bool)>& data_reduction_proxy_unavailable,
142 scoped_ptr<DataReductionProxyChromeConfigurator> 143 scoped_ptr<DataReductionProxyChromeConfigurator>
143 data_reduction_proxy_chrome_configurator, 144 data_reduction_proxy_chrome_configurator,
144 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> 145 scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
145 data_reduction_proxy_params) { 146 data_reduction_proxy_params,
147 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
148 data_reduction_proxy_statistics_prefs) {
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
147 DCHECK(!io_data_->lazy_params_); 150 DCHECK(!io_data_->lazy_params_);
148 DCHECK(predictor); 151 DCHECK(predictor);
149 152
150 LazyParams* lazy_params = new LazyParams(); 153 LazyParams* lazy_params = new LazyParams();
151 154
152 lazy_params->cookie_path = cookie_path; 155 lazy_params->cookie_path = cookie_path;
153 lazy_params->channel_id_path = channel_id_path; 156 lazy_params->channel_id_path = channel_id_path;
154 lazy_params->cache_path = cache_path; 157 lazy_params->cache_path = cache_path;
155 lazy_params->cache_max_size = cache_max_size; 158 lazy_params->cache_max_size = cache_max_size;
(...skipping 19 matching lines...) Expand all
175 if (io_data_->domain_reliability_monitor_) 178 if (io_data_->domain_reliability_monitor_)
176 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); 179 io_data_->domain_reliability_monitor_->MoveToNetworkThread();
177 180
178 #if defined(SPDY_PROXY_AUTH_ORIGIN) 181 #if defined(SPDY_PROXY_AUTH_ORIGIN)
179 io_data_->data_reduction_proxy_unavailable_callback_ = 182 io_data_->data_reduction_proxy_unavailable_callback_ =
180 data_reduction_proxy_unavailable; 183 data_reduction_proxy_unavailable;
181 io_data_->data_reduction_proxy_chrome_configurator_ = 184 io_data_->data_reduction_proxy_chrome_configurator_ =
182 data_reduction_proxy_chrome_configurator.Pass(); 185 data_reduction_proxy_chrome_configurator.Pass();
183 io_data_->data_reduction_proxy_params_ = 186 io_data_->data_reduction_proxy_params_ =
184 data_reduction_proxy_params.Pass(); 187 data_reduction_proxy_params.Pass();
188 io_data_->data_reduction_proxy_statistics_prefs_ =
189 data_reduction_proxy_statistics_prefs.Pass();
185 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 190 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
186 } 191 }
187 192
188 content::ResourceContext* 193 content::ResourceContext*
189 ProfileImplIOData::Handle::GetResourceContext() const { 194 ProfileImplIOData::Handle::GetResourceContext() const {
190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
191 LazyInitialize(); 196 LazyInitialize();
192 return GetResourceContextNoInit(); 197 return GetResourceContextNoInit();
193 } 198 }
194 199
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 data_reduction_proxy_usage_stats_->set_unavailable_callback( 449 data_reduction_proxy_usage_stats_->set_unavailable_callback(
445 data_reduction_proxy_unavailable_callback_); 450 data_reduction_proxy_unavailable_callback_);
446 451
447 452
448 network_delegate()->set_data_reduction_proxy_params( 453 network_delegate()->set_data_reduction_proxy_params(
449 data_reduction_proxy_params_.get()); 454 data_reduction_proxy_params_.get());
450 network_delegate()->set_data_reduction_proxy_usage_stats( 455 network_delegate()->set_data_reduction_proxy_usage_stats(
451 data_reduction_proxy_usage_stats_.get()); 456 data_reduction_proxy_usage_stats_.get());
452 network_delegate()->set_data_reduction_proxy_auth_request_handler( 457 network_delegate()->set_data_reduction_proxy_auth_request_handler(
453 data_reduction_proxy_auth_request_handler_.get()); 458 data_reduction_proxy_auth_request_handler_.get());
459 network_delegate()->set_data_reduction_proxy_statistics_prefs(
460 data_reduction_proxy_statistics_prefs_.get());
454 network_delegate()->set_on_resolve_proxy_handler( 461 network_delegate()->set_on_resolve_proxy_handler(
455 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); 462 base::Bind(data_reduction_proxy::OnResolveProxyHandler));
456 network_delegate()->set_proxy_config_getter( 463 network_delegate()->set_proxy_config_getter(
457 base::Bind( 464 base::Bind(
458 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO, 465 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO,
459 base::Unretained(data_reduction_proxy_chrome_configurator_.get()))); 466 base::Unretained(data_reduction_proxy_chrome_configurator_.get())));
460 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 467 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
461 468
462 network_delegate()->set_predictor(predictor_.get()); 469 network_delegate()->set_predictor(predictor_.get());
463 470
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 const base::Closure& completion) { 843 const base::Closure& completion) {
837 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 844 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
838 DCHECK(initialized()); 845 DCHECK(initialized());
839 846
840 DCHECK(transport_security_state()); 847 DCHECK(transport_security_state());
841 // Completes synchronously. 848 // Completes synchronously.
842 transport_security_state()->DeleteAllDynamicDataSince(time); 849 transport_security_state()->DeleteAllDynamicDataSince(time);
843 DCHECK(http_server_properties_manager_); 850 DCHECK(http_server_properties_manager_);
844 http_server_properties_manager_->Clear(completion); 851 http_server_properties_manager_->Clear(completion);
845 } 852 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698