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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/field_trial_unittest.cc ('k') | chrome/browser/net/dns_global.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 // when asked to initialize itself, but this doesn't seem to exist. 683 // when asked to initialize itself, but this doesn't seem to exist.
684 // 684 //
685 // This can't be created in the BrowserProcessImpl constructor because it 685 // This can't be created in the BrowserProcessImpl constructor because it
686 // needs to read prefs that get set after that runs. 686 // needs to read prefs that get set after that runs.
687 browser_process->google_url_tracker(); 687 browser_process->google_url_tracker();
688 688
689 // Have Chrome plugins write their data to the profile directory. 689 // Have Chrome plugins write their data to the profile directory.
690 PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath()); 690 PluginService::GetInstance()->SetChromePluginDataDir(profile->GetPath());
691 691
692 // Prepare for memory caching of SDCH dictionaries. 692 // Prepare for memory caching of SDCH dictionaries.
693 SdchManager sdch_manager; // Construct singleton database. 693 // Perform A/B test to measure global impact of SDCH support.
694 sdch_manager.set_sdch_fetcher(new SdchDictionaryFetcher); 694 // Set up a field trial to see what disabling SDCH does to latency of page
695 // Use default of "" so that all domains are supported. 695 // layout globally.
696 FieldTrial::Probability kSDCH_DIVISOR = 100;
697 FieldTrial::Probability kSDCH_PROBABILITY_PER_GROUP = 50; // 50% probability.
698 scoped_refptr<FieldTrial> sdch_trial =
699 new FieldTrial("GlobalSdch", kSDCH_DIVISOR);
700
701 bool need_to_init_sdch = true;
696 std::string switch_domain(""); 702 std::string switch_domain("");
697 if (parsed_command_line.HasSwitch(switches::kSdchFilter)) { 703 if (parsed_command_line.HasSwitch(switches::kSdchFilter)) {
698 switch_domain = 704 switch_domain =
699 WideToASCII(parsed_command_line.GetSwitchValue(switches::kSdchFilter)); 705 WideToASCII(parsed_command_line.GetSwitchValue(switches::kSdchFilter));
706 } else {
707 sdch_trial->AppendGroup("_global_disable_sdch",
708 kSDCH_PROBABILITY_PER_GROUP);
709 int sdch_enabled = sdch_trial->AppendGroup("_global_enable_sdch",
710 kSDCH_PROBABILITY_PER_GROUP);
711 need_to_init_sdch = (sdch_enabled == sdch_trial->group());
700 } 712 }
701 sdch_manager.EnableSdchSupport(switch_domain); 713
714 scoped_ptr<SdchManager> sdch_manager; // Singleton database.
715 if (need_to_init_sdch) {
716 sdch_manager.reset(new SdchManager);
717 sdch_manager->set_sdch_fetcher(new SdchDictionaryFetcher);
718 // Use default of "" so that all domains are supported.
719 sdch_manager->EnableSdchSupport(switch_domain);
720 }
702 721
703 MetricsService* metrics = NULL; 722 MetricsService* metrics = NULL;
704 if (!parsed_command_line.HasSwitch(switches::kDisableMetrics)) { 723 if (!parsed_command_line.HasSwitch(switches::kDisableMetrics)) {
705 bool enabled = local_state->GetBoolean(prefs::kMetricsReportingEnabled); 724 bool enabled = local_state->GetBoolean(prefs::kMetricsReportingEnabled);
706 bool record_only = 725 bool record_only =
707 parsed_command_line.HasSwitch(switches::kMetricsRecordingOnly); 726 parsed_command_line.HasSwitch(switches::kMetricsRecordingOnly);
708 727
709 #if !defined(GOOGLE_CHROME_BUILD) 728 #if !defined(GOOGLE_CHROME_BUILD)
710 // Disable user metrics completely for non-Google Chrome builds. 729 // Disable user metrics completely for non-Google Chrome builds.
711 enabled = false; 730 enabled = false;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 if (metrics) 792 if (metrics)
774 metrics->Stop(); 793 metrics->Stop();
775 794
776 // browser_shutdown takes care of deleting browser_process, so we need to 795 // browser_shutdown takes care of deleting browser_process, so we need to
777 // release it. 796 // release it.
778 browser_process.release(); 797 browser_process.release();
779 browser_shutdown::Shutdown(); 798 browser_shutdown::Shutdown();
780 799
781 return result_code; 800 return result_code;
782 } 801 }
OLDNEW
« 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