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 {{generator_warning}} | 5 {{generator_warning}} |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "mojo/public/c/system/buffer.h" | 9 #include "mojo/public/c/system/buffer.h" |
10 #include "mojo/public/c/system/data_pipe.h" | 10 #include "mojo/public/c/system/data_pipe.h" |
11 #include "mojo/public/c/system/functions.h" | |
12 #include "mojo/public/c/system/handle.h" | 11 #include "mojo/public/c/system/handle.h" |
13 #include "mojo/public/c/system/message_pipe.h" | 12 #include "mojo/public/c/system/message_pipe.h" |
14 #include "mojo/public/c/system/result.h" | 13 #include "mojo/public/c/system/result.h" |
15 #include "mojo/public/c/system/types.h" | 14 #include "mojo/public/c/system/time.h" |
| 15 #include "mojo/public/c/system/wait.h" |
16 #include "{{platform_dir}}/mojo_irt.h" | 16 #include "{{platform_dir}}/mojo_irt.h" |
17 #include "native_client/src/untrusted/irt/irt.h" | 17 #include "native_client/src/untrusted/irt/irt.h" |
18 | 18 |
19 bool g_irt_mojo_valid = false; | 19 bool g_irt_mojo_valid = false; |
20 struct nacl_irt_mojo g_irt_mojo; | 20 struct nacl_irt_mojo g_irt_mojo; |
21 | 21 |
22 struct nacl_irt_mojo* get_irt_mojo() { | 22 struct nacl_irt_mojo* get_irt_mojo() { |
23 if (!g_irt_mojo_valid) { | 23 if (!g_irt_mojo_valid) { |
24 size_t rc = nacl_interface_query(NACL_IRT_MOJO_v0_1, | 24 size_t rc = nacl_interface_query(NACL_IRT_MOJO_v0_1, |
25 &g_irt_mojo, | 25 &g_irt_mojo, |
26 sizeof(g_irt_mojo)); | 26 sizeof(g_irt_mojo)); |
27 if (rc != sizeof(g_irt_mojo)) | 27 if (rc != sizeof(g_irt_mojo)) |
28 return NULL; | 28 return NULL; |
29 else | 29 else |
30 g_irt_mojo_valid = true; | 30 g_irt_mojo_valid = true; |
31 } | 31 } |
32 return &g_irt_mojo; | 32 return &g_irt_mojo; |
33 } | 33 } |
34 | 34 |
35 {{body}} | 35 {{body}} |
OLD | NEW |