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

Unified Diff: mojo/nacl/generator/mojo_syscall.cc.tmpl

Issue 782693004: Update mojo sdk to rev f6c8ec07c01deebc13178d516225fd12695c3dc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hack mojo_system_impl gypi for android :| Created 6 years 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: mojo/nacl/generator/mojo_syscall.cc.tmpl
diff --git a/mojo/nacl/generator/mojo_syscall.cc.tmpl b/mojo/nacl/generator/mojo_syscall.cc.tmpl
index 136e672311fbcc41f993e80ec3a16c1b90b51608..8ba76656a8ec64d289c33290544749a8af8f42cb 100644
--- a/mojo/nacl/generator/mojo_syscall.cc.tmpl
+++ b/mojo/nacl/generator/mojo_syscall.cc.tmpl
@@ -57,10 +57,42 @@ struct NaClDesc* MakeMojoDesc(struct NaClApp* nap) {
return NaClDescMakeCustomDesc(nap, &funcs);
}
+void MojoDisabledDescDestroy(void* handle) {
+}
+
+ssize_t MojoDisabledDescSendMsg(void* handle,
+ const struct NaClImcTypedMsgHdr* msg,
+ int flags) {
+ fprintf(stderr, "Mojo is not currently supported.");
+ abort();
+}
+
+ssize_t MojoDisabledDescRecvMsg(void* handle,
+ struct NaClImcTypedMsgHdr* msg,
+ int flags) {
+ fprintf(stderr, "Mojo is not currently supported.");
+ abort();
+}
+
+struct NaClDesc* MakeDisabledMojoDesc(struct NaClApp* nap) {
+ struct NaClDescCustomFuncs funcs = NACL_DESC_CUSTOM_FUNCS_INITIALIZER;
+ funcs.Destroy = MojoDisabledDescDestroy;
+ funcs.SendMsg = MojoDisabledDescSendMsg;
+ funcs.RecvMsg = MojoDisabledDescRecvMsg;
+ return NaClDescMakeCustomDesc(nap, &funcs);
+}
+
} // namespace
-#define NACL_MOJO_DESC (NACL_CHROME_DESC_BASE + 2)
+// The value for this FD must not conflict with uses inside Chromium. However,
+// mojo/nacl doesn't depend on any Chromium headers, so we can't use a #define
+// from there.
+#define NACL_MOJO_DESC (NACL_CHROME_DESC_BASE + 3)
void InjectMojo(struct NaClApp* nap) {
NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeMojoDesc(nap));
}
+
+void InjectDisabledMojo(struct NaClApp* nap) {
+ NaClAppSetDesc(nap, NACL_MOJO_DESC, MakeDisabledMojoDesc(nap));
+}

Powered by Google App Engine
This is Rietveld 408576698