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

Side by Side Diff: chrome/browser/chrome_browser_field_trials.cc

Issue 12684010: Add simple cache backend experiment hidden behind a flag. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
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 "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const CommandLine& parsed_command_line) : 52 const CommandLine& parsed_command_line) :
53 parsed_command_line_(parsed_command_line) { 53 parsed_command_line_(parsed_command_line) {
54 } 54 }
55 55
56 ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() { 56 ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() {
57 } 57 }
58 58
59 void ChromeBrowserFieldTrials::SetupFieldTrials( 59 void ChromeBrowserFieldTrials::SetupFieldTrials(
60 const base::Time& install_time) { 60 const base::Time& install_time) {
61 chrome_variations::SetupUniformityFieldTrials(install_time); 61 chrome_variations::SetupUniformityFieldTrials(install_time);
62 SetUpSimpleCacheFieldTrial();
SteveT 2013/03/15 14:07:05 We might want to wrap this in a SetupAndroidFieldT
pasko-google - do not use 2013/03/15 15:36:28 That makes sense in general. Right now we want it
62 #if !defined(OS_ANDROID) 63 #if !defined(OS_ANDROID)
63 SetupDesktopFieldTrials(); 64 SetupDesktopFieldTrials();
64 #endif // defined(OS_ANDROID) 65 #endif // defined(OS_ANDROID)
65 } 66 }
66 67
67 void ChromeBrowserFieldTrials::SetupDesktopFieldTrials() { 68 void ChromeBrowserFieldTrials::SetupDesktopFieldTrials() {
68 prerender::ConfigurePrefetchAndPrerender(parsed_command_line_); 69 prerender::ConfigurePrefetchAndPrerender(parsed_command_line_);
69 SpdyFieldTrial(); 70 SpdyFieldTrial();
70 WarmConnectionFieldTrial(); 71 WarmConnectionFieldTrial();
71 AutoLaunchChromeFieldTrial(); 72 AutoLaunchChromeFieldTrial();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 #if defined(OS_CHROMEOS) 185 #if defined(OS_CHROMEOS)
185 avatar_menu_always_hidden = true; 186 avatar_menu_always_hidden = true;
186 #endif 187 #endif
187 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher"); 188 base::FieldTrial* trial = base::FieldTrialList::Find("ShowProfileSwitcher");
188 if (trial && (!ProfileManager::IsMultipleProfilesEnabled() || 189 if (trial && (!ProfileManager::IsMultipleProfilesEnabled() ||
189 avatar_menu_always_hidden)) { 190 avatar_menu_always_hidden)) {
190 trial->Disable(); 191 trial->Disable();
191 } 192 }
192 } 193 }
193 194
195 void ChromeBrowserFieldTrials::SetUpSimpleCacheFieldTrial() {
196 if (parsed_command_line_.HasSwitch(switches::kUseSimpleCacheBackend)) {
SteveT 2013/03/15 14:07:05 You want the user to turn on the switch in order t
pasko-google - do not use 2013/03/15 15:36:28 Yes. This will change when we tune the experiment
197 const base::FieldTrial::Probability kDivisor = 100;
198 base::FieldTrial::Probability simple_cache_probability = 100;
199 scoped_refptr<base::FieldTrial> trial(
200 base::FieldTrialList::FactoryGetFieldTrial("SimpleCacheTrial", kDivisor,
201 "No", 2013, 12, 31, NULL));
202 trial->UseOneTimeRandomization();
203 trial->AppendGroup("Yes", simple_cache_probability);
SteveT 2013/03/15 14:07:05 This sets up the trial so that everyone gets the "
pasko-google - do not use 2013/03/15 15:36:28 Yes, exactly. It is the way to enable a 100% exper
204 }
205 }
206
194 void ChromeBrowserFieldTrials::SetUpCacheSensitivityAnalysisFieldTrial() { 207 void ChromeBrowserFieldTrials::SetUpCacheSensitivityAnalysisFieldTrial() {
195 const base::FieldTrial::Probability kDivisor = 100; 208 const base::FieldTrial::Probability kDivisor = 100;
196 209
197 base::FieldTrial::Probability sensitivity_analysis_probability = 0; 210 base::FieldTrial::Probability sensitivity_analysis_probability = 0;
198 211
199 scoped_refptr<base::FieldTrial> trial( 212 scoped_refptr<base::FieldTrial> trial(
200 base::FieldTrialList::FactoryGetFieldTrial("CacheSensitivityAnalysis", 213 base::FieldTrialList::FactoryGetFieldTrial("CacheSensitivityAnalysis",
201 kDivisor, "No", 214 kDivisor, "No",
202 2012, 12, 31, NULL)); 215 2012, 12, 31, NULL));
203 trial->AppendGroup("ControlA", sensitivity_analysis_probability); 216 trial->AppendGroup("ControlA", sensitivity_analysis_probability);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Call |FindValue()| on the trials below, which may come from the server, to 250 // Call |FindValue()| on the trials below, which may come from the server, to
238 // ensure they get marked as "used" for the purposes of data reporting. 251 // ensure they get marked as "used" for the purposes of data reporting.
239 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial"); 252 base::FieldTrialList::FindValue("UMA-Dynamic-Binary-Uniformity-Trial");
240 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial"); 253 base::FieldTrialList::FindValue("UMA-Dynamic-Uniformity-Trial");
241 base::FieldTrialList::FindValue("InstantDummy"); 254 base::FieldTrialList::FindValue("InstantDummy");
242 base::FieldTrialList::FindValue("InstantChannel"); 255 base::FieldTrialList::FindValue("InstantChannel");
243 base::FieldTrialList::FindValue("Test0PercentDefault"); 256 base::FieldTrialList::FindValue("Test0PercentDefault");
244 // Activate the autocomplete dynamic field trials. 257 // Activate the autocomplete dynamic field trials.
245 OmniboxFieldTrial::ActivateDynamicTrials(); 258 OmniboxFieldTrial::ActivateDynamicTrials();
246 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698