| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "native_client/src/public/chrome_main.h" | 7 #include "native_client/src/public/chrome_main.h" |
| 8 | 8 |
| 9 #include "native_client/src/include/portability.h" | 9 #include "native_client/src/include/portability.h" |
| 10 #include "native_client/src/include/portability_io.h" | 10 #include "native_client/src/include/portability_io.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; | 69 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; |
| 70 args->irt_fd = -1; | 70 args->irt_fd = -1; |
| 71 args->enable_exception_handling = 0; | 71 args->enable_exception_handling = 0; |
| 72 args->enable_debug_stub = 0; | 72 args->enable_debug_stub = 0; |
| 73 args->enable_dyncode_syscalls = 1; | 73 args->enable_dyncode_syscalls = 1; |
| 74 args->pnacl_mode = 0; | 74 args->pnacl_mode = 0; |
| 75 args->initial_nexe_max_code_bytes = 0; /* No limit */ | 75 args->initial_nexe_max_code_bytes = 0; /* No limit */ |
| 76 #if NACL_LINUX || NACL_OSX | 76 #if NACL_LINUX || NACL_OSX |
| 77 args->debug_stub_server_bound_socket_fd = NACL_INVALID_SOCKET; | 77 args->debug_stub_server_bound_socket_fd = NACL_INVALID_SOCKET; |
| 78 #endif | 78 #endif |
| 79 args->debug_stub_server_port_selected_handler_func = NULL; |
| 79 args->create_memory_object_func = NULL; | 80 args->create_memory_object_func = NULL; |
| 80 args->validation_cache = NULL; | 81 args->validation_cache = NULL; |
| 81 #if NACL_WINDOWS | 82 #if NACL_WINDOWS |
| 82 args->broker_duplicate_handle_func = NULL; | 83 args->broker_duplicate_handle_func = NULL; |
| 83 args->attach_debug_exception_handler_func = NULL; | 84 args->attach_debug_exception_handler_func = NULL; |
| 84 #endif | 85 #endif |
| 85 #if NACL_LINUX || NACL_OSX | 86 #if NACL_LINUX || NACL_OSX |
| 86 args->number_of_cores = -1; /* unknown */ | 87 args->number_of_cores = -1; /* unknown */ |
| 87 #endif | 88 #endif |
| 88 #if NACL_LINUX | 89 #if NACL_LINUX |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 306 |
| 306 if (args->enable_debug_stub) { | 307 if (args->enable_debug_stub) { |
| 307 #if NACL_LINUX || NACL_OSX | 308 #if NACL_LINUX || NACL_OSX |
| 308 if (args->debug_stub_server_bound_socket_fd != NACL_INVALID_SOCKET) { | 309 if (args->debug_stub_server_bound_socket_fd != NACL_INVALID_SOCKET) { |
| 309 NaClDebugSetBoundSocket(args->debug_stub_server_bound_socket_fd); | 310 NaClDebugSetBoundSocket(args->debug_stub_server_bound_socket_fd); |
| 310 } | 311 } |
| 311 #endif | 312 #endif |
| 312 if (!NaClDebugInit(nap)) { | 313 if (!NaClDebugInit(nap)) { |
| 313 goto done; | 314 goto done; |
| 314 } | 315 } |
| 316 if (NULL != args->debug_stub_server_port_selected_handler_func) { |
| 317 args->debug_stub_server_port_selected_handler_func(nap->debug_stub_port); |
| 318 } |
| 315 } | 319 } |
| 316 | 320 |
| 317 free(args); | 321 free(args); |
| 318 return LOAD_OK; | 322 return LOAD_OK; |
| 319 | 323 |
| 320 done: | 324 done: |
| 321 fflush(stdout); | 325 fflush(stdout); |
| 322 | 326 |
| 323 /* | 327 /* |
| 324 * If there is a secure command channel, we sent an RPC reply with | 328 * If there is a secure command channel, we sent an RPC reply with |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 */ | 403 */ |
| 400 NaClExit(ret_code); | 404 NaClExit(ret_code); |
| 401 } | 405 } |
| 402 | 406 |
| 403 void NaClChromeMainStartApp(struct NaClApp *nap, | 407 void NaClChromeMainStartApp(struct NaClApp *nap, |
| 404 struct NaClChromeMainArgs *args) { | 408 struct NaClChromeMainArgs *args) { |
| 405 if (NaClChromeMainLoad(nap, args) != 0) | 409 if (NaClChromeMainLoad(nap, args) != 0) |
| 406 NaClExit(1); | 410 NaClExit(1); |
| 407 NaClChromeMainStart(nap); | 411 NaClChromeMainStart(nap); |
| 408 } | 412 } |
| OLD | NEW |