| 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/trusted/service_runtime/sel_main_chrome.h" | 7 #include "native_client/src/trusted/service_runtime/sel_main_chrome.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 27 matching lines...) Expand all Loading... |
| 38 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) { | 38 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) { |
| 39 struct NaClChromeMainArgs *args = malloc(sizeof(*args)); | 39 struct NaClChromeMainArgs *args = malloc(sizeof(*args)); |
| 40 if (args == NULL) | 40 if (args == NULL) |
| 41 return NULL; | 41 return NULL; |
| 42 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; | 42 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; |
| 43 args->irt_fd = -1; | 43 args->irt_fd = -1; |
| 44 args->enable_exception_handling = 0; | 44 args->enable_exception_handling = 0; |
| 45 args->enable_debug_stub = 0; | 45 args->enable_debug_stub = 0; |
| 46 args->create_memory_object_func = NULL; | 46 args->create_memory_object_func = NULL; |
| 47 args->validation_cache = NULL; | 47 args->validation_cache = NULL; |
| 48 #if NACL_WINDOWS |
| 49 args->broker_duplicate_handle_func = NULL; |
| 50 #endif |
| 48 return args; | 51 return args; |
| 49 } | 52 } |
| 50 | 53 |
| 51 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) { | 54 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) { |
| 52 int file_desc; | 55 int file_desc; |
| 53 struct GioPio gio_pio; | 56 struct GioPio gio_pio; |
| 54 struct Gio *gio_desc; | 57 struct Gio *gio_desc; |
| 55 | 58 |
| 56 if (irt_fd == -1) { | 59 if (irt_fd == -1) { |
| 57 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n"); | 60 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n"); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 117 } |
| 115 | 118 |
| 116 errcode = LOAD_OK; | 119 errcode = LOAD_OK; |
| 117 | 120 |
| 118 if (args->create_memory_object_func != NULL) | 121 if (args->create_memory_object_func != NULL) |
| 119 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func); | 122 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func); |
| 120 | 123 |
| 121 /* Inject the validation caching interface, if it exists. */ | 124 /* Inject the validation caching interface, if it exists. */ |
| 122 nap->validation_cache = args->validation_cache; | 125 nap->validation_cache = args->validation_cache; |
| 123 | 126 |
| 127 #if NACL_WINDOWS |
| 128 if (args->broker_duplicate_handle_func != NULL) |
| 129 NaClSetBrokerDuplicateHandleFunc(args->broker_duplicate_handle_func); |
| 130 #endif |
| 131 |
| 124 NaClAppInitialDescriptorHookup(nap); | 132 NaClAppInitialDescriptorHookup(nap); |
| 125 | 133 |
| 126 /* | 134 /* |
| 127 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR | 135 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR |
| 128 * are 3 and 4. | 136 * are 3 and 4. |
| 129 */ | 137 */ |
| 130 | 138 |
| 131 /* import IMC handle - used to be "-i" */ | 139 /* import IMC handle - used to be "-i" */ |
| 132 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to); | 140 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to); |
| 133 | 141 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 if (LOAD_OK != errcode) { | 315 if (LOAD_OK != errcode) { |
| 308 NaClBlockIfCommandChannelExists(nap); | 316 NaClBlockIfCommandChannelExists(nap); |
| 309 } | 317 } |
| 310 | 318 |
| 311 done_ctor: | 319 done_ctor: |
| 312 | 320 |
| 313 NaClAllModulesFini(); | 321 NaClAllModulesFini(); |
| 314 | 322 |
| 315 NaClExit(ret_code); | 323 NaClExit(ret_code); |
| 316 } | 324 } |
| OLD | NEW |