Chromium Code Reviews| 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 |