diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 21:18:13 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 21:18:13 +0000 |
commit | 68adccabaf250a5f813fe531af6aeaa1c332c3eb (patch) | |
tree | 01ddf4aeffa617754780347a79a05007fecec7e6 | |
parent | ba18686c2bbb0707fede09e2c1e3b33caafebdb1 (diff) | |
download | chromium_src-68adccabaf250a5f813fe531af6aeaa1c332c3eb.zip chromium_src-68adccabaf250a5f813fe531af6aeaa1c332c3eb.tar.gz chromium_src-68adccabaf250a5f813fe531af6aeaa1c332c3eb.tar.bz2 |
Added a function to BrowserMainParts that sets up field trials. It is called after about_flags has converted the flags to command-line switches. This fixes the case where a field trial would opt a user out of a feature even when they'd explicitly enabled it in their flags.
Contributed by: dominich@chromium.org
BUG=none
TEST=Enable page-prerender through about:flags and restart. You should skip the random part of the Field Test.
Review URL: http://codereview.chromium.org/6354023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72689 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_main.cc | 26 | ||||
-rw-r--r-- | chrome/browser/browser_main.h | 2 |
2 files changed, 18 insertions, 10 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index cb05347..df290e3 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -195,14 +195,6 @@ void BrowserMainParts::EarlyInitialization() { if (parsed_command_line().HasSwitch(switches::kEnableBenchmarking)) base::FieldTrial::EnableBenchmarking(); - // Note: make sure to call ConnectionFieldTrial() before - // ProxyConnectionsFieldTrial(). - ConnectionFieldTrial(); - SocketTimeoutFieldTrial(); - ProxyConnectionsFieldTrial(); - SpdyFieldTrial(); - PrefetchFieldTrial(); - ConnectBackupJobsFieldTrial(); InitializeSSL(); if (parsed_command_line().HasSwitch(switches::kEnableDNSSECCerts)) @@ -225,6 +217,18 @@ void BrowserMainParts::EarlyInitialization() { PostEarlyInitialization(); } +// This will be called after the command-line has been mutated by about:flags +void BrowserMainParts::SetupFieldTrials() { + // Note: make sure to call ConnectionFieldTrial() before + // ProxyConnectionsFieldTrial(). + ConnectionFieldTrial(); + SocketTimeoutFieldTrial(); + ProxyConnectionsFieldTrial(); + PrefetchFieldTrial(); + SpdyFieldTrial(); + ConnectBackupJobsFieldTrial(); +} + // This is an A/B test for the maximum number of persistent connections per // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to @@ -1251,6 +1255,10 @@ int BrowserMain(const MainFunctionParams& parameters) { about_flags::ConvertFlagsToSwitches(local_state, CommandLine::ForCurrentProcess()); + // Now the command line has been mutated based on about:flags, we can run some + // field trials + parts->SetupFieldTrials(); + // Now that all preferences have been registered, set the install date // for the uninstall metrics if this is our first run. This only actually // gets used if the user has metrics reporting enabled at uninstall time. @@ -1398,8 +1406,6 @@ int BrowserMain(const MainFunctionParams& parameters) { } #endif - // Modifies the current command line based on active experiments on - // about:flags. Profile* profile = CreateProfile(parameters, user_data_dir); if (!profile) return ResultCodes::NORMAL_EXIT; diff --git a/chrome/browser/browser_main.h b/chrome/browser/browser_main.h index 7fd7142..a8f5442 100644 --- a/chrome/browser/browser_main.h +++ b/chrome/browser/browser_main.h @@ -80,6 +80,8 @@ class BrowserMainParts { void EarlyInitialization(); void MainMessageLoopStart(); + void SetupFieldTrials(); + protected: explicit BrowserMainParts(const MainFunctionParams& parameters); |