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

Unified 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: Fixing net internals bandwidth page 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 8e36a5ab69edefff5722bdf1899b1ec1bfa24e8f..eb1e734e83f33098988d371dcbf3e335d33709cd 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -34,6 +34,7 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_statistics_prefs.h"
#include "components/domain_reliability/monitor.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cookie_store_factory.h"
@@ -102,6 +103,10 @@ ProfileImplIOData::Handle::Handle(Profile* profile)
ProfileImplIOData::Handle::~Handle() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+#if defined(SPDY_PROXY_AUTH_ORIGIN)
+ io_data_->data_reduction_proxy_statistics_prefs_->WritePrefs();
mmenke 2014/09/15 15:11:01 This is called on the UI thread, but the prefs liv
megjablon 2014/09/15 18:19:23 The prefs live on the UI thread. That's true about
+#endif
+
if (io_data_->predictor_ != NULL) {
// io_data_->predictor_ might be NULL if Init() was never called
// (i.e. we shut down before ProfileImpl::DoFinalInit() got called).
@@ -142,7 +147,9 @@ void ProfileImplIOData::Handle::Init(
scoped_ptr<DataReductionProxyChromeConfigurator>
data_reduction_proxy_chrome_configurator,
scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
- data_reduction_proxy_params) {
+ data_reduction_proxy_params,
+ scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>
+ data_reduction_proxy_statistics_prefs) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!io_data_->lazy_params_);
DCHECK(predictor);
@@ -182,6 +189,8 @@ void ProfileImplIOData::Handle::Init(
data_reduction_proxy_chrome_configurator.Pass();
io_data_->data_reduction_proxy_params_ =
data_reduction_proxy_params.Pass();
+ io_data_->data_reduction_proxy_statistics_prefs_ =
+ data_reduction_proxy_statistics_prefs.Pass();
#endif // defined(SPDY_PROXY_AUTH_ORIGIN)
}
@@ -452,6 +461,8 @@ void ProfileImplIOData::InitializeInternal(
data_reduction_proxy_usage_stats_.get());
network_delegate()->set_data_reduction_proxy_auth_request_handler(
data_reduction_proxy_auth_request_handler_.get());
+ network_delegate()->set_data_reduction_proxy_statistics_prefs(
+ data_reduction_proxy_statistics_prefs_.get());
network_delegate()->set_on_resolve_proxy_handler(
base::Bind(data_reduction_proxy::OnResolveProxyHandler));
network_delegate()->set_proxy_config_getter(

Powered by Google App Engine
This is Rietveld 408576698