OLD | NEW |
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 "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.h" | 8 #include "base/message_loop.h" |
9 #include "base/system_monitor/system_monitor.h" | 9 #include "base/system_monitor/system_monitor.h" |
10 #include "chrome/common/chrome_result_codes.h" | 10 #include "chrome/common/chrome_result_codes.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/common/logging_chrome.h" | 12 #include "chrome/common/logging_chrome.h" |
13 #include "chrome/nacl/nacl_listener.h" | 13 #include "chrome/nacl/nacl_listener.h" |
14 #include "chrome/nacl/nacl_main_platform_delegate.h" | 14 #include "chrome/nacl/nacl_main_platform_delegate.h" |
15 #include "content/common/child_process.h" | 15 #include "content/common/child_process.h" |
16 #include "content/common/hi_res_timer_manager.h" | 16 #include "content/common/hi_res_timer_manager.h" |
17 #include "content/common/main_function_params.h" | 17 #include "content/public/common/main_function_params.h" |
18 | 18 |
19 // This function provides some ways to test crash and assertion handling | 19 // This function provides some ways to test crash and assertion handling |
20 // behavior of the renderer. | 20 // behavior of the renderer. |
21 static void HandleNaClTestParameters(const CommandLine& command_line) { | 21 static void HandleNaClTestParameters(const CommandLine& command_line) { |
22 // The message box doesn't work in the 64 bit binaries anyways, so no need to | 22 // The message box doesn't work in the 64 bit binaries anyways, so no need to |
23 // link to it since the 64 bit binary doesn't link with chrome or content. | 23 // link to it since the 64 bit binary doesn't link with chrome or content. |
24 #if !defined(NACL_WIN64) | 24 #if !defined(NACL_WIN64) |
25 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { | 25 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { |
26 ChildProcess::WaitForDebugger("NativeClient"); | 26 ChildProcess::WaitForDebugger("NativeClient"); |
27 } | 27 } |
28 #endif | 28 #endif |
29 } | 29 } |
30 | 30 |
31 // main() routine for the NaCl loader process. | 31 // main() routine for the NaCl loader process. |
32 int NaClMain(const MainFunctionParams& parameters) { | 32 int NaClMain(const content::MainFunctionParams& parameters) { |
33 const CommandLine& parsed_command_line = parameters.command_line; | 33 const CommandLine& parsed_command_line = parameters.command_line; |
34 | 34 |
35 // This function allows pausing execution using the --nacl-startup-dialog | 35 // This function allows pausing execution using the --nacl-startup-dialog |
36 // flag allowing us to attach a debugger. | 36 // flag allowing us to attach a debugger. |
37 // Do not move this function down since that would mean we can't easily debug | 37 // Do not move this function down since that would mean we can't easily debug |
38 // whatever occurs before it. | 38 // whatever occurs before it. |
39 HandleNaClTestParameters(parsed_command_line); | 39 HandleNaClTestParameters(parsed_command_line); |
40 | 40 |
41 // The main thread of the plugin services IO. | 41 // The main thread of the plugin services IO. |
42 MessageLoopForIO main_message_loop; | 42 MessageLoopForIO main_message_loop; |
(...skipping 26 matching lines...) Expand all Loading... |
69 // require waiting for a timeout. | 69 // require waiting for a timeout. |
70 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; | 70 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; |
71 } | 71 } |
72 #else | 72 #else |
73 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 73 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
74 #endif | 74 #endif |
75 | 75 |
76 platform.PlatformUninitialize(); | 76 platform.PlatformUninitialize(); |
77 return 0; | 77 return 0; |
78 } | 78 } |
OLD | NEW |