OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <iostream> | 5 #include <iostream> |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "mojo/edk/embedder/embedder.h" | 10 #include "mojo/edk/embedder/embedder.h" |
11 #include "mojo/edk/embedder/simple_platform_support.h" | 11 #include "mojo/edk/embedder/simple_platform_support.h" |
12 #include "mojo/nacl/monacl_sel_main.h" | 12 #include "nacl_bindings/monacl_sel_main.h" |
13 #include "native_client/src/public/nacl_desc.h" | 13 #include "native_client/src/public/nacl_desc.h" |
14 | 14 |
15 NaClDesc* OpenFile(const char* filename) { | 15 NaClDesc* OpenFile(const char* filename) { |
16 base::FilePath path(filename); | 16 base::FilePath path(filename); |
17 base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); | 17 base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); |
18 if (!file.IsValid()) { | 18 if (!file.IsValid()) { |
19 perror(filename); | 19 perror(filename); |
20 exit(1); | 20 exit(1); |
21 } | 21 } |
22 return NaClDescCreateWithFilePathMetadata(file.TakePlatformFile(), ""); | 22 return NaClDescCreateWithFilePathMetadata(file.TakePlatformFile(), ""); |
(...skipping 16 matching lines...) Expand all Loading... |
39 new mojo::embedder::SimplePlatformSupport())); | 39 new mojo::embedder::SimplePlatformSupport())); |
40 | 40 |
41 int exit_code = mojo::LaunchNaCl(nexe_desc, irt_desc, argc - 2, argv + 2, | 41 int exit_code = mojo::LaunchNaCl(nexe_desc, irt_desc, argc - 2, argv + 2, |
42 MOJO_HANDLE_INVALID); | 42 MOJO_HANDLE_INVALID); |
43 | 43 |
44 // Exits the process cleanly, does not return. | 44 // Exits the process cleanly, does not return. |
45 mojo::NaClExit(exit_code); | 45 mojo::NaClExit(exit_code); |
46 NOTREACHED(); | 46 NOTREACHED(); |
47 return 1; | 47 return 1; |
48 } | 48 } |
OLD | NEW |