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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 258173004: [NO SUBMIT] Battery Status API skeleton implementation ASYNC Base URL: https://chromium.googlesource.com/chromium/src.git@April-17-battery-status-renderer-and-IPC
Patch Set: Created 6 years, 7 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
OLDNEW
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/file_util.h" 10 #include "base/file_util.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/pending_task.h" 16 #include "base/pending_task.h"
17 #include "base/power_monitor/power_monitor.h" 17 #include "base/power_monitor/power_monitor.h"
18 #include "base/power_monitor/power_monitor_device_source.h" 18 #include "base/power_monitor/power_monitor_device_source.h"
19 #include "base/process/process_metrics.h" 19 #include "base/process/process_metrics.h"
20 #include "base/run_loop.h" 20 #include "base/run_loop.h"
21 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
22 #include "base/system_monitor/system_monitor.h" 22 #include "base/system_monitor/system_monitor.h"
23 #include "base/thread_task_runner_handle.h" 23 #include "base/thread_task_runner_handle.h"
24 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
25 #include "base/timer/hi_res_timer_manager.h" 25 #include "base/timer/hi_res_timer_manager.h"
26 #include "content/browser/browser_thread_impl.h" 26 #include "content/browser/browser_thread_impl.h"
27 #include "content/browser/device_sensors/device_inertial_sensor_service.h" 27 #include "content/browser/device_sensors/device_inertial_sensor_service.h"
28 #include "content/browser/battery_status/battery_status_service.h"
28 #include "content/browser/download/save_file_manager.h" 29 #include "content/browser/download/save_file_manager.h"
29 #include "content/browser/gamepad/gamepad_service.h" 30 #include "content/browser/gamepad/gamepad_service.h"
30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 31 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
31 #include "content/browser/gpu/compositor_util.h" 32 #include "content/browser/gpu/compositor_util.h"
32 #include "content/browser/gpu/gpu_data_manager_impl.h" 33 #include "content/browser/gpu/gpu_data_manager_impl.h"
33 #include "content/browser/gpu/gpu_process_host.h" 34 #include "content/browser/gpu/gpu_process_host.h"
34 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 35 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
35 #include "content/browser/histogram_synchronizer.h" 36 #include "content/browser/histogram_synchronizer.h"
36 #include "content/browser/loader/resource_dispatcher_host_impl.h" 37 #include "content/browser/loader/resource_dispatcher_host_impl.h"
37 #include "content/browser/media/capture/audio_mirroring_manager.h" 38 #include "content/browser/media/capture/audio_mirroring_manager.h"
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 // I/O thread and isn't threadsafe. 865 // I/O thread and isn't threadsafe.
865 { 866 {
866 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); 867 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService");
867 GamepadService::GetInstance()->Terminate(); 868 GamepadService::GetInstance()->Terminate();
868 } 869 }
869 { 870 {
870 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); 871 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService");
871 DeviceInertialSensorService::GetInstance()->Shutdown(); 872 DeviceInertialSensorService::GetInstance()->Shutdown();
872 } 873 }
873 { 874 {
875 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService");
876 BatteryStatusService::GetInstance()->Shutdown();
877 }
878 {
874 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); 879 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
875 URLDataManager::DeleteDataSources(); 880 URLDataManager::DeleteDataSources();
876 } 881 }
877 #endif // !defined(OS_IOS) 882 #endif // !defined(OS_IOS)
878 883
879 if (parts_) { 884 if (parts_) {
880 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads"); 885 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads");
881 parts_->PostDestroyThreads(); 886 parts_->PostDestroyThreads();
882 } 887 }
883 } 888 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 base::TimeDelta::FromSeconds(delay_secs)); 1103 base::TimeDelta::FromSeconds(delay_secs));
1099 } 1104 }
1100 1105
1101 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { 1106 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) {
1102 is_tracing_startup_ = false; 1107 is_tracing_startup_ = false;
1103 TracingController::GetInstance()->DisableRecording( 1108 TracingController::GetInstance()->DisableRecording(
1104 trace_file, base::Bind(&OnStoppedStartupTracing)); 1109 trace_file, base::Bind(&OnStoppedStartupTracing));
1105 } 1110 }
1106 1111
1107 } // namespace content 1112 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/battery_status/battery_status_service.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698