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

Unified Diff: chrome/browser/chrome_browser_field_trials_mobile.cc

Issue 151183006: Set up field trial for precache experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | components/precache/content/precache_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials_mobile.cc
diff --git a/chrome/browser/chrome_browser_field_trials_mobile.cc b/chrome/browser/chrome_browser_field_trials_mobile.cc
index 500d560fb2d6a307576115bc0852a8c1dc3219f8..8d522f84491841388cac3262e3911a80fea3c120 100644
--- a/chrome/browser/chrome_browser_field_trials_mobile.cc
+++ b/chrome/browser/chrome_browser_field_trials_mobile.cc
@@ -14,6 +14,9 @@
namespace chrome {
+const char kEnabled[] = "Enabled";
+const char kDisabled[] = "Disabled";
+
namespace {
// Base function used by all data reduction proxy field trials. A trial is
@@ -25,8 +28,6 @@ void DataCompressionProxyBaseFieldTrial(
const char* trial_name,
const base::FieldTrial::Probability enabled_group_probability,
const base::FieldTrial::Probability total_probability) {
- const char kEnabled[] = "Enabled";
- const char kDisabled[] = "Disabled";
// Find out if this is a stable channel.
const bool kIsStableChannel =
@@ -66,12 +67,29 @@ void DataCompressionProxyFieldTrials() {
"DataCompressionProxyPromoVisibility", 100, 1000);
}
+// Configures the "Precache" field trial. A trial is only conducted for installs
+// that are in the "Enabled" group. Until the percentage is learned from the
+// server, a client-side configuration is used.
+void PrecacheFieldTrial() {
Alexei Svitkine (slow) 2014/02/12 15:41:50 I'm not sure this block of code actually buys you
+ // Experiment enabled until December 31, 2015. By default, disabled.
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial(
+ "Precache", 1000, kDisabled, 2015, 12, 31,
+ base::FieldTrial::ONE_TIME_RANDOMIZED, NULL));
+
+ const int kEnabledGroup = trial->AppendGroup(kEnabled, 0);
+
+ VLOG(1) << "Precache enabled group id: " << kEnabledGroup
+ << ". Selected group id: " << trial->group();
+}
+
} // namespace
void SetupMobileFieldTrials(const CommandLine& parsed_command_line,
const base::Time& install_time,
PrefService* local_state) {
DataCompressionProxyFieldTrials();
+ PrecacheFieldTrial();
}
} // namespace chrome
« no previous file with comments | « no previous file | components/precache/content/precache_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698