Fixes for Android GN build input/outputs
[chromium-blink-merge.git] / third_party / mojo / src / nacl_bindings / monacl_sel_main.cc
blob100f16105bb3f8a6498617319529910ef1788b37
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.
5 #include "nacl_bindings/monacl_sel_main.h"
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"
11 namespace mojo {
13 int LaunchNaCl(NaClDesc* nexe_desc,
14 NaClDesc* irt_desc,
15 int app_argc,
16 char* app_argv[],
17 MojoHandle handle) {
18 NaClChromeMainInit();
20 struct NaClChromeMainArgs* args = NaClChromeMainArgsCreate();
21 args->nexe_desc = nexe_desc;
22 args->irt_desc = irt_desc;
24 args->argc = app_argc;
25 args->argv = app_argv;
27 struct NaClApp* nap = NaClAppCreate();
28 InjectMojo(nap, handle);
30 int exit_status = 1;
31 NaClChromeMainStart(nap, args, &exit_status);
32 return exit_status;
35 void NaClExit(int code) {
36 ::NaClExit(code);
39 } // namespace mojo