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

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: Wrap everything in guades. 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..f4934451ed5d2aa2b7c43554015bccd97cc21f28 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -66,10 +66,53 @@ void ChromeBrowserFieldTrials::SetupFieldTrials(PrefService* local_state) {
DCHECK(!install_time.is_null());
chrome_variations::SetupUniformityFieldTrials(install_time);
SetUpSimpleCacheFieldTrial();
-#if !defined(OS_ANDROID)
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
SetupDesktopFieldTrials(local_state);
#endif // defined(OS_ANDROID)
+
+#if defined(OS_ANDROID) || defined(OS_IOS)
+ SetupMobileFieldTrials();
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
+}
+
+
+#if defined(OS_ANDROID) || defined(OS_IOS)
+void ChromeBrowserFieldTrials::SetupMobileFieldTrials() {
+ DataCompressionProxyFieldTrial();
+}
+
+// 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;
+ 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;
}
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
void ChromeBrowserFieldTrials::SetupDesktopFieldTrials(
PrefService* local_state) {
« 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