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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: Created 6 years, 5 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/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
index abdbe4bd60e623134369db81ff2249744cc6cdaf..c40cff2817c704ab820de0d5718c80bb44eb1f45 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
@@ -11,6 +11,8 @@
#include "components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h"
+#include "components/metrics/metrics_service.h"
+#include "components/variations/metrics_util.h"
using data_reduction_proxy::DataReductionProxyParams;
using data_reduction_proxy::DataReductionProxySettings;
@@ -33,8 +35,20 @@ void DataReductionProxyChromeSettings::InitDataReductionProxySettings(
DataReductionProxySettings::InitDataReductionProxySettings(
prefs,
g_browser_process->local_state(),
- ProfileManager::GetActiveUserProfile()->GetRequestContext());
+ ProfileManager::GetActiveUserProfile()->GetRequestContext(),
+ base::Bind(&DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial,
+ base::Unretained(this)));
SetDataReductionProxyAlternativeEnabled(
DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
}
+
+void DataReductionProxyChromeSettings::RegisterSyntheticFieldTrial(
+ bool data_reduction_proxy_enabled) {
+ if (g_browser_process->metrics_service()) {
+ SyntheticTrialGroup trial(
+ metrics::HashName("DataReductionProxyEnabled"),
+ metrics::HashName(data_reduction_proxy_enabled ? "true" : "false"));
+ g_browser_process->metrics_service()->RegisterSyntheticFieldTrial(trial);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698