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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 NaClSecureRngModuleSetUrandomFd(urandom_fd); | 52 NaClSecureRngModuleSetUrandomFd(urandom_fd); |
53 } | 53 } |
54 #endif | 54 #endif |
55 | 55 |
56 void NaClChromeMainInit(void) { | 56 void NaClChromeMainInit(void) { |
57 CHECK(!g_initialized); | 57 CHECK(!g_initialized); |
58 NaClAllModulesInit(); | 58 NaClAllModulesInit(); |
59 g_initialized = 1; | 59 g_initialized = 1; |
60 } | 60 } |
61 | 61 |
| 62 void NaClChromeMainInitForNonSfi(void) { |
| 63 CHECK(!g_initialized); |
| 64 NaClAllModulesInitForNonSfi(); |
| 65 g_initialized = 1; |
| 66 } |
| 67 |
62 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) { | 68 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void) { |
63 struct NaClChromeMainArgs *args; | 69 struct NaClChromeMainArgs *args; |
64 | 70 |
65 CHECK(g_initialized); | 71 CHECK(g_initialized); |
66 args = malloc(sizeof(*args)); | 72 args = malloc(sizeof(*args)); |
67 if (args == NULL) | 73 if (args == NULL) |
68 return NULL; | 74 return NULL; |
69 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; | 75 args->imc_bootstrap_handle = NACL_INVALID_HANDLE; |
70 args->irt_fd = -1; | 76 args->irt_fd = -1; |
71 args->enable_exception_handling = 0; | 77 args->enable_exception_handling = 0; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 * Instead, we wait for the hard-shutdown on the command channel. | 394 * Instead, we wait for the hard-shutdown on the command channel. |
389 */ | 395 */ |
390 if (LOAD_OK != errcode) { | 396 if (LOAD_OK != errcode) { |
391 NaClBlockIfCommandChannelExists(nap); | 397 NaClBlockIfCommandChannelExists(nap); |
392 } | 398 } |
393 | 399 |
394 NaClAllModulesFini(); | 400 NaClAllModulesFini(); |
395 | 401 |
396 NaClExit(ret_code); | 402 NaClExit(ret_code); |
397 } | 403 } |
OLD | NEW |