summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 17:23:11 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 17:23:11 +0000
commit5156c3cf4c3162755d16b69c7842763a8f277c4c (patch)
tree6452bb40cde9727d451b6572358d48766d5a1153 /chrome
parent793b6b13899d674a47b86943ab4ba3b3ae82fe83 (diff)
downloadchromium_src-5156c3cf4c3162755d16b69c7842763a8f277c4c.zip
chromium_src-5156c3cf4c3162755d16b69c7842763a8f277c4c.tar.gz
chromium_src-5156c3cf4c3162755d16b69c7842763a8f277c4c.tar.bz2
Ensure that SDCH is initialized at all times.
There is an active A/B experiment to test the impact of SDCH support. This change correctly toggles support by simulating the command line flag, rather than incorrectly avoiding initialization of the module. BUG=16274 r=huanr Review URL: http://codereview.chromium.org/155277 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_main.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 403efc9..d7eeb53 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -676,26 +676,23 @@ int BrowserMain(const MainFunctionParams& parameters) {
scoped_refptr<FieldTrial> sdch_trial =
new FieldTrial("GlobalSdch", kSDCH_DIVISOR);
- bool need_to_init_sdch = true;
- std::string switch_domain("");
+ // Use default of "" so that all domains are supported.
+ std::string sdch_supported_domain("");
if (parsed_command_line.HasSwitch(switches::kSdchFilter)) {
- switch_domain =
+ sdch_supported_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());
+ if (sdch_enabled != sdch_trial->group())
+ sdch_supported_domain = "never_enabled_sdch_for_any_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);
- }
+ SdchManager sdch_manager; // Singleton database.
+ sdch_manager.set_sdch_fetcher(new SdchDictionaryFetcher);
+ sdch_manager.EnableSdchSupport(sdch_supported_domain);
MetricsService* metrics = NULL;
if (!parsed_command_line.HasSwitch(switches::kDisableMetrics)) {