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

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

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use PowerMonitor instead of SystemMonitor in XXXMain function Created 7 years, 9 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/hi_res_timer_manager.h" 10 #include "base/hi_res_timer_manager.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/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/pending_task.h" 15 #include "base/pending_task.h"
16 #include "base/power_monitor/power_monitor.h"
17 #include "base/system_monitor/system_monitor.h"
16 #include "base/run_loop.h" 18 #include "base/run_loop.h"
17 #include "base/string_number_conversions.h" 19 #include "base/string_number_conversions.h"
18 #include "base/threading/thread_restrictions.h" 20 #include "base/threading/thread_restrictions.h"
19 #include "content/browser/browser_thread_impl.h" 21 #include "content/browser/browser_thread_impl.h"
20 #include "content/browser/download/save_file_manager.h" 22 #include "content/browser/download/save_file_manager.h"
21 #include "content/browser/gamepad/gamepad_service.h" 23 #include "content/browser/gamepad/gamepad_service.h"
22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 24 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
23 #include "content/browser/gpu/gpu_data_manager_impl.h" 25 #include "content/browser/gpu/gpu_data_manager_impl.h"
24 #include "content/browser/gpu/gpu_process_host.h" 26 #include "content/browser/gpu/gpu_process_host.h"
25 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 27 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 362 }
361 #endif 363 #endif
362 364
363 // Create a MessageLoop if one does not already exist for the current thread. 365 // Create a MessageLoop if one does not already exist for the current thread.
364 if (!MessageLoop::current()) 366 if (!MessageLoop::current())
365 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); 367 main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI));
366 368
367 InitializeMainThread(); 369 InitializeMainThread();
368 370
369 system_monitor_.reset(new base::SystemMonitor); 371 system_monitor_.reset(new base::SystemMonitor);
372 power_monitor_.reset(new base::PowerMonitor);
370 hi_res_timer_manager_.reset(new HighResolutionTimerManager); 373 hi_res_timer_manager_.reset(new HighResolutionTimerManager);
371 network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); 374 network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
372 audio_manager_.reset(media::AudioManager::Create()); 375 audio_manager_.reset(media::AudioManager::Create());
373 376
374 #if !defined(OS_IOS) 377 #if !defined(OS_IOS)
375 WebUIControllerFactory::RegisterFactory( 378 WebUIControllerFactory::RegisterFactory(
376 ContentWebUIControllerFactory::GetInstance()); 379 ContentWebUIControllerFactory::GetInstance());
377 380
378 audio_mirroring_manager_.reset(new AudioMirroringManager()); 381 audio_mirroring_manager_.reset(new AudioMirroringManager());
379 382
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 815 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
813 if (parameters_.ui_task) 816 if (parameters_.ui_task)
814 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); 817 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task);
815 818
816 base::RunLoop run_loop; 819 base::RunLoop run_loop;
817 run_loop.Run(); 820 run_loop.Run();
818 #endif 821 #endif
819 } 822 }
820 823
821 } // namespace content 824 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698