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

Unified Diff: chrome/browser/chrome_browser_field_trials.cc

Issue 13255003: Add method to invoke mobile only field trials. Add a field trial that controls rollout of data comp… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix logging. Created 7 years, 9 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
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials.cc
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc
index ba85b4caf772cb6e337e662945c30ae3c15bb520..9cb0804b005927b7cb645dcc51dd1d32cbb2334d 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -69,6 +69,14 @@ void ChromeBrowserFieldTrials::SetupFieldTrials(PrefService* local_state) {
#if !defined(OS_ANDROID)
SetupDesktopFieldTrials(local_state);
#endif // defined(OS_ANDROID)
+
+#if defined(OS_ANDROID) || defined(OS_IOS)
+ SetupMobileFieldTrials();
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
+}
+
+void ChromeBrowserFieldTrials::SetupMobileFieldTrials() {
+ DataCompressionProxyFieldTrial();
}
void ChromeBrowserFieldTrials::SetupDesktopFieldTrials(
@@ -125,6 +133,38 @@ void ChromeBrowserFieldTrials::SpdyFieldTrial() {
trial->AppendGroup("cwndMin10", kSpdyCwndMin10);
}
+// Governs the rollout of the compression proxy for Chrome on mobile platforms.
+// Always enabled in DEV and BETA versions.
+// Stable percentage will be controlled from server.
+void ChromeBrowserFieldTrials::DataCompressionProxyFieldTrial() {
+ const char kDataCompressionProxyFieldTrialName[] =
+ "DataCompressionProxyRollout";
+ const base::FieldTrial::Probability kDataCompressionProxyDivisor = 1000;
+ const base::FieldTrial::Probability kDataCompressionProxyStable = 0;
SteveT 2013/03/29 17:40:55 So what's the plan? Stable is zero for now, and we
+ const char kEnabled[] = "Enabled";
+ const char kDisabled[] = "Disabled";
+
+ // Find out if this is a stable channel.
+ const bool kIsStableChannel =
+ chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_STABLE;
+
+ // Experiment enabled until Jan 1, 2015. By default, disabled.
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial(
+ kDataCompressionProxyFieldTrialName, kDataCompressionProxyDivisor,
+ kDisabled, 2015, 1, 1, NULL));
+
+ // Non-stable channels will run with probability 1.
+ const int kEnabledGroup = trial->AppendGroup(
+ kEnabled,
+ kIsStableChannel ?
+ kDataCompressionProxyStable : kDataCompressionProxyDivisor);
+
+ const int v = trial->group();
+ VLOG(1) << "DataCompression proxy enabled group id: " << kEnabledGroup
+ << ". Selected group id: " << v;
+}
+
// If --socket-reuse-policy is not specified, run an A/B test for choosing the
// warmest socket.
void ChromeBrowserFieldTrials::WarmConnectionFieldTrial() {
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698