Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: nacl_bindings_generator/mojo_syscall.cc.tmpl

Issue 1052723003: NaCl: create a separate namespace for Mojo handles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698