| Index: chrome/browser/browser_main.cc
|
| ===================================================================
|
| --- chrome/browser/browser_main.cc (revision 19579)
|
| +++ chrome/browser/browser_main.cc (working copy)
|
| @@ -690,16 +690,35 @@
|
| 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());
|
| }
|
| - sdch_manager.EnableSdchSupport(switch_domain);
|
|
|
| + 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);
|
| + }
|
| +
|
| MetricsService* metrics = NULL;
|
| if (!parsed_command_line.HasSwitch(switches::kDisableMetrics)) {
|
| bool enabled = local_state->GetBoolean(prefs::kMetricsReportingEnabled);
|
|
|