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

Unified Diff: services/nacl/content_handler_main_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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/nacl/content_handler_main_nonsfi.cc
diff --git a/services/nacl/content_handler_main_nonsfi.cc b/services/nacl/content_handler_main_nonsfi.cc
index 62a907d109070cb90133603b652c8022aa94a324..9c9a9b96c5b468ac6ed981b91eb7e006f4d325b5 100644
--- a/services/nacl/content_handler_main_nonsfi.cc
+++ b/services/nacl/content_handler_main_nonsfi.cc
@@ -9,11 +9,9 @@
#include "mojo/application/content_handler_factory.h"
#include "mojo/data_pipe_utils/data_pipe_utils.h"
#include "mojo/message_pump/message_pump_mojo.h"
-#include "mojo/nacl/irt_mojo_nonsfi.h"
+#include "mojo/nacl/nexe_launcher_nonsfi.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_impl.h"
-#include "native_client/src/public/irt_core.h"
-#include "native_client/src/public/nonsfi/elf_loader.h"
namespace nacl {
namespace content_handler {
@@ -59,19 +57,10 @@ class NaClContentHandler : public mojo::ApplicationDelegate,
LOG(FATAL) << "Failed to close temp file";
}
- // Run -- also, closes the fd, removing the temp file.
- uintptr_t entry = NaClLoadElfFile(fd);
-
- MojoSetInitialHandle(
- application_request.PassMessagePipe().release().value());
- 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();
+ MojoHandle handle =
+ application_request.PassMessagePipe().release().value();
+ // MojoLaunchNexeNonsfi takes ownership of the fd.
+ MojoLaunchNexeNonsfi(fd, handle);
}
mojo::ContentHandlerFactory content_handler_factory_;
« no previous file with comments | « mojo/nacl/nexe_launcher_nonsfi.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698