Chromium Code Reviews| Index: ppapi/proxy/irt_ppapi.c |
| diff --git a/ppapi/proxy/irt_ppapi.c b/ppapi/proxy/irt_ppapi.c |
| index 24dafdb077d605527c48074c5b599e273d27c30f..9a17a842e663fa024278dbbfc52bced9265fdd87 100644 |
| --- a/ppapi/proxy/irt_ppapi.c |
| +++ b/ppapi/proxy/irt_ppapi.c |
| @@ -5,14 +5,16 @@ |
| */ |
| #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" |
| #include "native_client/src/untrusted/irt/irt_private.h" |
| #include "ppapi/nacl_irt/irt_ppapi.h" |
| #include "ppapi/proxy/plugin_main_irt.h" |
| +#include "ppapi/proxy/irt_shim_ppapi.h" |
| -struct PP_StartFunctions g_pp_functions; |
| +static struct PP_StartFunctions g_pp_functions; |
| -static int irt_ppapi_start(const struct PP_StartFunctions* funcs) { |
| +int irt_ppapi_start(const struct PP_StartFunctions* funcs) { |
| /* Disable NaCl's open_resource() interface on this thread. */ |
| g_is_main_thread = 1; |
| @@ -38,9 +40,22 @@ static const struct nacl_irt_ppapihook nacl_irt_ppapihook = { |
| PpapiPluginRegisterThreadCreator, |
| }; |
| +static int ppapihook_pnacl_private_filter(void) { |
| + static int ppapihook_pnacl_private_enabled = -1; |
|
Mark Seaborn
2014/02/26 22:11:03
Since this will only be called once, you can leave
jvoung (off chromium)
2014/02/27 01:39:55
True it'll only be called on startup -- done.
|
| + if (-1 == ppapihook_pnacl_private_enabled) { |
| + ppapihook_pnacl_private_enabled = sysconf(NACL_ABI__SC_NACL_PNACL_MODE); |
| + if (ppapihook_pnacl_private_enabled == -1) |
| + ppapihook_pnacl_private_enabled = 0; |
| + } |
| + return ppapihook_pnacl_private_enabled; |
|
Mark Seaborn
2014/02/26 22:11:03
Since this isn't thread safe, this could end up re
jvoung (off chromium)
2014/02/27 01:39:55
Changed to not use the static int.
|
| +} |
| + |
| static const struct nacl_irt_interface irt_interfaces[] = { |
| { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook), |
| NULL }, |
| + { NACL_IRT_PPAPIHOOK_PNACL_PRIVATE_v0_1, |
| + &nacl_irt_ppapihook_pnacl_private, sizeof(nacl_irt_ppapihook_pnacl_private), |
| + ppapihook_pnacl_private_filter }, |
| }; |
| static size_t chrome_irt_query(const char* interface_ident, |