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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/common/sandbox_policy.h" | 22 #include "chrome/common/sandbox_policy.h" |
23 #include "chrome/nacl/nacl_main_platform_delegate.h" | 23 #include "chrome/nacl/nacl_main_platform_delegate.h" |
24 #include "chrome/nacl/nacl_thread.h" | 24 #include "chrome/nacl/nacl_thread.h" |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "chrome/nacl/broker_thread.h" | 27 #include "chrome/nacl/broker_thread.h" |
28 #include "chrome/test/injection_test_dll.h" | 28 #include "chrome/test/injection_test_dll.h" |
29 #include "sandbox/src/sandbox.h" | 29 #include "sandbox/src/sandbox.h" |
30 #endif | 30 #endif |
31 | 31 |
| 32 #if defined(USE_LINUX_BREAKPAD) |
| 33 #include "chrome/app/breakpad_linux.h" |
| 34 #endif |
| 35 |
32 #ifdef _WIN64 | 36 #ifdef _WIN64 |
33 | 37 |
34 // main() routine for the NaCl broker process. | 38 // main() routine for the NaCl broker process. |
35 // This is necessary for supporting NaCl in Chrome on Win64. | 39 // This is necessary for supporting NaCl in Chrome on Win64. |
36 int NaClBrokerMain(const MainFunctionParams& parameters) { | 40 int NaClBrokerMain(const MainFunctionParams& parameters) { |
37 // The main thread of the broker. | 41 // The main thread of the broker. |
38 MessageLoopForIO main_message_loop; | 42 MessageLoopForIO main_message_loop; |
39 base::PlatformThread::SetName("CrNaClBrokerMain"); | 43 base::PlatformThread::SetName("CrNaClBrokerMain"); |
40 | 44 |
41 SystemMonitor system_monitor; | 45 SystemMonitor system_monitor; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // This function provides some ways to test crash and assertion handling | 87 // This function provides some ways to test crash and assertion handling |
84 // behavior of the renderer. | 88 // behavior of the renderer. |
85 static void HandleNaClTestParameters(const CommandLine& command_line) { | 89 static void HandleNaClTestParameters(const CommandLine& command_line) { |
86 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { | 90 if (command_line.HasSwitch(switches::kNaClStartupDialog)) { |
87 ChildProcess::WaitForDebugger(L"NativeClient"); | 91 ChildProcess::WaitForDebugger(L"NativeClient"); |
88 } | 92 } |
89 } | 93 } |
90 | 94 |
91 // main() routine for the NaCl loader process. | 95 // main() routine for the NaCl loader process. |
92 int NaClMain(const MainFunctionParams& parameters) { | 96 int NaClMain(const MainFunctionParams& parameters) { |
| 97 #if defined(USE_LINUX_BREAKPAD) |
| 98 // Needs to be called after we have chrome::DIR_USER_DATA. |
| 99 InitCrashReporter(); |
| 100 #endif |
93 const CommandLine& parsed_command_line = parameters.command_line_; | 101 const CommandLine& parsed_command_line = parameters.command_line_; |
94 | 102 |
95 // This function allows pausing execution using the --nacl-startup-dialog | 103 // This function allows pausing execution using the --nacl-startup-dialog |
96 // flag allowing us to attach a debugger. | 104 // flag allowing us to attach a debugger. |
97 // Do not move this function down since that would mean we can't easily debug | 105 // Do not move this function down since that would mean we can't easily debug |
98 // whatever occurs before it. | 106 // whatever occurs before it. |
99 HandleNaClTestParameters(parsed_command_line); | 107 HandleNaClTestParameters(parsed_command_line); |
100 | 108 |
101 // The main thread of the plugin services IO. | 109 // The main thread of the plugin services IO. |
102 MessageLoopForIO main_message_loop; | 110 MessageLoopForIO main_message_loop; |
(...skipping 26 matching lines...) Expand all Loading... |
129 // require waiting for a timeout. | 137 // require waiting for a timeout. |
130 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; | 138 VLOG(1) << "Sandbox test failed: Not launching NaCl process"; |
131 } | 139 } |
132 #else | 140 #else |
133 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; | 141 NOTIMPLEMENTED() << " not implemented startup, plugin startup dialog etc."; |
134 #endif | 142 #endif |
135 | 143 |
136 platform.PlatformUninitialize(); | 144 platform.PlatformUninitialize(); |
137 return 0; | 145 return 0; |
138 } | 146 } |
OLD | NEW |