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

Unified Diff: mojo/nacl/nexe_launcher_nonsfi.cc

Issue 1371413003: Refactored launching of nexes to separate file. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « mojo/nacl/nexe_launcher_nonsfi.h ('k') | services/nacl/content_handler_main_nonsfi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/nacl/nexe_launcher_nonsfi.cc
diff --git a/mojo/nacl/nexe_launcher_nonsfi.cc b/mojo/nacl/nexe_launcher_nonsfi.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c76b0a1059f0df93cd597a9456eed2b52434d69a
--- /dev/null
+++ b/mojo/nacl/nexe_launcher_nonsfi.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/nacl/nexe_launcher_nonsfi.h"
+
+#include "base/files/file_util.h"
+#include "mojo/nacl/irt_mojo_nonsfi.h"
+#include "mojo/public/c/system/types.h"
+#include "native_client/src/public/irt_core.h"
+#include "native_client/src/public/nonsfi/elf_loader.h"
+
+namespace nacl {
+
+void MojoLaunchNexeNonsfi(int nexe_fd, MojoHandle initial_handle) {
+ // Run -- also, closes the nexe_fd, removing the temp file.
+ uintptr_t entry = NaClLoadElfFile(nexe_fd);
+
+ MojoSetInitialHandle(initial_handle);
+ int argc = 1;
+ char* argvp = const_cast<char*>("NaClMain");
+ char* envp = nullptr;
+ nacl_irt_nonsfi_entry(argc, &argvp, &envp,
+ reinterpret_cast<nacl_entry_func_t>(entry),
+ MojoIrtNonsfiQuery);
+ abort();
+ NOTREACHED();
+}
+
+} // namespace nacl
« no previous file with comments | « mojo/nacl/nexe_launcher_nonsfi.h ('k') | services/nacl/content_handler_main_nonsfi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698