Chromium Code Reviews| Index: nacl_bindings_generator/mojo_syscall.cc.tmpl |
| diff --git a/nacl_bindings_generator/mojo_syscall.cc.tmpl b/nacl_bindings_generator/mojo_syscall.cc.tmpl |
| index 4ef183fb91f960b3c3fc48c0d5610d20f2775660..1b1caf3ae2a9e495f56c4193ef1449057d6f5cc8 100644 |
| --- a/nacl_bindings_generator/mojo_syscall.cc.tmpl |
| +++ b/nacl_bindings_generator/mojo_syscall.cc.tmpl |
| @@ -8,13 +8,15 @@ |
| #include <stdio.h> |
| -#include "{{bindings_dir}}/mojo_syscall_internal.h" |
| #include "mojo/public/c/system/core.h" |
| +#include "mojo/public/platform/native/core_system_api.h" |
| +#include "{{bindings_dir}}/mojo_syscall_internal.h" |
| #include "native_client/src/public/chrome_main.h" |
| #include "native_client/src/public/nacl_app.h" |
| #include "native_client/src/trusted/desc/nacl_desc_custom.h" |
| MojoHandle g_mojo_handle = MOJO_HANDLE_INVALID; |
| +MojoCoreHandle g_mojo_core = nullptr; |
| namespace { |
| @@ -96,14 +98,11 @@ struct NaClDesc* MakeDisabledMojoDesc(struct NaClApp* nap) { |
| // from there. |
| #define NACL_MOJO_DESC (NACL_CHROME_DESC_BASE + 3) |
| -void InjectMojo(struct NaClApp* nap) { |
| - NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeMojoDesc(nap)); |
| - g_mojo_handle = MOJO_HANDLE_INVALID; |
| -} |
| - |
| void InjectMojo(struct NaClApp* nap, MojoHandle handle) { |
| NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeMojoDesc(nap)); |
| - g_mojo_handle = handle; |
| + g_mojo_core = MojoCoreCreateCore(); |
| + // TODO handle errors? |
|
viettrungluu
2015/04/01 23:36:19
nit: "TODO(ncbray):"
Nick Bray (chromium)
2015/04/04 00:09:09
Done.
|
| + MojoCoreTransferHandle(MojoCoreGetDefaultCore(), handle, g_mojo_core, &g_mojo_handle); |
|
viettrungluu
2015/04/01 23:36:19
80 cols
Nick Bray (chromium)
2015/04/04 00:09:09
Done.
|
| } |
| void InjectDisabledMojo(struct NaClApp* nap) { |