| OLD | NEW |
| 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 "components/nacl/loader/nacl_listener.h" | 5 #include "components/nacl/loader/nacl_listener.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #if defined(OS_POSIX) | 10 #if defined(OS_POSIX) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 int AttachDebugExceptionHandler(const void* info, size_t info_size) { | 103 int AttachDebugExceptionHandler(const void* info, size_t info_size) { |
| 104 std::string info_string(reinterpret_cast<const char*>(info), info_size); | 104 std::string info_string(reinterpret_cast<const char*>(info), info_size); |
| 105 bool result = false; | 105 bool result = false; |
| 106 if (!g_listener->Send(new NaClProcessMsg_AttachDebugExceptionHandler( | 106 if (!g_listener->Send(new NaClProcessMsg_AttachDebugExceptionHandler( |
| 107 info_string, &result))) | 107 info_string, &result))) |
| 108 return false; | 108 return false; |
| 109 return result; | 109 return result; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void DebugStubPortSelectedHandler(uint16_t port) { |
| 113 g_listener->Send(new NaClProcessHostMsg_DebugStubPortSelected(port)); |
| 114 } |
| 115 |
| 112 #endif | 116 #endif |
| 113 | 117 |
| 114 // Creates the PPAPI IPC channel between the NaCl IRT and the host | 118 // Creates the PPAPI IPC channel between the NaCl IRT and the host |
| 115 // (browser/renderer) process, and starts to listen it on the thread where | 119 // (browser/renderer) process, and starts to listen it on the thread where |
| 116 // the given message_loop_proxy runs. | 120 // the given message_loop_proxy runs. |
| 117 // Also, creates and sets the corresponding NaClDesc to the given nap with | 121 // Also, creates and sets the corresponding NaClDesc to the given nap with |
| 118 // the FD #. | 122 // the FD #. |
| 119 void SetUpIPCAdapter(IPC::ChannelHandle* handle, | 123 void SetUpIPCAdapter(IPC::ChannelHandle* handle, |
| 120 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, | 124 scoped_refptr<base::MessageLoopProxy> message_loop_proxy, |
| 121 struct NaClApp* nap, | 125 struct NaClApp* nap, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // instead of relying on enable_dyncode_syscalls. | 455 // instead of relying on enable_dyncode_syscalls. |
| 452 args->pnacl_mode = 1; | 456 args->pnacl_mode = 1; |
| 453 } | 457 } |
| 454 #if defined(OS_LINUX) || defined(OS_MACOSX) | 458 #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 455 args->debug_stub_server_bound_socket_fd = nacl::ToNativeHandle( | 459 args->debug_stub_server_bound_socket_fd = nacl::ToNativeHandle( |
| 456 params.debug_stub_server_bound_socket); | 460 params.debug_stub_server_bound_socket); |
| 457 #endif | 461 #endif |
| 458 #if defined(OS_WIN) | 462 #if defined(OS_WIN) |
| 459 args->broker_duplicate_handle_func = BrokerDuplicateHandle; | 463 args->broker_duplicate_handle_func = BrokerDuplicateHandle; |
| 460 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; | 464 args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; |
| 465 args->debug_stub_server_port_selected_handler_func = |
| 466 DebugStubPortSelectedHandler; |
| 461 #endif | 467 #endif |
| 462 #if defined(OS_LINUX) | 468 #if defined(OS_LINUX) |
| 463 args->prereserved_sandbox_size = prereserved_sandbox_size_; | 469 args->prereserved_sandbox_size = prereserved_sandbox_size_; |
| 464 #endif | 470 #endif |
| 465 | 471 |
| 466 NaClChromeMainStartApp(nap, args); | 472 NaClChromeMainStartApp(nap, args); |
| 467 NOTREACHED(); | 473 NOTREACHED(); |
| 468 } | 474 } |
| OLD | NEW |