summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 16:31:54 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 16:31:54 +0000
commite695fbd6d62e9967d6256cd0667eca2fb2bb918d (patch)
tree58e196031e02447b31bd9a4182b8fb3f4d7ea81b /chrome/browser/browser_main.cc
parent5c7c19d83d201fa23d5097cce108c033ece5c63b (diff)
downloadchromium_src-e695fbd6d62e9967d6256cd0667eca2fb2bb918d.zip
chromium_src-e695fbd6d62e9967d6256cd0667eca2fb2bb918d.tar.gz
chromium_src-e695fbd6d62e9967d6256cd0667eca2fb2bb918d.tar.bz2
Create A/B test of SDCH
To do this, I needed to add the feature that ALL FieldTrials that are established in the browser process are forwarded and established in the corresponding renderer processes. This then allows both DNS impact, as well as SDCH inmpact (and any other field tests) to be studied at the same time in a single binary. This checkin also establishes a pattern that when we're doing A/B tests via a histogram such as RequestToFinish, that we produce names for all groups, rather than leaving one group as the "default" or "empty postfix" group. This is critical for naming various sub-groups when a multitude of tests are taking place at the same time. BUG=15479 r=mbelshe Review URL: http://codereview.chromium.org/150087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 91bc5e4..5a52734 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -690,15 +690,34 @@ int BrowserMain(const MainFunctionParams& parameters) {
PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath());
// Prepare for memory caching of SDCH dictionaries.
- SdchManager sdch_manager; // Construct singleton database.
- sdch_manager.set_sdch_fetcher(new SdchDictionaryFetcher);
- // Use default of "" so that all domains are supported.
+ // Perform A/B test to measure global impact of SDCH support.
+ // Set up a field trial to see what disabling SDCH does to latency of page
+ // layout globally.
+ FieldTrial::Probability kSDCH_DIVISOR = 100;
+ FieldTrial::Probability kSDCH_PROBABILITY_PER_GROUP = 50; // 50% probability.
+ scoped_refptr<FieldTrial> sdch_trial =
+ new FieldTrial("GlobalSdch", kSDCH_DIVISOR);
+
+ bool need_to_init_sdch = true;
std::string switch_domain("");
if (parsed_command_line.HasSwitch(switches::kSdchFilter)) {
switch_domain =
WideToASCII(parsed_command_line.GetSwitchValue(switches::kSdchFilter));
+ } else {
+ sdch_trial->AppendGroup("_global_disable_sdch",
+ kSDCH_PROBABILITY_PER_GROUP);
+ int sdch_enabled = sdch_trial->AppendGroup("_global_enable_sdch",
+ kSDCH_PROBABILITY_PER_GROUP);
+ need_to_init_sdch = (sdch_enabled == sdch_trial->group());
+ }
+
+ scoped_ptr<SdchManager> sdch_manager; // Singleton database.
+ if (need_to_init_sdch) {
+ sdch_manager.reset(new SdchManager);
+ sdch_manager->set_sdch_fetcher(new SdchDictionaryFetcher);
+ // Use default of "" so that all domains are supported.
+ sdch_manager->EnableSdchSupport(switch_domain);
}
- sdch_manager.EnableSdchSupport(switch_domain);
MetricsService* metrics = NULL;
if (!parsed_command_line.HasSwitch(switches::kDisableMetrics)) {