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..82d06482a6a9acac419e731bb93c36e4e0e656d2 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/system_impl_private.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; |
+MojoSystemImpl g_mojo_system = nullptr; |
namespace { |
@@ -96,14 +98,12 @@ 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_system = MojoSystemImplCreateImpl(); |
+ // TODO(ncbray): handle errors? |
viettrungluu
2015/04/06 23:21:02
I'd just CHECK (or equivalent -- I don't know what
Nick Bray (chromium)
2015/04/07 23:51:05
Done.
|
+ MojoSystemImplTransferHandle(MojoSystemImplGetDefaultImpl(), handle, g_mojo_system, |
Nick Bray (chromium)
2015/04/06 22:51:00
Line length, I know, will fix in next upload.
|
+ &g_mojo_handle); |
} |
void InjectDisabledMojo(struct NaClApp* nap) { |