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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 #include "chrome/browser/gpu_util.h" | 48 #include "chrome/browser/gpu_util.h" |
49 #include "chrome/browser/instant/instant_field_trial.h" | 49 #include "chrome/browser/instant/instant_field_trial.h" |
50 #include "chrome/browser/jankometer.h" | 50 #include "chrome/browser/jankometer.h" |
51 #include "chrome/browser/language_usage_metrics.h" | 51 #include "chrome/browser/language_usage_metrics.h" |
52 #include "chrome/browser/metrics/histogram_synchronizer.h" | 52 #include "chrome/browser/metrics/histogram_synchronizer.h" |
53 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 53 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
54 #include "chrome/browser/metrics/metrics_log.h" | 54 #include "chrome/browser/metrics/metrics_log.h" |
55 #include "chrome/browser/metrics/metrics_service.h" | 55 #include "chrome/browser/metrics/metrics_service.h" |
56 #include "chrome/browser/metrics/thread_watcher.h" | 56 #include "chrome/browser/metrics/thread_watcher.h" |
57 #include "chrome/browser/metrics/tracking_synchronizer.h" | 57 #include "chrome/browser/metrics/tracking_synchronizer.h" |
58 #include "chrome/browser/metrics/variations_service.h" | |
58 #include "chrome/browser/nacl_host/nacl_process_host.h" | 59 #include "chrome/browser/nacl_host/nacl_process_host.h" |
59 #include "chrome/browser/net/chrome_net_log.h" | 60 #include "chrome/browser/net/chrome_net_log.h" |
60 #include "chrome/browser/net/predictor.h" | 61 #include "chrome/browser/net/predictor.h" |
61 #include "chrome/browser/notifications/desktop_notification_service.h" | 62 #include "chrome/browser/notifications/desktop_notification_service.h" |
62 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 63 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
63 #include "chrome/browser/plugin_prefs.h" | 64 #include "chrome/browser/plugin_prefs.h" |
64 #include "chrome/browser/prefs/pref_service.h" | 65 #include "chrome/browser/prefs/pref_service.h" |
65 #include "chrome/browser/prefs/pref_value_store.h" | 66 #include "chrome/browser/prefs/pref_value_store.h" |
66 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 67 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
67 #include "chrome/browser/prerender/prerender_field_trial.h" | 68 #include "chrome/browser/prerender/prerender_field_trial.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 584 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
584 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 585 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
585 std::string persistent = command_line->GetSwitchValueASCII( | 586 std::string persistent = command_line->GetSwitchValueASCII( |
586 switches::kForceFieldTrials); | 587 switches::kForceFieldTrials); |
587 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); | 588 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); |
588 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << | 589 CHECK(ret) << "Invalid --" << switches::kForceFieldTrials << |
589 " list specified."; | 590 " list specified."; |
590 } | 591 } |
591 #endif // NDEBUG | 592 #endif // NDEBUG |
592 | 593 |
594 VariationsService* variations_service = | |
595 browser_process_->variations_service(); | |
596 variations_service->CreateTrialsFromSeed(browser_process_->local_state()); | |
597 | |
593 SetupFieldTrials(metrics->recording_active(), | 598 SetupFieldTrials(metrics->recording_active(), |
594 local_state_->IsManagedPreference( | 599 local_state_->IsManagedPreference( |
595 prefs::kMaxConnectionsPerProxy)); | 600 prefs::kMaxConnectionsPerProxy)); |
596 | 601 |
597 // Initialize FieldTrialSynchronizer system. This is a singleton and is used | 602 // Initialize FieldTrialSynchronizer system. This is a singleton and is used |
598 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 603 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
599 // Even though base::Bind does AddRef and Release, the object will not be | 604 // Even though base::Bind does AddRef and Release, the object will not be |
600 // deleted after the Task is executed. | 605 // deleted after the Task is executed. |
601 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 606 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
602 } | 607 } |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1854 parameters().autorelease_pool->Recycle(); | 1859 parameters().autorelease_pool->Recycle(); |
1855 #endif | 1860 #endif |
1856 | 1861 |
1857 RecordPreReadExperimentTime("Startup.BrowserOpenTabs", | 1862 RecordPreReadExperimentTime("Startup.BrowserOpenTabs", |
1858 base::TimeTicks::Now() - browser_open_start); | 1863 base::TimeTicks::Now() - browser_open_start); |
1859 | 1864 |
1860 // TODO(mad): Move this call in a proper place on CrOS. | 1865 // TODO(mad): Move this call in a proper place on CrOS. |
1861 // http://crosbug.com/17687 | 1866 // http://crosbug.com/17687 |
1862 #if !defined(OS_CHROMEOS) | 1867 #if !defined(OS_CHROMEOS) |
1863 // If we're running tests (ui_task is non-null), then we don't want to | 1868 // If we're running tests (ui_task is non-null), then we don't want to |
1864 // call FetchLanguageListFromTranslateServer | 1869 // call FetchLanguageListFromTranslateServer or |
1865 if (parameters().ui_task == NULL && translate_manager_ != NULL) { | 1870 // StartFetchingVariationsSeed. |
1866 translate_manager_->FetchLanguageListFromTranslateServer( | 1871 if (parameters().ui_task == NULL) { |
1867 profile_->GetPrefs()); | 1872 browser_process_->variations_service()->StartFetchingVariationsSeed(); |
1873 if (translate_manager_ != NULL) { | |
1874 translate_manager_->FetchLanguageListFromTranslateServer( | |
1875 profile_->GetPrefs()); | |
1876 // Request new variations seed information from server. | |
Alexei Svitkine (slow)
2012/05/16 19:53:06
This comment should be above the "browser_process_
jwd
2012/05/16 20:10:43
Done.
| |
1877 } | |
1868 } | 1878 } |
1869 #endif | 1879 #endif |
1870 | 1880 |
1871 run_message_loop_ = true; | 1881 run_message_loop_ = true; |
1872 } else { | 1882 } else { |
1873 run_message_loop_ = false; | 1883 run_message_loop_ = false; |
1874 } | 1884 } |
1875 browser_creator_.reset(); | 1885 browser_creator_.reset(); |
1876 | 1886 |
1877 PostBrowserStart(); | 1887 PostBrowserStart(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2007 if (base::win::GetVersion() <= base::win::VERSION_XP) | 2017 if (base::win::GetVersion() <= base::win::VERSION_XP) |
2008 uma_name += "_XP"; | 2018 uma_name += "_XP"; |
2009 | 2019 |
2010 uma_name += "_PreRead_"; | 2020 uma_name += "_PreRead_"; |
2011 uma_name += pre_read_percentage; | 2021 uma_name += pre_read_percentage; |
2012 AddPreReadHistogramTime(uma_name.c_str(), time); | 2022 AddPreReadHistogramTime(uma_name.c_str(), time); |
2013 } | 2023 } |
2014 #endif | 2024 #endif |
2015 #endif | 2025 #endif |
2016 } | 2026 } |
OLD | NEW |