| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "chrome/browser/component_updater/swiftshader_component_installer.h" | 56 #include "chrome/browser/component_updater/swiftshader_component_installer.h" |
| 57 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" | 57 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" |
| 58 #include "chrome/browser/defaults.h" | 58 #include "chrome/browser/defaults.h" |
| 59 #include "chrome/browser/first_run/first_run.h" | 59 #include "chrome/browser/first_run/first_run.h" |
| 60 #include "chrome/browser/gpu/gl_string_manager.h" | 60 #include "chrome/browser/gpu/gl_string_manager.h" |
| 61 #include "chrome/browser/gpu/three_d_api_observer.h" | 61 #include "chrome/browser/gpu/three_d_api_observer.h" |
| 62 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 62 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 63 #include "chrome/browser/memory/tab_manager.h" | 63 #include "chrome/browser/memory/tab_manager.h" |
| 64 #include "chrome/browser/metrics/field_trial_synchronizer.h" | 64 #include "chrome/browser/metrics/field_trial_synchronizer.h" |
| 65 #include "chrome/browser/metrics/thread_watcher.h" | 65 #include "chrome/browser/metrics/thread_watcher.h" |
| 66 #include "chrome/browser/mojo_runner_util.h" | |
| 67 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" | 66 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
| 68 #include "chrome/browser/net/crl_set_fetcher.h" | 67 #include "chrome/browser/net/crl_set_fetcher.h" |
| 69 #include "chrome/browser/performance_monitor/performance_monitor.h" | 68 #include "chrome/browser/performance_monitor/performance_monitor.h" |
| 70 #include "chrome/browser/plugins/plugin_prefs.h" | 69 #include "chrome/browser/plugins/plugin_prefs.h" |
| 71 #include "chrome/browser/power/process_power_collector.h" | 70 #include "chrome/browser/power/process_power_collector.h" |
| 72 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 71 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 73 #include "chrome/browser/prefs/command_line_pref_store.h" | 72 #include "chrome/browser/prefs/command_line_pref_store.h" |
| 74 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 73 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 75 #include "chrome/browser/prefs/pref_metrics_service.h" | 74 #include "chrome/browser/prefs/pref_metrics_service.h" |
| 76 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 75 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 240 |
| 242 #if defined(USE_AURA) | 241 #if defined(USE_AURA) |
| 243 #include "ui/aura/env.h" | 242 #include "ui/aura/env.h" |
| 244 #endif // defined(USE_AURA) | 243 #endif // defined(USE_AURA) |
| 245 | 244 |
| 246 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 245 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 247 #include "chrome/browser/chrome_webusb_browser_client.h" | 246 #include "chrome/browser/chrome_webusb_browser_client.h" |
| 248 #include "components/webusb/webusb_detector.h" | 247 #include "components/webusb/webusb_detector.h" |
| 249 #endif | 248 #endif |
| 250 | 249 |
| 251 #if defined(MOJO_RUNNER_CLIENT) | |
| 252 #include "chrome/browser/mojo_runner_state.h" | |
| 253 #endif | |
| 254 | |
| 255 using content::BrowserThread; | 250 using content::BrowserThread; |
| 256 | 251 |
| 257 namespace { | 252 namespace { |
| 258 | 253 |
| 259 // This function provides some ways to test crash and assertion handling | 254 // This function provides some ways to test crash and assertion handling |
| 260 // behavior of the program. | 255 // behavior of the program. |
| 261 void HandleTestParameters(const base::CommandLine& command_line) { | 256 void HandleTestParameters(const base::CommandLine& command_line) { |
| 262 // This parameter causes a null pointer crash (crash reporter trigger). | 257 // This parameter causes a null pointer crash (crash reporter trigger). |
| 263 if (command_line.HasSwitch(switches::kBrowserCrashTest)) { | 258 if (command_line.HasSwitch(switches::kBrowserCrashTest)) { |
| 264 int* bad_pointer = NULL; | 259 int* bad_pointer = NULL; |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 } | 1205 } |
| 1211 | 1206 |
| 1212 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { | 1207 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| 1213 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1208 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
| 1214 TRACK_SCOPED_REGION( | 1209 TRACK_SCOPED_REGION( |
| 1215 "Startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); | 1210 "Startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); |
| 1216 | 1211 |
| 1217 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); | 1212 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); |
| 1218 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); | 1213 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); |
| 1219 | 1214 |
| 1220 #if defined(MOJO_RUNNER_CLIENT) | |
| 1221 if (IsRunningInMojoRunner()) { | |
| 1222 mojo_runner_state_.reset(new MojoRunnerState); | |
| 1223 mojo_runner_state_->WaitForConnection(); | |
| 1224 } | |
| 1225 #endif // defined(MOJO_RUNNER_CLIENT) | |
| 1226 | |
| 1227 #if defined(OS_WIN) | 1215 #if defined(OS_WIN) |
| 1228 // Windows parental controls calls can be slow, so we do an early init here | 1216 // Windows parental controls calls can be slow, so we do an early init here |
| 1229 // that calculates this value off of the UI thread. | 1217 // that calculates this value off of the UI thread. |
| 1230 IncognitoModePrefs::InitializePlatformParentalControls(); | 1218 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 1231 #endif | 1219 #endif |
| 1232 | 1220 |
| 1233 #if defined(ENABLE_EXTENSIONS) | 1221 #if defined(ENABLE_EXTENSIONS) |
| 1234 if (!variations::GetVariationParamValue( | 1222 if (!variations::GetVariationParamValue( |
| 1235 "LightSpeed", "EarlyInitStartup").empty()) { | 1223 "LightSpeed", "EarlyInitStartup").empty()) { |
| 1236 // Try to compute this early on another thread so that we don't spend time | 1224 // Try to compute this early on another thread so that we don't spend time |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 chromeos::CrosSettings::Shutdown(); | 1850 chromeos::CrosSettings::Shutdown(); |
| 1863 #endif // defined(OS_CHROMEOS) | 1851 #endif // defined(OS_CHROMEOS) |
| 1864 #endif // defined(OS_ANDROID) | 1852 #endif // defined(OS_ANDROID) |
| 1865 } | 1853 } |
| 1866 | 1854 |
| 1867 // Public members: | 1855 // Public members: |
| 1868 | 1856 |
| 1869 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1857 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1870 chrome_extra_parts_.push_back(parts); | 1858 chrome_extra_parts_.push_back(parts); |
| 1871 } | 1859 } |
| OLD | NEW |