OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <unistd.h> | 5 #include <unistd.h> |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "native_client/src/public/irt_core.h" | 8 #include "native_client/src/public/irt_core.h" |
9 #include "native_client/src/trusted/service_runtime/include/sys/unistd.h" | 9 #include "native_client/src/trusted/service_runtime/include/sys/unistd.h" |
10 #include "native_client/src/untrusted/irt/irt.h" | 10 #include "native_client/src/untrusted/irt/irt.h" |
11 #include "native_client/src/untrusted/irt/irt_private.h" | |
12 #include "ppapi/nacl_irt/irt_manifest.h" | 11 #include "ppapi/nacl_irt/irt_manifest.h" |
13 #include "ppapi/nacl_irt/irt_ppapi.h" | 12 #include "ppapi/nacl_irt/irt_ppapi.h" |
14 #include "ppapi/nacl_irt/plugin_main.h" | 13 #include "ppapi/nacl_irt/plugin_main.h" |
15 #include "ppapi/nacl_irt/public/irt_ppapi.h" | 14 #include "ppapi/nacl_irt/public/irt_ppapi.h" |
16 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h" | 15 #include "ppapi/native_client/src/untrusted/pnacl_irt_shim/irt_shim_ppapi.h" |
17 | 16 |
18 static struct PP_StartFunctions g_pp_functions; | 17 static struct PP_StartFunctions g_pp_functions; |
19 | 18 |
20 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { | 19 int irt_ppapi_start(const struct PP_StartFunctions* funcs) { |
21 #if !defined(OS_NACL_NONSFI) | |
22 // Disable NaCl's open_resource() interface on this thread. | |
23 // TODO(hidehiko): This flag is no longer used because, even in SFI mode, | |
24 // we switched from SRPC to Chrome IPC for open_resource() implementation. | |
25 // Remove this flag. | |
26 g_is_main_thread = 1; | |
27 #endif | |
28 | |
29 g_pp_functions = *funcs; | 20 g_pp_functions = *funcs; |
30 return PpapiPluginMain(); | 21 return PpapiPluginMain(); |
31 } | 22 } |
32 | 23 |
33 int32_t PPP_InitializeModule(PP_Module module_id, | 24 int32_t PPP_InitializeModule(PP_Module module_id, |
34 PPB_GetInterface get_browser_interface) { | 25 PPB_GetInterface get_browser_interface) { |
35 return g_pp_functions.PPP_InitializeModule(module_id, get_browser_interface); | 26 return g_pp_functions.PPP_InitializeModule(module_id, get_browser_interface); |
36 } | 27 } |
37 | 28 |
38 void PPP_ShutdownModule(void) { | 29 void PPP_ShutdownModule(void) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void* table, size_t tablesize) { | 85 void* table, size_t tablesize) { |
95 size_t result = nacl_irt_query_list(interface_ident, | 86 size_t result = nacl_irt_query_list(interface_ident, |
96 table, | 87 table, |
97 tablesize, | 88 tablesize, |
98 irt_interfaces, | 89 irt_interfaces, |
99 sizeof(irt_interfaces)); | 90 sizeof(irt_interfaces)); |
100 if (result != 0) | 91 if (result != 0) |
101 return result; | 92 return result; |
102 return nacl_irt_query_core(interface_ident, table, tablesize); | 93 return nacl_irt_query_core(interface_ident, table, tablesize); |
103 } | 94 } |
OLD | NEW |