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

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: rebase 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 // I/O thread and isn't threadsafe. 872 // I/O thread and isn't threadsafe.
872 { 873 {
873 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); 874 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService");
874 GamepadService::GetInstance()->Terminate(); 875 GamepadService::GetInstance()->Terminate();
875 } 876 }
876 { 877 {
877 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); 878 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService");
878 DeviceInertialSensorService::GetInstance()->Shutdown(); 879 DeviceInertialSensorService::GetInstance()->Shutdown();
879 } 880 }
880 { 881 {
882 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService");
883 BatteryStatusService::GetInstance()->Shutdown();
884 }
885 {
881 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); 886 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
882 URLDataManager::DeleteDataSources(); 887 URLDataManager::DeleteDataSources();
883 } 888 }
884 #endif // !defined(OS_IOS) 889 #endif // !defined(OS_IOS)
885 890
886 if (parts_) { 891 if (parts_) {
887 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads"); 892 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads");
888 parts_->PostDestroyThreads(); 893 parts_->PostDestroyThreads();
889 } 894 }
890 } 895 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 base::TimeDelta::FromSeconds(delay_secs)); 1124 base::TimeDelta::FromSeconds(delay_secs));
1120 } 1125 }
1121 1126
1122 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { 1127 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) {
1123 is_tracing_startup_ = false; 1128 is_tracing_startup_ = false;
1124 TracingController::GetInstance()->DisableRecording( 1129 TracingController::GetInstance()->DisableRecording(
1125 trace_file, base::Bind(&OnStoppedStartupTracing)); 1130 trace_file, base::Bind(&OnStoppedStartupTracing));
1126 } 1131 }
1127 1132
1128 } // namespace content 1133 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698