Index: ppapi/nacl_irt/irt_ppapi.cc |
diff --git a/ppapi/nacl_irt/irt_ppapi.cc b/ppapi/nacl_irt/irt_ppapi.cc |
index b56fc8c76660b8076b53993b4cc625997002cd65..916c9e9b31b353ab8ddd8940440a4d20ee6d52ca 100644 |
--- a/ppapi/nacl_irt/irt_ppapi.cc |
+++ b/ppapi/nacl_irt/irt_ppapi.cc |
@@ -4,6 +4,7 @@ |
#include <unistd.h> |
+#include "build/build_config.h" |
#include "native_client/src/public/irt_core.h" |
#include "native_client/src/trusted/service_runtime/include/sys/unistd.h" |
#include "native_client/src/untrusted/irt/irt.h" |
@@ -17,8 +18,10 @@ |
static struct PP_StartFunctions g_pp_functions; |
int irt_ppapi_start(const struct PP_StartFunctions* funcs) { |
+#if !defined(OS_NACL_NONSFI) |
Mark Seaborn
2014/10/28 21:57:23
If you're going to add a conditional, please add a
|
// Disable NaCl's open_resource() interface on this thread. |
g_is_main_thread = 1; |
hidehiko
2014/10/28 20:14:00
FYI: Is this flag still needed? IIUC, this is no l
Mark Seaborn
2014/10/28 21:57:23
Yeah, it is no longer checked by open_resource() s
hidehiko
2014/10/29 06:00:14
Ok. +1 for adding the test. Let me look into it la
|
+#endif |
g_pp_functions = *funcs; |
return PpapiPluginMain(); |
@@ -42,12 +45,14 @@ static const struct nacl_irt_ppapihook nacl_irt_ppapihook = { |
PpapiPluginRegisterThreadCreator, |
}; |
+#if defined(OS_NACL_SFI) |
static int ppapihook_pnacl_private_filter(void) { |
int pnacl_mode = sysconf(NACL_ABI__SC_NACL_PNACL_MODE); |
if (pnacl_mode == -1) |
return 0; |
return pnacl_mode; |
} |
+#endif |
static const nacl_irt_resource_open kIrtResourceOpen = { |
ppapi::IrtOpenResource, |
@@ -63,11 +68,19 @@ static int not_pnacl_filter(void) { |
static const struct nacl_irt_interface irt_interfaces[] = { |
{ NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook), |
NULL }, |
+#if defined(OS_NACL_SFI) |
{ NACL_IRT_PPAPIHOOK_PNACL_PRIVATE_v0_1, |
&nacl_irt_ppapihook_pnacl_private, sizeof(nacl_irt_ppapihook_pnacl_private), |
ppapihook_pnacl_private_filter }, |
+#endif |
{ NACL_IRT_RESOURCE_OPEN_v0_1, &kIrtResourceOpen, |
- sizeof(kIrtResourceOpen), not_pnacl_filter }, |
+ sizeof(kIrtResourceOpen), |
+#if defined(OS_NACL_SFI) |
+ not_pnacl_filter, |
+#else |
+ NULL, |
Mark Seaborn
2014/10/28 21:57:23
Maybe add a comment: "If we change PNaCl to use N
hidehiko
2014/10/29 06:00:14
Done.
|
+#endif |
+ }, |
}; |
size_t chrome_irt_query(const char* interface_ident, |