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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/pending_task.h" | 15 #include "base/pending_task.h" |
16 #include "base/power_monitor/power_monitor.h" | 16 #include "base/power_monitor/power_monitor.h" |
17 #include "base/power_monitor/power_monitor_device_source.h" | 17 #include "base/power_monitor/power_monitor_device_source.h" |
18 #include "base/process/process_metrics.h" | 18 #include "base/process/process_metrics.h" |
19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/system_monitor/system_monitor.h" | 21 #include "base/system_monitor/system_monitor.h" |
22 #include "base/thread_task_runner_handle.h" | 22 #include "base/thread_task_runner_handle.h" |
23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
24 #include "base/timer/hi_res_timer_manager.h" | 24 #include "base/timer/hi_res_timer_manager.h" |
25 #include "content/browser/battery_status/battery_status_service.h" | |
26 #include "content/browser/browser_thread_impl.h" | 25 #include "content/browser/browser_thread_impl.h" |
27 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 26 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
28 #include "content/browser/download/save_file_manager.h" | 27 #include "content/browser/download/save_file_manager.h" |
29 #include "content/browser/gamepad/gamepad_service.h" | 28 #include "content/browser/gamepad/gamepad_service.h" |
30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 29 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
31 #include "content/browser/gpu/compositor_util.h" | 30 #include "content/browser/gpu/compositor_util.h" |
32 #include "content/browser/gpu/gpu_data_manager_impl.h" | 31 #include "content/browser/gpu/gpu_data_manager_impl.h" |
33 #include "content/browser/gpu/gpu_process_host.h" | 32 #include "content/browser/gpu/gpu_process_host.h" |
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 33 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
35 #include "content/browser/histogram_synchronizer.h" | 34 #include "content/browser/histogram_synchronizer.h" |
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 35 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
37 #include "content/browser/media/media_internals.h" | 36 #include "content/browser/media/media_internals.h" |
38 #include "content/browser/net/browser_online_state_observer.h" | 37 #include "content/browser/net/browser_online_state_observer.h" |
39 #include "content/browser/renderer_host/media/media_stream_manager.h" | 38 #include "content/browser/renderer_host/media/media_stream_manager.h" |
40 #include "content/browser/speech/speech_recognition_manager_impl.h" | 39 #include "content/browser/speech/speech_recognition_manager_impl.h" |
41 #include "content/browser/startup_task_runner.h" | 40 #include "content/browser/startup_task_runner.h" |
42 #include "content/browser/time_zone_monitor.h" | 41 #include "content/browser/time_zone_monitor.h" |
43 #include "content/browser/webui/content_web_ui_controller_factory.h" | 42 #include "content/browser/webui/content_web_ui_controller_factory.h" |
44 #include "content/browser/webui/url_data_manager.h" | 43 #include "content/browser/webui/url_data_manager.h" |
45 #include "content/public/browser/browser_main_parts.h" | 44 #include "content/public/browser/browser_main_parts.h" |
46 #include "content/public/browser/browser_shutdown.h" | 45 #include "content/public/browser/browser_shutdown.h" |
47 #include "content/public/browser/content_browser_client.h" | 46 #include "content/public/browser/content_browser_client.h" |
48 #include "content/public/browser/render_process_host.h" | 47 #include "content/public/browser/render_process_host.h" |
49 #include "content/public/browser/tracing_controller.h" | 48 #include "content/public/browser/tracing_controller.h" |
50 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
51 #include "content/public/common/main_function_params.h" | 50 #include "content/public/common/main_function_params.h" |
52 #include "content/public/common/result_codes.h" | 51 #include "content/public/common/result_codes.h" |
53 #include "crypto/nss_util.h" | 52 #include "crypto/nss_util.h" |
| 53 #include "device/battery/battery_status_service.h" |
54 #include "media/audio/audio_manager.h" | 54 #include "media/audio/audio_manager.h" |
55 #include "media/base/media.h" | 55 #include "media/base/media.h" |
56 #include "media/base/user_input_monitor.h" | 56 #include "media/base/user_input_monitor.h" |
57 #include "media/midi/midi_manager.h" | 57 #include "media/midi/midi_manager.h" |
58 #include "net/base/network_change_notifier.h" | 58 #include "net/base/network_change_notifier.h" |
59 #include "net/socket/client_socket_factory.h" | 59 #include "net/socket/client_socket_factory.h" |
60 #include "net/ssl/ssl_config_service.h" | 60 #include "net/ssl/ssl_config_service.h" |
61 #include "ui/base/clipboard/clipboard.h" | 61 #include "ui/base/clipboard/clipboard.h" |
62 | 62 |
63 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 63 #if defined(USE_AURA) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 { | 921 { |
922 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); | 922 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); |
923 GamepadService::GetInstance()->Terminate(); | 923 GamepadService::GetInstance()->Terminate(); |
924 } | 924 } |
925 { | 925 { |
926 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); | 926 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); |
927 DeviceInertialSensorService::GetInstance()->Shutdown(); | 927 DeviceInertialSensorService::GetInstance()->Shutdown(); |
928 } | 928 } |
929 { | 929 { |
930 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService"); | 930 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService"); |
931 BatteryStatusService::GetInstance()->Shutdown(); | 931 device::BatteryStatusService::GetInstance()->Shutdown(); |
932 } | 932 } |
933 { | 933 { |
934 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); | 934 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); |
935 URLDataManager::DeleteDataSources(); | 935 URLDataManager::DeleteDataSources(); |
936 } | 936 } |
937 #endif // !defined(OS_IOS) | 937 #endif // !defined(OS_IOS) |
938 | 938 |
939 if (parts_) { | 939 if (parts_) { |
940 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads"); | 940 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads"); |
941 parts_->PostDestroyThreads(); | 941 parts_->PostDestroyThreads(); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 | 1195 |
1196 void BrowserMainLoop::EndStartupTracing() { | 1196 void BrowserMainLoop::EndStartupTracing() { |
1197 is_tracing_startup_ = false; | 1197 is_tracing_startup_ = false; |
1198 TracingController::GetInstance()->DisableRecording( | 1198 TracingController::GetInstance()->DisableRecording( |
1199 TracingController::CreateFileSink( | 1199 TracingController::CreateFileSink( |
1200 startup_trace_file_, | 1200 startup_trace_file_, |
1201 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1201 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1202 } | 1202 } |
1203 | 1203 |
1204 } // namespace content | 1204 } // namespace content |
OLD | NEW |