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

Side by Side Diff: content/worker/worker_main.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/base_switches.h" 5 #include "base/base_switches.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/hi_res_timer_manager.h" 7 #include "base/hi_res_timer_manager.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/power_monitor/power_monitor.h"
9 #include "base/string_util.h" 10 #include "base/string_util.h"
10 #include "base/system_monitor/system_monitor.h"
11 #include "base/threading/platform_thread.h" 11 #include "base/threading/platform_thread.h"
12 #include "content/common/child_process.h" 12 #include "content/common/child_process.h"
13 #include "content/public/common/main_function_params.h" 13 #include "content/public/common/main_function_params.h"
14 #include "content/public/common/sandbox_init.h" 14 #include "content/public/common/sandbox_init.h"
15 #include "content/worker/worker_thread.h" 15 #include "content/worker/worker_thread.h"
16 16
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 #include "sandbox/win/src/sandbox.h" 18 #include "sandbox/win/src/sandbox.h"
19 #endif 19 #endif
20 20
21 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
22 #include "content/common/sandbox_mac.h" 22 #include "content/common/sandbox_mac.h"
23 #endif 23 #endif
24 24
25 namespace content { 25 namespace content {
26 26
27 // Mainline routine for running as the worker process. 27 // Mainline routine for running as the worker process.
28 int WorkerMain(const MainFunctionParams& parameters) { 28 int WorkerMain(const MainFunctionParams& parameters) {
29 // The main message loop of the worker process. 29 // The main message loop of the worker process.
30 MessageLoop main_message_loop; 30 MessageLoop main_message_loop;
31 base::PlatformThread::SetName("CrWorkerMain"); 31 base::PlatformThread::SetName("CrWorkerMain");
32 32
33 base::SystemMonitor system_monitor; 33 base::PowerMonitor power_monitor;
34 HighResolutionTimerManager hi_res_timer_manager; 34 HighResolutionTimerManager hi_res_timer_manager;
35 35
36 #if defined(OS_WIN) 36 #if defined(OS_WIN)
37 sandbox::TargetServices* target_services = 37 sandbox::TargetServices* target_services =
38 parameters.sandbox_info->target_services; 38 parameters.sandbox_info->target_services;
39 if (!target_services) 39 if (!target_services)
40 return false; 40 return false;
41 41
42 // Cause advapi32 to load before the sandbox is turned on. 42 // Cause advapi32 to load before the sandbox is turned on.
43 unsigned int dummy_rand; 43 unsigned int dummy_rand;
(...skipping 21 matching lines...) Expand all
65 } 65 }
66 66
67 // Load the accelerator table from the browser executable and tell the 67 // Load the accelerator table from the browser executable and tell the
68 // message loop to use it when translating messages. 68 // message loop to use it when translating messages.
69 MessageLoop::current()->Run(); 69 MessageLoop::current()->Run();
70 70
71 return 0; 71 return 0;
72 } 72 }
73 73
74 } // namespace content 74 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698