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 /* | 7 #ifndef PPAPI_NACL_IRT_IRT_PPAPI_H_ |
8 * TODO(mseaborn): Change this to match the filename when NaCl's copy | 8 #define PPAPI_NACL_IRT_IRT_PPAPI_H_ |
9 * of irt_ppapi.h is removed. For now it is needed to avoid a | |
10 * duplicate definition. | |
11 */ | |
12 #ifndef NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ | |
13 #define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ 1 | |
14 | 9 |
15 #include <stddef.h> | 10 #include <stddef.h> |
16 | 11 |
17 #include "ppapi/c/ppp.h" | 12 #include "ppapi/c/ppp.h" |
18 | 13 |
19 struct PP_StartFunctions { | 14 struct PP_StartFunctions { |
20 int32_t (*PPP_InitializeModule)(PP_Module module_id, | 15 int32_t (*PPP_InitializeModule)(PP_Module module_id, |
21 PPB_GetInterface get_browser_interface); | 16 PPB_GetInterface get_browser_interface); |
22 void (*PPP_ShutdownModule)(); | 17 void (*PPP_ShutdownModule)(); |
23 const void* (*PPP_GetInterface)(const char* interface_name); | 18 const void* (*PPP_GetInterface)(const char* interface_name); |
24 }; | 19 }; |
25 | 20 |
26 struct PP_ThreadFunctions { | 21 struct PP_ThreadFunctions { |
27 /* | 22 /* |
28 * This is a cut-down version of pthread_create()/pthread_join(). | 23 * This is a cut-down version of pthread_create()/pthread_join(). |
29 * We omit thread creation attributes and the thread's return value. | 24 * We omit thread creation attributes and the thread's return value. |
30 * | 25 * |
31 * We use uintptr_t as the thread ID type because pthread_t is not | 26 * We use uintptr_t as the thread ID type because pthread_t is not |
32 * part of the stable ABI; a user thread library might choose an | 27 * part of the stable ABI; a user thread library might choose an |
33 * arbitrary size for its own pthread_t. | 28 * arbitrary size for its own pthread_t. |
34 */ | 29 */ |
35 int (*thread_create)(uintptr_t* tid, | 30 int (*thread_create)(uintptr_t* tid, |
36 void (*func)(void* thread_argument), | 31 void (*func)(void* thread_argument), |
37 void* thread_argument); | 32 void* thread_argument); |
38 int (*thread_join)(uintptr_t tid); | 33 int (*thread_join)(uintptr_t tid); |
39 }; | 34 }; |
40 | 35 |
| 36 /* |
| 37 * TODO(mseaborn): Make this unconditional after the definition of the |
| 38 * struct has been removed from the NaCl side's irt.h. |
| 39 */ |
| 40 #if !defined(NACL_IRT_PPAPIHOOK_v0_1) |
| 41 |
| 42 #define NACL_IRT_PPAPIHOOK_v0_1 "nacl-irt-ppapihook-0.1" |
| 43 struct nacl_irt_ppapihook { |
| 44 int (*ppapi_start)(const struct PP_StartFunctions*); |
| 45 void (*ppapi_register_thread_creator)(const struct PP_ThreadFunctions*); |
| 46 }; |
| 47 |
41 #endif | 48 #endif |
| 49 |
| 50 #endif |
OLD | NEW |