OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 #include "chrome/browser/gpu_util.h" | 49 #include "chrome/browser/gpu_util.h" |
50 #include "chrome/browser/instant/instant_field_trial.h" | 50 #include "chrome/browser/instant/instant_field_trial.h" |
51 #include "chrome/browser/jankometer.h" | 51 #include "chrome/browser/jankometer.h" |
52 #include "chrome/browser/language_usage_metrics.h" | 52 #include "chrome/browser/language_usage_metrics.h" |
53 #include "chrome/browser/metrics/histogram_synchronizer.h" | 53 #include "chrome/browser/metrics/histogram_synchronizer.h" |
54 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 54 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
55 #include "chrome/browser/metrics/metrics_log.h" | 55 #include "chrome/browser/metrics/metrics_log.h" |
56 #include "chrome/browser/metrics/metrics_service.h" | 56 #include "chrome/browser/metrics/metrics_service.h" |
57 #include "chrome/browser/metrics/thread_watcher.h" | 57 #include "chrome/browser/metrics/thread_watcher.h" |
58 #include "chrome/browser/metrics/tracking_synchronizer.h" | 58 #include "chrome/browser/metrics/tracking_synchronizer.h" |
59 #include "chrome/browser/metrics/variations_service.h" | |
59 #include "chrome/browser/nacl_host/nacl_process_host.h" | 60 #include "chrome/browser/nacl_host/nacl_process_host.h" |
60 #include "chrome/browser/net/chrome_net_log.h" | 61 #include "chrome/browser/net/chrome_net_log.h" |
61 #include "chrome/browser/net/predictor.h" | 62 #include "chrome/browser/net/predictor.h" |
62 #include "chrome/browser/notifications/desktop_notification_service.h" | 63 #include "chrome/browser/notifications/desktop_notification_service.h" |
63 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 64 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
64 #include "chrome/browser/plugin_prefs.h" | 65 #include "chrome/browser/plugin_prefs.h" |
65 #include "chrome/browser/prefs/pref_service.h" | 66 #include "chrome/browser/prefs/pref_service.h" |
66 #include "chrome/browser/prefs/pref_value_store.h" | 67 #include "chrome/browser/prefs/pref_value_store.h" |
67 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 68 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
68 #include "chrome/browser/prerender/prerender_field_trial.h" | 69 #include "chrome/browser/prerender/prerender_field_trial.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
554 startup_watcher_(new StartupTimeBomb()), | 555 startup_watcher_(new StartupTimeBomb()), |
555 shutdown_watcher_(new ShutdownWatcherHelper()), | 556 shutdown_watcher_(new ShutdownWatcherHelper()), |
556 record_search_engine_(false), | 557 record_search_engine_(false), |
557 translate_manager_(NULL), | 558 translate_manager_(NULL), |
558 profile_(NULL), | 559 profile_(NULL), |
559 run_message_loop_(true), | 560 run_message_loop_(true), |
560 notify_result_(ProcessSingleton::PROCESS_NONE), | 561 notify_result_(ProcessSingleton::PROCESS_NONE), |
561 is_first_run_(false), | 562 is_first_run_(false), |
562 first_run_ui_bypass_(false), | 563 first_run_ui_bypass_(false), |
563 local_state_(NULL), | 564 local_state_(NULL), |
564 restart_last_session_(false) { | 565 restart_last_session_(false), |
566 variations_service_(NULL) { | |
Alexei Svitkine (slow)
2012/05/04 03:09:53
I don't think this line is needed at all - I belie
jwd
2012/05/04 19:33:06
Done.
| |
565 // If we're running tests (ui_task is non-null). | 567 // If we're running tests (ui_task is non-null). |
566 if (parameters.ui_task) | 568 if (parameters.ui_task) |
567 browser_defaults::enable_help_app = false; | 569 browser_defaults::enable_help_app = false; |
568 | 570 |
569 // Chrome disallows cookies by default. All code paths that want to use | 571 // Chrome disallows cookies by default. All code paths that want to use |
570 // cookies need to go through one of Chrome's URLRequestContexts which have | 572 // cookies need to go through one of Chrome's URLRequestContexts which have |
571 // a ChromeNetworkDelegate attached that selectively allows cookies again. | 573 // a ChromeNetworkDelegate attached that selectively allows cookies again. |
572 if (!disable_enforcing_cookie_policies_for_tests_) | 574 if (!disable_enforcing_cookie_policies_for_tests_) |
573 net::URLRequest::SetDefaultCookiePolicyToBlock(); | 575 net::URLRequest::SetDefaultCookiePolicyToBlock(); |
574 } | 576 } |
(...skipping 30 matching lines...) Expand all Loading... | |
605 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 607 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
606 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 608 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
607 std::string persistent = command_line->GetSwitchValueASCII( | 609 std::string persistent = command_line->GetSwitchValueASCII( |
608 switches::kForceFieldTrials); | 610 switches::kForceFieldTrials); |
609 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); | 611 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); |
610 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << | 612 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << |
611 " list specified."; | 613 " list specified."; |
612 } | 614 } |
613 #endif // NDEBUG | 615 #endif // NDEBUG |
614 | 616 |
617 variations_service_.reset(new VariationsService()); | |
618 variations_service_->LoadVariationsSeed(browser_process_->local_state()); | |
619 | |
615 SetupFieldTrials(metrics->recording_active(), | 620 SetupFieldTrials(metrics->recording_active(), |
616 local_state_->IsManagedPreference( | 621 local_state_->IsManagedPreference( |
617 prefs::kMaxConnectionsPerProxy)); | 622 prefs::kMaxConnectionsPerProxy)); |
618 | 623 |
619 // Initialize FieldTrialSynchronizer system. This is a singleton and is used | 624 // Initialize FieldTrialSynchronizer system. This is a singleton and is used |
620 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 625 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
621 // Even though base::Bind does AddRef and Release, the object will not be | 626 // Even though base::Bind does AddRef and Release, the object will not be |
622 // deleted after the Task is executed. | 627 // deleted after the Task is executed. |
623 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 628 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
624 } | 629 } |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1867 // http://crosbug.com/17687 | 1872 // http://crosbug.com/17687 |
1868 #if !defined(OS_CHROMEOS) | 1873 #if !defined(OS_CHROMEOS) |
1869 // If we're running tests (ui_task is non-null), then we don't want to | 1874 // If we're running tests (ui_task is non-null), then we don't want to |
1870 // call FetchLanguageListFromTranslateServer | 1875 // call FetchLanguageListFromTranslateServer |
1871 if (parameters().ui_task == NULL && translate_manager_ != NULL) { | 1876 if (parameters().ui_task == NULL && translate_manager_ != NULL) { |
1872 translate_manager_->FetchLanguageListFromTranslateServer( | 1877 translate_manager_->FetchLanguageListFromTranslateServer( |
1873 profile_->GetPrefs()); | 1878 profile_->GetPrefs()); |
1874 } | 1879 } |
1875 #endif | 1880 #endif |
1876 | 1881 |
1882 // Request new variations seed information from server. | |
MAD
2012/05/04 12:29:57
If we keep this here, we need to keep it within th
MAD
2012/05/04 20:53:12
Ping?
jwd
2012/05/04 22:11:23
Done.
| |
1883 variations_service_->StartFetchingVariationsSeed(); | |
1884 | |
1877 run_message_loop_ = true; | 1885 run_message_loop_ = true; |
1878 } else { | 1886 } else { |
1879 run_message_loop_ = false; | 1887 run_message_loop_ = false; |
1880 } | 1888 } |
1881 } | 1889 } |
1882 browser_init_.reset(); | 1890 browser_init_.reset(); |
1883 | 1891 |
1884 PostBrowserStart(); | 1892 PostBrowserStart(); |
1885 | 1893 |
1886 return result_code_; | 1894 return result_code_; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2008 if (base::win::GetVersion() <= base::win::VERSION_XP) | 2016 if (base::win::GetVersion() <= base::win::VERSION_XP) |
2009 uma_name += "_XP"; | 2017 uma_name += "_XP"; |
2010 | 2018 |
2011 uma_name += "_PreRead_"; | 2019 uma_name += "_PreRead_"; |
2012 uma_name += pre_read_percentage; | 2020 uma_name += pre_read_percentage; |
2013 AddPreReadHistogramTime(uma_name.c_str(), time); | 2021 AddPreReadHistogramTime(uma_name.c_str(), time); |
2014 } | 2022 } |
2015 #endif | 2023 #endif |
2016 #endif | 2024 #endif |
2017 } | 2025 } |
OLD | NEW |