Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chrome_browser_field_trials.h" | 5 #include "chrome/browser/chrome_browser_field_trials.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "apps/field_trial_names.h" | 9 #include "apps/field_trial_names.h" |
| 10 #include "apps/pref_names.h" | 10 #include "apps/pref_names.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 trial->Disable(); | 197 trial->Disable(); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 // Sets up the experiment. The actual cache backend choice is made in the net/ | 201 // Sets up the experiment. The actual cache backend choice is made in the net/ |
| 202 // internals by looking at the experiment state. | 202 // internals by looking at the experiment state. |
| 203 void ChromeBrowserFieldTrials::SetUpSimpleCacheFieldTrial() { | 203 void ChromeBrowserFieldTrials::SetUpSimpleCacheFieldTrial() { |
| 204 if (parsed_command_line_.HasSwitch(switches::kUseSimpleCacheBackend)) { | 204 if (parsed_command_line_.HasSwitch(switches::kUseSimpleCacheBackend)) { |
| 205 const std::string opt_value = parsed_command_line_.GetSwitchValueASCII( | 205 const std::string opt_value = parsed_command_line_.GetSwitchValueASCII( |
| 206 switches::kUseSimpleCacheBackend); | 206 switches::kUseSimpleCacheBackend); |
| 207 if (LowerCaseEqualsASCII(opt_value, "off")) { | |
| 208 // This is the default. | |
| 209 return; | |
| 210 } | |
| 211 const base::FieldTrial::Probability kDivisor = 100; | 207 const base::FieldTrial::Probability kDivisor = 100; |
| 212 scoped_refptr<base::FieldTrial> trial( | 208 scoped_refptr<base::FieldTrial> trial( |
| 213 base::FieldTrialList::FactoryGetFieldTrial("SimpleCacheTrial", kDivisor, | 209 base::FieldTrialList::FactoryGetFieldTrial("SimpleCacheTrial", kDivisor, |
| 214 "No", 2013, 12, 31, NULL)); | 210 "ExperimentNo", 2013, 12, 31, |
| 211 NULL)); | |
| 215 trial->UseOneTimeRandomization(); | 212 trial->UseOneTimeRandomization(); |
| 213 if (LowerCaseEqualsASCII(opt_value, "off")) { | |
| 214 trial->AppendGroup("ExplicitNo", 100); | |
|
Alexei Svitkine (slow)
2013/04/17 16:50:25
Use kDivisor?
| |
| 215 return; | |
| 216 } | |
| 216 if (LowerCaseEqualsASCII(opt_value, "on")) { | 217 if (LowerCaseEqualsASCII(opt_value, "on")) { |
| 217 trial->AppendGroup("Yes", 100); | 218 trial->AppendGroup("ExplicitYes", 100); |
|
Alexei Svitkine (slow)
2013/04/17 16:50:25
Use kDivisor?
| |
| 218 return; | 219 return; |
| 219 } | 220 } |
| 220 #if defined(OS_ANDROID) | 221 #if defined(OS_ANDROID) |
| 221 if (LowerCaseEqualsASCII(opt_value, "experiment")) { | 222 if (LowerCaseEqualsASCII(opt_value, "experiment")) { |
| 222 // TODO(pasko): Make this the default on Android when the simple cache | 223 // TODO(pasko): Make this the default on Android when the simple cache |
| 223 // adds a few more necessary features. Also adjust the probability. | 224 // adds a few more necessary features. Also adjust the probability. |
| 224 const base::FieldTrial::Probability kSimpleCacheProbability = 1; | 225 const base::FieldTrial::Probability kSimpleCacheProbability = 1; |
| 225 trial->AppendGroup("Yes", kSimpleCacheProbability); | 226 trial->AppendGroup("ExperimentYes", kSimpleCacheProbability); |
| 226 trial->AppendGroup("Control", kSimpleCacheProbability); | 227 trial->AppendGroup("ExperimentControl", kSimpleCacheProbability); |
| 227 trial->group(); | 228 trial->group(); |
| 228 } | 229 } |
| 229 #endif | 230 #endif |
| 230 } | 231 } |
| 231 } | 232 } |
| 232 | 233 |
| 233 void ChromeBrowserFieldTrials::SetUpCacheSensitivityAnalysisFieldTrial() { | 234 void ChromeBrowserFieldTrials::SetUpCacheSensitivityAnalysisFieldTrial() { |
| 234 const base::FieldTrial::Probability kDivisor = 100; | 235 const base::FieldTrial::Probability kDivisor = 100; |
| 235 | 236 |
| 236 base::FieldTrial::Probability sensitivity_analysis_probability = 0; | 237 base::FieldTrial::Probability sensitivity_analysis_probability = 0; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 // Call |FindValue()| on the trials below, which may come from the server, to | 277 // Call |FindValue()| on the trials below, which may come from the server, to |
| 277 // ensure they get marked as "used" for the purposes of data reporting. | 278 // ensure they get marked as "used" for the purposes of data reporting. |
| 278 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial"); | 279 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial"); |
| 279 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial"); | 280 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial"); |
| 280 base::FieldTrialList::FindValue("InstantDummy"); | 281 base::FieldTrialList::FindValue("InstantDummy"); |
| 281 base::FieldTrialList::FindValue("InstantChannel"); | 282 base::FieldTrialList::FindValue("InstantChannel"); |
| 282 base::FieldTrialList::FindValue("Test0PercentDefault"); | 283 base::FieldTrialList::FindValue("Test0PercentDefault"); |
| 283 // Activate the autocomplete dynamic field trials. | 284 // Activate the autocomplete dynamic field trials. |
| 284 OmniboxFieldTrial::ActivateDynamicTrials(); | 285 OmniboxFieldTrial::ActivateDynamicTrials(); |
| 285 } | 286 } |
| OLD | NEW |