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 "No", 2013, 12, 31, NULL)); |
| 215 trial->UseOneTimeRandomization(); | 211 trial->UseOneTimeRandomization(); |
| 212 if (LowerCaseEqualsASCII(opt_value, "off")) { | |
|
SteveT
2013/04/17 15:41:02
Couple things here:
(1) Appending a new group wit
Alexei Svitkine (slow)
2013/04/17 15:46:52
Agree with Steve on all points.
Also, I'd like to
gavinp
2013/04/17 16:19:42
There's two considerations that cause me to want e
gavinp
2013/04/17 16:19:42
Alexei,
Oh no! Right now FindFullName() is exactl
| |
| 213 trial->AppendGroup("No", 100); | |
| 214 return; | |
| 215 } | |
| 216 if (LowerCaseEqualsASCII(opt_value, "on")) { | 216 if (LowerCaseEqualsASCII(opt_value, "on")) { |
| 217 trial->AppendGroup("Yes", 100); | 217 trial->AppendGroup("Yes", 100); |
| 218 return; | 218 return; |
| 219 } | 219 } |
| 220 #if defined(OS_ANDROID) | 220 #if defined(OS_ANDROID) |
| 221 if (LowerCaseEqualsASCII(opt_value, "experiment")) { | 221 if (LowerCaseEqualsASCII(opt_value, "experiment")) { |
| 222 // TODO(pasko): Make this the default on Android when the simple cache | 222 // TODO(pasko): Make this the default on Android when the simple cache |
| 223 // adds a few more necessary features. Also adjust the probability. | 223 // adds a few more necessary features. Also adjust the probability. |
| 224 const base::FieldTrial::Probability kSimpleCacheProbability = 1; | 224 const base::FieldTrial::Probability kSimpleCacheProbability = 1; |
| 225 trial->AppendGroup("Yes", kSimpleCacheProbability); | 225 trial->AppendGroup("Yes", kSimpleCacheProbability); |
| (...skipping 50 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 | 276 // 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. | 277 // ensure they get marked as "used" for the purposes of data reporting. |
| 278 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial"); | 278 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial"); |
| 279 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial"); | 279 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial"); |
| 280 base::FieldTrialList::FindValue("InstantDummy"); | 280 base::FieldTrialList::FindValue("InstantDummy"); |
| 281 base::FieldTrialList::FindValue("InstantChannel"); | 281 base::FieldTrialList::FindValue("InstantChannel"); |
| 282 base::FieldTrialList::FindValue("Test0PercentDefault"); | 282 base::FieldTrialList::FindValue("Test0PercentDefault"); |
| 283 // Activate the autocomplete dynamic field trials. | 283 // Activate the autocomplete dynamic field trials. |
| 284 OmniboxFieldTrial::ActivateDynamicTrials(); | 284 OmniboxFieldTrial::ActivateDynamicTrials(); |
| 285 } | 285 } |
| OLD | NEW |