OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "app/hi_res_timer_manager.h" | 11 #include "app/hi_res_timer_manager.h" |
12 #include "app/system_monitor.h" | 12 #include "app/system_monitor.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 |
| 17 #if defined(USE_LINUX_BREAKPAD) |
| 18 #include "chrome/app/breakpad_linux.h" |
| 19 #endif |
| 20 |
16 #include "chrome/common/child_process.h" | 21 #include "chrome/common/child_process.h" |
17 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
18 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/logging_chrome.h" | 24 #include "chrome/common/logging_chrome.h" |
20 #include "chrome/common/main_function_params.h" | 25 #include "chrome/common/main_function_params.h" |
21 #include "chrome/common/result_codes.h" | 26 #include "chrome/common/result_codes.h" |
22 #include "chrome/common/sandbox_policy.h" | 27 #include "chrome/common/sandbox_policy.h" |
23 #include "chrome/nacl/nacl_main_platform_delegate.h" | 28 #include "chrome/nacl/nacl_main_platform_delegate.h" |
24 #include "chrome/nacl/nacl_thread.h" | 29 #include "chrome/nacl/nacl_thread.h" |
25 | 30 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // This function provides some ways to test crash and assertion handling | 88 // This function provides some ways to test crash and assertion handling |
84 // behavior of the renderer. | 89 // behavior of the renderer. |
85 static void HandleNaClTestParameters(const CommandLine& command_line) { | 90 static void HandleNaClTestParameters(const CommandLine& command_line) { |
86 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { | 91 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { |
87 ChildProcess::WaitForDebugger(L"NativeClient"); | 92 ChildProcess::WaitForDebugger(L"NativeClient"); |
88 } | 93 } |
89 } | 94 } |
90 | 95 |
91 // main() routine for the NaCl loader process. | 96 // main() routine for the NaCl loader process. |
92 int NaClMain(const MainFunctionParams& parameters) { | 97 int NaClMain(const MainFunctionParams& parameters) { |
| 98 #if defined(USE_LINUX_BREAKPAD) |
| 99 // Needs to be called after we have chrome::DIR_USER_DATA. |
| 100 InitCrashReporter(); |
| 101 #endif |
93 const CommandLine& parsed_command_line = parameters.command_line_; | 102 const CommandLine& parsed_command_line = parameters.command_line_; |
94 | 103 |
95 // This function allows pausing execution using the --nacl-startup-dialog | 104 // This function allows pausing execution using the --nacl-startup-dialog |
96 // flag allowing us to attach a debugger. | 105 // flag allowing us to attach a debugger. |
97 // Do not move this function down since that would mean we can't easily debug | 106 // Do not move this function down since that would mean we can't easily debug |
98 // whatever occurs before it. | 107 // whatever occurs before it. |
99 HandleNaClTestParameters(parsed_command_line); | 108 HandleNaClTestParameters(parsed_command_line); |
100 | 109 |
101 // The main thread of the plugin services IO. | 110 // The main thread of the plugin services IO. |
102 MessageLoopForIO main_message_loop; | 111 MessageLoopForIO main_message_loop; |
(...skipping 26 matching lines...) Expand all Loading... |
129 // require waiting for a timeout. | 138 // require waiting for a timeout. |
130 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; | 139 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; |
131 } | 140 } |
132 #else | 141 #else |
133 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 142 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
134 #endif | 143 #endif |
135 | 144 |
136 platform.PlatformUninitialize(); | 145 platform.PlatformUninitialize(); |
137 return 0; | 146 return 0; |
138 } | 147 } |
OLD | NEW |