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

Unified 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: removed CHECKs 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials.cc
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc
index 1c9a854e5c034f3c4c1a199cb271b27e3dab09aa..0a0c9a8c8fd5b9a6133edb0de004dbab1364f459 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -59,6 +59,7 @@ ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() {
void ChromeBrowserFieldTrials::SetupFieldTrials(
const base::Time& install_time) {
chrome_variations::SetupUniformityFieldTrials(install_time);
+ SetUpSimpleCacheFieldTrial();
#if !defined(OS_ANDROID)
SetupDesktopFieldTrials();
#endif // defined(OS_ANDROID)
@@ -191,6 +192,38 @@ void ChromeBrowserFieldTrials::DisableShowProfileSwitcherTrialIfNecessary() {
}
}
+// Sets up the experiment. The actual cache backend choice is made in the net/
+// internals by looking at the experiment state.
+void ChromeBrowserFieldTrials::SetUpSimpleCacheFieldTrial() {
+ if (parsed_command_line_.HasSwitch(switches::kUseSimpleCacheBackend)) {
+ const std::string opt_value = parsed_command_line_.GetSwitchValueASCII(
+ switches::kUseSimpleCacheBackend);
+ if (LowerCaseEqualsASCII(opt_value, "off")) {
+ // This is the default.
+ return;
+ }
+ const base::FieldTrial::Probability kDivisor = 100;
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial("SimpleCacheTrial", kDivisor,
+ "No", 2013, 12, 31, NULL));
+ trial->UseOneTimeRandomization();
+ if (LowerCaseEqualsASCII(opt_value, "on")) {
+ trial->AppendGroup("Yes", 100);
+ return;
+ }
+#if defined(OS_ANDROID)
+ if (LowerCaseEqualsASCII(opt_value, "experiment")) {
+ // TODO(pasko): Make this the default on Android when the simple cache
+ // adds a few more necessary features. Also adjust the probability.
+ const base::FieldTrial::Probability kSimpleCacheProbability = 1;
+ trial->AppendGroup("Yes", kSimpleCacheProbability);
+ trial->AppendGroup("Control", kSimpleCacheProbability);
+ trial->group();
+ }
+#endif
+ }
+}
+
void ChromeBrowserFieldTrials::SetUpCacheSensitivityAnalysisFieldTrial() {
const base::FieldTrial::Probability kDivisor = 100;
« no previous file with comments | « chrome/browser/chrome_browser_field_trials.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698