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/pending_task.h" | 14 #include "base/pending_task.h" |
15 #include "base/power_monitor/power_monitor.h" | 15 #include "base/power_monitor/power_monitor.h" |
| 16 #include "base/power_monitor/power_monitor_device_source.h" |
16 #include "base/process/process_metrics.h" | 17 #include "base/process/process_metrics.h" |
17 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
18 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
19 #include "base/system_monitor/system_monitor.h" | 20 #include "base/system_monitor/system_monitor.h" |
20 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
21 #include "base/timer/hi_res_timer_manager.h" | 22 #include "base/timer/hi_res_timer_manager.h" |
22 #include "content/browser/browser_thread_impl.h" | 23 #include "content/browser/browser_thread_impl.h" |
23 #include "content/browser/device_orientation/device_motion_service.h" | 24 #include "content/browser/device_orientation/device_motion_service.h" |
24 #include "content/browser/download/save_file_manager.h" | 25 #include "content/browser/download/save_file_manager.h" |
25 #include "content/browser/gamepad/gamepad_service.h" | 26 #include "content/browser/gamepad/gamepad_service.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 main_message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 391 main_message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
391 | 392 |
392 InitializeMainThread(); | 393 InitializeMainThread(); |
393 | 394 |
394 { | 395 { |
395 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SystemMonitor") | 396 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SystemMonitor") |
396 system_monitor_.reset(new base::SystemMonitor); | 397 system_monitor_.reset(new base::SystemMonitor); |
397 } | 398 } |
398 { | 399 { |
399 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:PowerMonitor") | 400 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:PowerMonitor") |
400 power_monitor_.reset(new base::PowerMonitor); | 401 scoped_ptr<base::PowerMonitorSource> power_monitor_source( |
| 402 new base::PowerMonitorDeviceSource()); |
| 403 power_monitor_.reset(new base::PowerMonitor(power_monitor_source.Pass())); |
401 } | 404 } |
402 { | 405 { |
403 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:HighResTimerManager") | 406 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:HighResTimerManager") |
404 hi_res_timer_manager_.reset(new base::HighResolutionTimerManager); | 407 hi_res_timer_manager_.reset(new base::HighResolutionTimerManager); |
405 } | 408 } |
406 { | 409 { |
407 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:NetworkChangeNotifier") | 410 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:NetworkChangeNotifier") |
408 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); | 411 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); |
409 } | 412 } |
410 | 413 |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 if (parameters_.ui_task) | 951 if (parameters_.ui_task) |
949 base::MessageLoopForUI::current()->PostTask(FROM_HERE, | 952 base::MessageLoopForUI::current()->PostTask(FROM_HERE, |
950 *parameters_.ui_task); | 953 *parameters_.ui_task); |
951 | 954 |
952 base::RunLoop run_loop; | 955 base::RunLoop run_loop; |
953 run_loop.Run(); | 956 run_loop.Run(); |
954 #endif | 957 #endif |
955 } | 958 } |
956 | 959 |
957 } // namespace content | 960 } // namespace content |
OLD | NEW |