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

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: Created 6 years, 4 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 14 matching lines...) Expand all
25 #include "chrome/browser/net/connect_interceptor.h" 25 #include "chrome/browser/net/connect_interceptor.h"
26 #include "chrome/browser/net/cookie_store_util.h" 26 #include "chrome/browser/net/cookie_store_util.h"
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/sqlite_channel_id_store.h" 29 #include "chrome/browser/net/sqlite_channel_id_store.h"
30 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/common/chrome_constants.h" 31 #include "chrome/common/chrome_constants.h"
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
34 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
35 #include "components/data_reduction_proxy/browser/data_reduction_proxy_delayed_p ref_service.h"
35 #include "components/domain_reliability/monitor.h" 36 #include "components/domain_reliability/monitor.h"
36 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/cookie_store_factory.h" 38 #include "content/public/browser/cookie_store_factory.h"
38 #include "content/public/browser/notification_service.h" 39 #include "content/public/browser/notification_service.h"
39 #include "content/public/browser/resource_context.h" 40 #include "content/public/browser/resource_context.h"
40 #include "content/public/browser/storage_partition.h" 41 #include "content/public/browser/storage_partition.h"
41 #include "extensions/browser/extension_protocols.h" 42 #include "extensions/browser/extension_protocols.h"
42 #include "extensions/common/constants.h" 43 #include "extensions/common/constants.h"
43 #include "net/base/cache_type.h" 44 #include "net/base/cache_type.h"
44 #include "net/base/sdch_dictionary_fetcher.h" 45 #include "net/base/sdch_dictionary_fetcher.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const base::FilePath& extensions_cookie_path, 147 const base::FilePath& extensions_cookie_path,
147 const base::FilePath& profile_path, 148 const base::FilePath& profile_path,
148 const base::FilePath& infinite_cache_path, 149 const base::FilePath& infinite_cache_path,
149 chrome_browser_net::Predictor* predictor, 150 chrome_browser_net::Predictor* predictor,
150 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, 151 content::CookieStoreConfig::SessionCookieMode session_cookie_mode,
151 quota::SpecialStoragePolicy* special_storage_policy, 152 quota::SpecialStoragePolicy* special_storage_policy,
152 scoped_ptr<domain_reliability::DomainReliabilityMonitor> 153 scoped_ptr<domain_reliability::DomainReliabilityMonitor>
153 domain_reliability_monitor, 154 domain_reliability_monitor,
154 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, 155 const base::Callback<void(bool)>& data_reduction_proxy_unavailable,
155 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> 156 scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
156 data_reduction_proxy_params) { 157 data_reduction_proxy_params,
158 scoped_ptr<data_reduction_proxy::DataReductionProxyDelayedPrefService>
159 data_reduction_proxy_delayed_pref_service) {
157 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
158 DCHECK(!io_data_->lazy_params_); 161 DCHECK(!io_data_->lazy_params_);
159 DCHECK(predictor); 162 DCHECK(predictor);
160 163
161 LazyParams* lazy_params = new LazyParams(); 164 LazyParams* lazy_params = new LazyParams();
162 165
163 lazy_params->cookie_path = cookie_path; 166 lazy_params->cookie_path = cookie_path;
164 lazy_params->channel_id_path = channel_id_path; 167 lazy_params->channel_id_path = channel_id_path;
165 lazy_params->cache_path = cache_path; 168 lazy_params->cache_path = cache_path;
166 lazy_params->cache_max_size = cache_max_size; 169 lazy_params->cache_max_size = cache_max_size;
(...skipping 15 matching lines...) Expand all
182 io_data_->predictor_.reset(predictor); 185 io_data_->predictor_.reset(predictor);
183 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); 186 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass();
184 187
185 io_data_->InitializeMetricsEnabledStateOnUIThread(); 188 io_data_->InitializeMetricsEnabledStateOnUIThread();
186 189
187 #if defined(SPDY_PROXY_AUTH_ORIGIN) 190 #if defined(SPDY_PROXY_AUTH_ORIGIN)
188 io_data_->data_reduction_proxy_unavailable_callback_ = 191 io_data_->data_reduction_proxy_unavailable_callback_ =
189 data_reduction_proxy_unavailable; 192 data_reduction_proxy_unavailable;
190 io_data_->data_reduction_proxy_params_ = 193 io_data_->data_reduction_proxy_params_ =
191 data_reduction_proxy_params.Pass(); 194 data_reduction_proxy_params.Pass();
195 io_data_->data_reduction_proxy_delayed_pref_service_ =
196 data_reduction_proxy_delayed_pref_service.Pass();
192 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 197 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
193 } 198 }
194 199
195 content::ResourceContext* 200 content::ResourceContext*
196 ProfileImplIOData::Handle::GetResourceContext() const { 201 ProfileImplIOData::Handle::GetResourceContext() const {
197 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
198 LazyInitialize(); 203 LazyInitialize();
199 return GetResourceContextNoInit(); 204 return GetResourceContextNoInit();
200 } 205 }
201 206
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 data_reduction_proxy_usage_stats_->set_unavailable_callback( 428 data_reduction_proxy_usage_stats_->set_unavailable_callback(
424 data_reduction_proxy_unavailable_callback_); 429 data_reduction_proxy_unavailable_callback_);
425 430
426 431
427 network_delegate()->set_data_reduction_proxy_params( 432 network_delegate()->set_data_reduction_proxy_params(
428 data_reduction_proxy_params_.get()); 433 data_reduction_proxy_params_.get());
429 network_delegate()->set_data_reduction_proxy_usage_stats( 434 network_delegate()->set_data_reduction_proxy_usage_stats(
430 data_reduction_proxy_usage_stats_.get()); 435 data_reduction_proxy_usage_stats_.get());
431 network_delegate()->set_data_reduction_proxy_auth_request_handler( 436 network_delegate()->set_data_reduction_proxy_auth_request_handler(
432 data_reduction_proxy_auth_request_handler_.get()); 437 data_reduction_proxy_auth_request_handler_.get());
438 network_delegate()->set_data_reduction_proxy_delayed_pref_service(
439 data_reduction_proxy_delayed_pref_service_.get());
433 network_delegate()->set_on_resolve_proxy_handler( 440 network_delegate()->set_on_resolve_proxy_handler(
434 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); 441 base::Bind(data_reduction_proxy::OnResolveProxyHandler));
435 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) 442 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
436 443
437 network_delegate()->set_predictor(predictor_.get()); 444 network_delegate()->set_predictor(predictor_.get());
438 445
439 // Initialize context members. 446 // Initialize context members.
440 447
441 ApplyProfileParamsToContext(main_context); 448 ApplyProfileParamsToContext(main_context);
442 449
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 const base::Closure& completion) { 821 const base::Closure& completion) {
815 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 822 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
816 DCHECK(initialized()); 823 DCHECK(initialized());
817 824
818 DCHECK(transport_security_state()); 825 DCHECK(transport_security_state());
819 // Completes synchronously. 826 // Completes synchronously.
820 transport_security_state()->DeleteAllDynamicDataSince(time); 827 transport_security_state()->DeleteAllDynamicDataSince(time);
821 DCHECK(http_server_properties_manager_); 828 DCHECK(http_server_properties_manager_);
822 http_server_properties_manager_->Clear(completion); 829 http_server_properties_manager_->Clear(completion);
823 } 830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698