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

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

Issue 278043002: Battery Status API: browser-side implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add CONTENT_EXPORT to battery_status_manager.h 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/battery_status/battery_status_service.h"
26 #include "content/browser/browser_thread_impl.h" 27 #include "content/browser/browser_thread_impl.h"
27 #include "content/browser/device_sensors/device_inertial_sensor_service.h" 28 #include "content/browser/device_sensors/device_inertial_sensor_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"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // I/O thread and isn't threadsafe. 873 // I/O thread and isn't threadsafe.
873 { 874 {
874 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); 875 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService");
875 GamepadService::GetInstance()->Terminate(); 876 GamepadService::GetInstance()->Terminate();
876 } 877 }
877 { 878 {
878 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); 879 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService");
879 DeviceInertialSensorService::GetInstance()->Shutdown(); 880 DeviceInertialSensorService::GetInstance()->Shutdown();
880 } 881 }
881 { 882 {
883 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService");
884 BatteryStatusService::GetInstance()->Shutdown();
885 }
886 {
882 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); 887 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
883 URLDataManager::DeleteDataSources(); 888 URLDataManager::DeleteDataSources();
884 } 889 }
885 #endif // !defined(OS_IOS) 890 #endif // !defined(OS_IOS)
886 891
887 if (parts_) { 892 if (parts_) {
888 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads"); 893 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads");
889 parts_->PostDestroyThreads(); 894 parts_->PostDestroyThreads();
890 } 895 }
891 } 896 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 base::TimeDelta::FromSeconds(delay_secs)); 1131 base::TimeDelta::FromSeconds(delay_secs));
1127 } 1132 }
1128 1133
1129 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { 1134 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) {
1130 is_tracing_startup_ = false; 1135 is_tracing_startup_ = false;
1131 TracingController::GetInstance()->DisableRecording( 1136 TracingController::GetInstance()->DisableRecording(
1132 trace_file, base::Bind(&OnStoppedStartupTracing)); 1137 trace_file, base::Bind(&OnStoppedStartupTracing));
1133 } 1138 }
1134 1139
1135 } // namespace content 1140 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698