OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * Chrome native WebWorker support. | 8 * Chrome native WebWorker support. |
9 */ | 9 */ |
10 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
11 #include "native_client/src/include/portability_io.h" | 11 #include "native_client/src/include/portability_io.h" |
12 | 12 |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <stdlib.h> | 14 #include <stdlib.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 /* | 17 /* |
18 * There is a lot of partial commonality between this and sel_main.c | 18 * There is a lot of partial commonality between this and sel_main.c |
19 * TODO(sehr): refactor to eliminate the commonality. | 19 * TODO(sehr): refactor to eliminate the commonality. |
20 */ | 20 */ |
21 | 21 |
22 #include "native_client/src/shared/gio/gio.h" | 22 #include "native_client/src/shared/gio/gio.h" |
23 #include "native_client/src/shared/imc/nacl_imc_c.h" | 23 #include "native_client/src/shared/imc/nacl_imc_c.h" |
24 #include "native_client/src/shared/platform/nacl_log.h" | 24 #include "native_client/src/shared/platform/nacl_log.h" |
25 #include "native_client/src/shared/platform/nacl_sync.h" | 25 #include "native_client/src/shared/platform/nacl_sync.h" |
26 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 26 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
27 #include "native_client/src/shared/srpc/nacl_srpc.h" | 27 #include "native_client/src/shared/srpc/nacl_srpc.h" |
28 | 28 |
29 #include "native_client/src/trusted/desc/nacl_desc_imc.h" | 29 #include "native_client/src/trusted/desc/nacl_desc_imc.h" |
| 30 #include "native_client/src/trusted/platform_qualify/nacl_dep_qualify.h" |
30 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h" | 31 #include "native_client/src/trusted/platform_qualify/nacl_os_qualify.h" |
31 | 32 |
32 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 33 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
33 #include "native_client/src/trusted/service_runtime/expiration.h" | 34 #include "native_client/src/trusted/service_runtime/expiration.h" |
34 #include "native_client/src/trusted/service_runtime/nacl_all_modules.h" | 35 #include "native_client/src/trusted/service_runtime/nacl_all_modules.h" |
35 #include "native_client/src/trusted/service_runtime/nacl_app.h" | 36 #include "native_client/src/trusted/service_runtime/nacl_app.h" |
36 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 37 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
37 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" | 38 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" |
38 #include "native_client/src/trusted/service_runtime/sel_ldr.h" | 39 #include "native_client/src/trusted/service_runtime/sel_ldr.h" |
39 #include "native_client/src/trusted/service_runtime/web_worker_stub.h" | 40 #include "native_client/src/trusted/service_runtime/web_worker_stub.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 *nap = state; | 137 *nap = state; |
137 | 138 |
138 /* | 139 /* |
139 * Ensure this operating system platform is supported. | 140 * Ensure this operating system platform is supported. |
140 */ | 141 */ |
141 if (!NaClOsIsSupported()) { | 142 if (!NaClOsIsSupported()) { |
142 goto done; | 143 goto done; |
143 } | 144 } |
144 /* | 145 /* |
| 146 * Ensure this platform has Data Execution Prevention enabled. |
| 147 */ |
| 148 if (!NaClCheckDEP()) { |
| 149 goto done; |
| 150 } |
| 151 /* |
145 * Load the NaCl module from the memory file. | 152 * Load the NaCl module from the memory file. |
146 */ | 153 */ |
147 if (LOAD_OK != NaClAppLoadFile((struct Gio *) &gf, | 154 if (LOAD_OK != NaClAppLoadFile((struct Gio *) &gf, |
148 *nap, | 155 *nap, |
149 NACL_ABI_CHECK_OPTION_CHECK)) { | 156 NACL_ABI_CHECK_OPTION_CHECK)) { |
150 goto done; | 157 goto done; |
151 } | 158 } |
152 /* | 159 /* |
153 * Close the memory pseudo-file used for passing in the .nexe. | 160 * Close the memory pseudo-file used for passing in the .nexe. |
154 */ | 161 */ |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 437 } |
431 | 438 |
432 /* | 439 /* |
433 * Part of the initialization of a worker. Sends the descriptor to the | 440 * Part of the initialization of a worker. Sends the descriptor to the |
434 * worker library to indicate where to send postMessage RPCs. | 441 * worker library to indicate where to send postMessage RPCs. |
435 */ | 442 */ |
436 int NaClSrpcSendUpcallDesc(struct NaClSrpcChannel *channel, | 443 int NaClSrpcSendUpcallDesc(struct NaClSrpcChannel *channel, |
437 struct NaClDesc *nacl_desc) { | 444 struct NaClDesc *nacl_desc) { |
438 return NaClSrpcInvokeBySignature(channel, "setUpcallDesc:h:", nacl_desc); | 445 return NaClSrpcInvokeBySignature(channel, "setUpcallDesc:h:", nacl_desc); |
439 } | 446 } |
OLD | NEW |