| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 48 #if NACL_WINDOWS |
| 49 args->broker_duplicate_handle_func = NULL; | 49 args->broker_duplicate_handle_func = NULL; |
| 50 args->attach_debug_exception_handler_func = NULL; | 50 args->attach_debug_exception_handler_func = NULL; |
| 51 #endif | 51 #endif |
| 52 args->enable_dfa_validator = 0; |
| 52 return args; | 53 return args; |
| 53 } | 54 } |
| 54 | 55 |
| 55 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) { | 56 static void NaClLoadIrt(struct NaClApp *nap, int irt_fd) { |
| 56 int file_desc; | 57 int file_desc; |
| 57 struct GioPio gio_pio; | 58 struct GioPio gio_pio; |
| 58 struct Gio *gio_desc; | 59 struct Gio *gio_desc; |
| 59 | 60 |
| 60 if (irt_fd == -1) { | 61 if (irt_fd == -1) { |
| 61 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n"); | 62 NaClLog(LOG_FATAL, "NaClLoadIrt: Integrated runtime (IRT) not present.\n"); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func); | 124 NaClSetCreateMemoryObjectFunc(args->create_memory_object_func); |
| 124 | 125 |
| 125 /* Inject the validation caching interface, if it exists. */ | 126 /* Inject the validation caching interface, if it exists. */ |
| 126 nap->validation_cache = args->validation_cache; | 127 nap->validation_cache = args->validation_cache; |
| 127 | 128 |
| 128 #if NACL_WINDOWS | 129 #if NACL_WINDOWS |
| 129 if (args->broker_duplicate_handle_func != NULL) | 130 if (args->broker_duplicate_handle_func != NULL) |
| 130 NaClSetBrokerDuplicateHandleFunc(args->broker_duplicate_handle_func); | 131 NaClSetBrokerDuplicateHandleFunc(args->broker_duplicate_handle_func); |
| 131 #endif | 132 #endif |
| 132 | 133 |
| 134 if (args->enable_dfa_validator) { |
| 135 fprintf(stderr, "DANGER! USING THE UNSTABLE DFA VALIDATOR!\n"); |
| 136 nap->enable_dfa_validator = 1; |
| 137 } |
| 138 |
| 133 NaClAppInitialDescriptorHookup(nap); | 139 NaClAppInitialDescriptorHookup(nap); |
| 134 | 140 |
| 135 /* | 141 /* |
| 136 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR | 142 * NACL_SERVICE_PORT_DESCRIPTOR and NACL_SERVICE_ADDRESS_DESCRIPTOR |
| 137 * are 3 and 4. | 143 * are 3 and 4. |
| 138 */ | 144 */ |
| 139 | 145 |
| 140 /* import IMC handle - used to be "-i" */ | 146 /* import IMC handle - used to be "-i" */ |
| 141 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to); | 147 NaClAddImcHandle(nap, args->imc_bootstrap_handle, export_addr_to); |
| 142 | 148 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 if (LOAD_OK != errcode) { | 320 if (LOAD_OK != errcode) { |
| 315 NaClBlockIfCommandChannelExists(nap); | 321 NaClBlockIfCommandChannelExists(nap); |
| 316 } | 322 } |
| 317 | 323 |
| 318 done_ctor: | 324 done_ctor: |
| 319 | 325 |
| 320 NaClAllModulesFini(); | 326 NaClAllModulesFini(); |
| 321 | 327 |
| 322 NaClExit(ret_code); | 328 NaClExit(ret_code); |
| 323 } | 329 } |
| OLD | NEW |