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

Unified Diff: chrome/browser/browser_main.cc

Issue 150087: Create A/B test of SDCH... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « base/field_trial_unittest.cc ('k') | chrome/browser/net/dns_global.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « base/field_trial_unittest.cc ('k') | chrome/browser/net/dns_global.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698