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

Side by Side Diff: components/nacl/loader/nacl_main.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows unit test errors Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/nacl/nacl_exe_win_64.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/power_monitor/power_monitor.h" 9 #include "base/power_monitor/power_monitor.h"
10 #include "base/power_monitor/power_monitor_device_source.h"
10 #include "base/timer/hi_res_timer_manager.h" 11 #include "base/timer/hi_res_timer_manager.h"
11 #include "components/nacl/loader/nacl_listener.h" 12 #include "components/nacl/loader/nacl_listener.h"
12 #include "components/nacl/loader/nacl_main_platform_delegate.h" 13 #include "components/nacl/loader/nacl_main_platform_delegate.h"
13 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
14 #include "content/public/common/main_function_params.h" 15 #include "content/public/common/main_function_params.h"
15 16
16 // main() routine for the NaCl loader process. 17 // main() routine for the NaCl loader process.
17 int NaClMain(const content::MainFunctionParams& parameters) { 18 int NaClMain(const content::MainFunctionParams& parameters) {
18 const CommandLine& parsed_command_line = parameters.command_line; 19 const CommandLine& parsed_command_line = parameters.command_line;
19 20
20 // The main thread of the plugin services IO. 21 // The main thread of the plugin services IO.
21 base::MessageLoopForIO main_message_loop; 22 base::MessageLoopForIO main_message_loop;
22 base::PlatformThread::SetName("CrNaClMain"); 23 base::PlatformThread::SetName("CrNaClMain");
23 24
24 base::PowerMonitor power_monitor; 25 scoped_ptr<base::PowerMonitorSource> power_monitor_source(
26 new base::PowerMonitorDeviceSource());
27 base::PowerMonitor power_monitor(power_monitor_source.Pass());
25 base::HighResolutionTimerManager hi_res_timer_manager; 28 base::HighResolutionTimerManager hi_res_timer_manager;
26 29
27 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 30 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
28 NaClMainPlatformDelegate platform(parameters); 31 NaClMainPlatformDelegate platform(parameters);
29 32
30 platform.PlatformInitialize(); 33 platform.PlatformInitialize();
31 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); 34 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
32 platform.InitSandboxTests(no_sandbox); 35 platform.InitSandboxTests(no_sandbox);
33 36
34 #if defined(OS_POSIX) 37 #if defined(OS_POSIX)
(...skipping 20 matching lines...) Expand all
55 // require waiting for a timeout. 58 // require waiting for a timeout.
56 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; 59 VLOG(1) << "Sandbox test failed: Not launching NaCl process";
57 } 60 }
58 #else 61 #else
59 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; 62 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc.";
60 #endif 63 #endif
61 64
62 platform.PlatformUninitialize(); 65 platform.PlatformUninitialize();
63 return 0; 66 return 0;
64 } 67 }
OLDNEW
« no previous file with comments | « chrome/nacl/nacl_exe_win_64.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698