OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/public/irt_core.h" | 7 #include "native_client/src/public/irt_core.h" |
8 #include "native_client/src/untrusted/irt/irt.h" | 8 #include "native_client/src/untrusted/irt/irt.h" |
9 #include "native_client/src/untrusted/irt/irt_private.h" | 9 #include "native_client/src/untrusted/irt/irt_private.h" |
10 #include "ppapi/nacl_irt/irt_ppapi.h" | 10 #include "ppapi/nacl_irt/irt_ppapi.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 void PPP_ShutdownModule(void) { | 28 void PPP_ShutdownModule(void) { |
29 g_pp_functions.PPP_ShutdownModule(); | 29 g_pp_functions.PPP_ShutdownModule(); |
30 } | 30 } |
31 | 31 |
32 const void* PPP_GetInterface(const char* interface_name) { | 32 const void* PPP_GetInterface(const char* interface_name) { |
33 return g_pp_functions.PPP_GetInterface(interface_name); | 33 return g_pp_functions.PPP_GetInterface(interface_name); |
34 } | 34 } |
35 | 35 |
36 /* | 36 static const struct nacl_irt_ppapihook nacl_irt_ppapihook = { |
37 * TODO(mseaborn): This can be made static when the NaCl side no | |
38 * longer refers to it. | |
39 */ | |
40 const struct nacl_irt_ppapihook nacl_irt_ppapihook = { | |
41 irt_ppapi_start, | 37 irt_ppapi_start, |
42 PpapiPluginRegisterThreadCreator, | 38 PpapiPluginRegisterThreadCreator, |
43 }; | 39 }; |
44 | 40 |
45 static const struct nacl_irt_interface irt_interfaces[] = { | 41 static const struct nacl_irt_interface irt_interfaces[] = { |
46 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook), | 42 { NACL_IRT_PPAPIHOOK_v0_1, &nacl_irt_ppapihook, sizeof(nacl_irt_ppapihook), |
47 NULL }, | 43 NULL }, |
48 }; | 44 }; |
49 | 45 |
50 static size_t chrome_irt_query(const char* interface_ident, | 46 static size_t chrome_irt_query(const char* interface_ident, |
51 void* table, size_t tablesize) { | 47 void* table, size_t tablesize) { |
52 size_t result = nacl_irt_query_core(interface_ident, table, tablesize); | 48 size_t result = nacl_irt_query_core(interface_ident, table, tablesize); |
53 if (result != 0) | 49 if (result != 0) |
54 return result; | 50 return result; |
55 return nacl_irt_query_list(interface_ident, table, tablesize, | 51 return nacl_irt_query_list(interface_ident, table, tablesize, |
56 irt_interfaces, sizeof(irt_interfaces)); | 52 irt_interfaces, sizeof(irt_interfaces)); |
57 } | 53 } |
58 | 54 |
59 void nacl_irt_start(uint32_t* info) { | 55 void nacl_irt_start(uint32_t* info) { |
60 nacl_irt_init(info); | 56 nacl_irt_init(info); |
61 nacl_irt_enter_user_code(info, chrome_irt_query); | 57 nacl_irt_enter_user_code(info, chrome_irt_query); |
62 } | 58 } |
OLD | NEW |