OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "nacl_bindings/monacl_sel_main.h" |
| 6 |
| 7 #include "nacl_bindings/mojo_syscall.h" |
| 8 #include "native_client/src/public/chrome_main.h" |
| 9 #include "native_client/src/public/nacl_app.h" |
| 10 |
| 11 namespace mojo { |
| 12 |
| 13 int LaunchNaCl(NaClDesc* nexe_desc, |
| 14 NaClDesc* irt_desc, |
| 15 int app_argc, |
| 16 char* app_argv[], |
| 17 MojoHandle handle) { |
| 18 NaClChromeMainInit(); |
| 19 |
| 20 struct NaClChromeMainArgs* args = NaClChromeMainArgsCreate(); |
| 21 args->nexe_desc = nexe_desc; |
| 22 args->irt_desc = irt_desc; |
| 23 |
| 24 args->argc = app_argc; |
| 25 args->argv = app_argv; |
| 26 |
| 27 struct NaClApp* nap = NaClAppCreate(); |
| 28 InjectMojo(nap, handle); |
| 29 |
| 30 int exit_status = 1; |
| 31 NaClChromeMainStart(nap, args, &exit_status); |
| 32 return exit_status; |
| 33 } |
| 34 |
| 35 void NaClExit(int code) { |
| 36 ::NaClExit(code); |
| 37 } |
| 38 |
| 39 } // namespace mojo |
OLD | NEW |