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

Unified Diff: mojo/nacl/nonsfi/irt_mojo_nonsfi.cc

Issue 1382713002: Creating a pexe content handler to translate and run pexes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Tests Added Created 5 years, 2 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: mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
diff --git a/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc b/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
index a63189b6c6484454d03e133895b772d4e0f67012..6fb27f6b8a59ebefef76c92d80ac6e29385eb64d 100644
--- a/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
+++ b/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
@@ -7,16 +7,12 @@
#include "mojo/public/c/system/functions.h"
#include "mojo/public/platform/nacl/mojo_irt.h"
#include "native_client/src/public/irt_core.h"
+#include "native_client/src/untrusted/irt/irt_dev.h"
namespace {
MojoHandle g_mojo_handle = MOJO_HANDLE_INVALID;
-MojoResult _MojoGetInitialHandle(MojoHandle* handle) {
- *handle = g_mojo_handle;
- return MOJO_RESULT_OK;
-}
-
const struct nacl_irt_mojo kIrtMojo = {
MojoCreateSharedBuffer,
MojoDuplicateBufferHandle,
@@ -36,16 +32,41 @@ const struct nacl_irt_mojo kIrtMojo = {
MojoCreateMessagePipe,
MojoWriteMessage,
MojoReadMessage,
- _MojoGetInitialHandle,
+ nacl::_MojoGetInitialHandle,
};
-const struct nacl_irt_interface kIrtInterfaces[] = {
- {NACL_IRT_MOJO_v0_1, &kIrtMojo, sizeof(kIrtMojo), nullptr}};
+static const struct nacl_irt_interface kIrtInterfaces[] = {
Mark Seaborn 2015/10/20 21:32:40 Nit: 'static' not needed: this is in an anon names
Sean Klein 2015/10/22 21:50:00 Done.
+ /* Interface to call Mojo functions */
Mark Seaborn 2015/10/20 21:32:40 Nit: Use C++-style comments
Sean Klein 2015/10/22 21:50:00 Done.
+ { NACL_IRT_MOJO_v0_1,
+ &kIrtMojo,
+ sizeof(kIrtMojo),
+ nullptr },
+ /* Interface to call PNaCl translation */
+ { NACL_IRT_PRIVATE_PNACL_TRANSLATOR_COMPILE_v0_1,
+ &nacl_irt_private_pnacl_translator_compile,
+ sizeof(nacl_irt_private_pnacl_translator_compile),
+ nullptr },
Mark Seaborn 2015/10/20 22:28:58 Can you conditionalise the 3 new interfaces so tha
Sean Klein 2015/10/22 21:50:00 Done.
+ /* Interface to call PNaCl linking */
+ { NACL_IRT_PRIVATE_PNACL_TRANSLATOR_LINK_v0_1,
+ &nacl_irt_private_pnacl_translator_link,
+ sizeof(nacl_irt_private_pnacl_translator_link),
+ nullptr },
+ /* Adds mechanism for opening object files, like crtbegin.o */
+ { NACL_IRT_RESOURCE_OPEN_v0_1,
+ &nacl_irt_resource_open,
+ sizeof(nacl_irt_resource_open),
+ nullptr },
+};
} // namespace
namespace nacl {
+MojoResult _MojoGetInitialHandle(MojoHandle* handle) {
+ *handle = g_mojo_handle;
+ return MOJO_RESULT_OK;
+}
+
void MojoSetInitialHandle(MojoHandle handle) {
g_mojo_handle = handle;
}

Powered by Google App Engine
This is Rietveld 408576698