Chromium Code Reviews| 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 "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" | |
| 10 #include "base/timer/hi_res_timer_manager.h" | |
| 11 #include "chrome/common/chrome_result_codes.h" | 9 #include "chrome/common/chrome_result_codes.h" |
| 12 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/logging_chrome.h" | 11 #include "chrome/common/logging_chrome.h" |
| 14 #include "chrome/nacl/nacl_listener.h" | 12 #include "chrome/nacl/nacl_listener.h" |
| 15 #include "chrome/nacl/nacl_main_platform_delegate.h" | 13 #include "chrome/nacl/nacl_main_platform_delegate.h" |
| 16 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 17 #include "content/public/common/main_function_params.h" | 15 #include "content/public/common/main_function_params.h" |
| 18 | 16 |
| 19 // main() routine for the NaCl loader process. | 17 // main() routine for the NaCl loader process. |
| 20 int NaClMain(const content::MainFunctionParams& parameters) { | 18 int NaClMain(const content::MainFunctionParams& parameters) { |
| 21 const CommandLine& parsed_command_line = parameters.command_line; | 19 const CommandLine& parsed_command_line = parameters.command_line; |
| 22 | 20 |
| 23 // The main thread of the plugin services IO. | 21 // The main thread of the plugin services IO. |
| 24 base::MessageLoopForIO main_message_loop; | 22 base::MessageLoopForIO main_message_loop; |
| 25 base::PlatformThread::SetName("CrNaClMain"); | 23 base::PlatformThread::SetName("CrNaClMain"); |
| 26 | 24 |
| 27 base::PowerMonitor power_monitor; | |
| 28 base::HighResolutionTimerManager hi_res_timer_manager; | |
| 29 | |
|
jvoung (off chromium)
2013/07/31 21:24:39
Note that nacl_main got moved to components, I thi
| |
| 30 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 25 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 31 NaClMainPlatformDelegate platform(parameters); | 26 NaClMainPlatformDelegate platform(parameters); |
| 32 | 27 |
| 33 platform.PlatformInitialize(); | 28 platform.PlatformInitialize(); |
| 34 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 29 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
| 35 platform.InitSandboxTests(no_sandbox); | 30 platform.InitSandboxTests(no_sandbox); |
| 36 | 31 |
| 37 #if defined(OS_POSIX) | 32 #if defined(OS_POSIX) |
| 38 // The number of cores must be obtained before the invocation of | 33 // The number of cores must be obtained before the invocation of |
| 39 // platform.EnableSandbox(), so cannot simply be inlined below. | 34 // platform.EnableSandbox(), so cannot simply be inlined below. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 58 // require waiting for a timeout. | 53 // require waiting for a timeout. |
| 59 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; | 54 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; |
| 60 } | 55 } |
| 61 #else | 56 #else |
| 62 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 57 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
| 63 #endif | 58 #endif |
| 64 | 59 |
| 65 platform.PlatformUninitialize(); | 60 platform.PlatformUninitialize(); |
| 66 return 0; | 61 return 0; |
| 67 } | 62 } |
| OLD | NEW |