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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 10 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
(...skipping 17 matching lines...) Expand all
28 28
29 void DataReductionProxyChromeSettings::InitDataReductionProxySettings( 29 void DataReductionProxyChromeSettings::InitDataReductionProxySettings(
30 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> 30 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
31 configurator, 31 configurator,
32 PrefService* profile_prefs, 32 PrefService* profile_prefs,
33 PrefService* local_state_prefs, 33 PrefService* local_state_prefs,
34 net::URLRequestContextGetter* request_context) { 34 net::URLRequestContextGetter* request_context) {
35 SetProxyConfigurator(configurator.Pass()); 35 SetProxyConfigurator(configurator.Pass());
36 DataReductionProxySettings::InitDataReductionProxySettings( 36 DataReductionProxySettings::InitDataReductionProxySettings(
37 profile_prefs, 37 profile_prefs,
38 local_state_prefs,
39 request_context); 38 request_context);
40 DataReductionProxySettings::SetOnDataReductionEnabledCallback( 39 DataReductionProxySettings::SetOnDataReductionEnabledCallback(
41 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial, 40 base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial,
42 base::Unretained(this))); 41 base::Unretained(this)));
43 SetDataReductionProxyAlternativeEnabled( 42 SetDataReductionProxyAlternativeEnabled(
44 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); 43 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
45 } 44 }
46 45
47 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial( 46 void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial(
48 bool data_reduction_proxy_enabled) { 47 bool data_reduction_proxy_enabled) {
49 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( 48 ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
50 "DataReductionProxyEnabled", 49 "DataReductionProxyEnabled",
51 data_reduction_proxy_enabled ? "true" : "false"); 50 data_reduction_proxy_enabled ? "true" : "false");
52 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698