Commit 68adccab authored by cbentzel@chromium.org's avatar cbentzel@chromium.org

Added a function to BrowserMainParts that sets up field trials. It is called...

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
parent ba18686c
...@@ -195,14 +195,6 @@ void BrowserMainParts::EarlyInitialization() { ...@@ -195,14 +195,6 @@ void BrowserMainParts::EarlyInitialization() {
if (parsed_command_line().HasSwitch(switches::kEnableBenchmarking)) if (parsed_command_line().HasSwitch(switches::kEnableBenchmarking))
base::FieldTrial::EnableBenchmarking(); base::FieldTrial::EnableBenchmarking();
// Note: make sure to call ConnectionFieldTrial() before
// ProxyConnectionsFieldTrial().
ConnectionFieldTrial();
SocketTimeoutFieldTrial();
ProxyConnectionsFieldTrial();
SpdyFieldTrial();
PrefetchFieldTrial();
ConnectBackupJobsFieldTrial();
InitializeSSL(); InitializeSSL();
if (parsed_command_line().HasSwitch(switches::kEnableDNSSECCerts)) if (parsed_command_line().HasSwitch(switches::kEnableDNSSECCerts))
...@@ -225,6 +217,18 @@ void BrowserMainParts::EarlyInitialization() { ...@@ -225,6 +217,18 @@ void BrowserMainParts::EarlyInitialization() {
PostEarlyInitialization(); 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 // 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 // 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 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to
...@@ -1251,6 +1255,10 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1251,6 +1255,10 @@ int BrowserMain(const MainFunctionParams& parameters) {
about_flags::ConvertFlagsToSwitches(local_state, about_flags::ConvertFlagsToSwitches(local_state,
CommandLine::ForCurrentProcess()); 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 // Now that all preferences have been registered, set the install date
// for the uninstall metrics if this is our first run. This only actually // 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. // gets used if the user has metrics reporting enabled at uninstall time.
...@@ -1398,8 +1406,6 @@ int BrowserMain(const MainFunctionParams& parameters) { ...@@ -1398,8 +1406,6 @@ int BrowserMain(const MainFunctionParams& parameters) {
} }
#endif #endif
// Modifies the current command line based on active experiments on
// about:flags.
Profile* profile = CreateProfile(parameters, user_data_dir); Profile* profile = CreateProfile(parameters, user_data_dir);
if (!profile) if (!profile)
return ResultCodes::NORMAL_EXIT; return ResultCodes::NORMAL_EXIT;
......
...@@ -80,6 +80,8 @@ class BrowserMainParts { ...@@ -80,6 +80,8 @@ class BrowserMainParts {
void EarlyInitialization(); void EarlyInitialization();
void MainMessageLoopStart(); void MainMessageLoopStart();
void SetupFieldTrials();
protected: protected:
explicit BrowserMainParts(const MainFunctionParams& parameters); explicit BrowserMainParts(const MainFunctionParams& parameters);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment