OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 #ifndef PPAPI_C_PPB_CORE_H_ | 5 #ifndef PPAPI_C_PPB_CORE_H_ |
6 #define PPAPI_C_PPB_CORE_H_ | 6 #define PPAPI_C_PPB_CORE_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
11 #include "ppapi/c/pp_time.h" | 11 #include "ppapi/c/pp_time.h" |
12 | 12 |
13 struct PP_CompletionCallback; | 13 struct PP_CompletionCallback; |
14 | 14 |
15 #define PPB_CORE_INTERFACE_0_5 "PPB_Core;0.5" | 15 #define PPB_CORE_INTERFACE_1_0 "PPB_Core;1.0" |
16 #define PPB_CORE_INTERFACE PPB_CORE_INTERFACE_0_5 | 16 #define PPB_CORE_INTERFACE PPB_CORE_INTERFACE_1_0 |
17 | 17 |
18 /** | 18 /** |
19 * @file | 19 * @file |
20 * This file defines the <code>PPB_Core</code> interface defined by the browser | 20 * This file defines the <code>PPB_Core</code> interface defined by the browser |
21 * and containing pointers to functions related to memory management, time, and | 21 * and containing pointers to functions related to memory management, time, and |
22 * threads. | 22 * threads. |
23 */ | 23 */ |
24 | 24 |
25 /** | 25 /** |
26 * @addtogroup Interfaces | 26 * @addtogroup Interfaces |
(...skipping 15 matching lines...) Expand all Loading... |
42 void (*AddRefResource)(PP_Resource resource); | 42 void (*AddRefResource)(PP_Resource resource); |
43 | 43 |
44 /** | 44 /** |
45 * ReleaseResource() removes a reference from a resource. | 45 * ReleaseResource() removes a reference from a resource. |
46 * | 46 * |
47 * @param[in] config A <code>PP_Resource</code> containing the resource. | 47 * @param[in] config A <code>PP_Resource</code> containing the resource. |
48 */ | 48 */ |
49 void (*ReleaseResource)(PP_Resource resource); | 49 void (*ReleaseResource)(PP_Resource resource); |
50 | 50 |
51 /** | 51 /** |
52 * MemAlloc() allocates memory. | |
53 * | |
54 * @param[in] num_bytes A number of bytes to allocate. | |
55 * | |
56 * @return A pointer to the memory if successful, <code>NULL</code> If the | |
57 * allocation fails. | |
58 */ | |
59 void* (*MemAlloc)(uint32_t num_bytes); | |
60 | |
61 /** | |
62 * <code>MemFree()</code> deallocates memory. | |
63 * | |
64 * @param[in] ptr A pointer to the memory to deallocate. It is safe to | |
65 * pass <code>NULL</code> to this function. | |
66 */ | |
67 void (*MemFree)(void* ptr); | |
68 | |
69 /** | |
70 * GetTime() returns the "wall clock time" according to the | 52 * GetTime() returns the "wall clock time" according to the |
71 * browser. | 53 * browser. |
72 * | 54 * |
73 * @return A <code>PP_Time</code> containing the "wall clock time" according | 55 * @return A <code>PP_Time</code> containing the "wall clock time" according |
74 * to the browser. | 56 * to the browser. |
75 */ | 57 */ |
76 PP_Time (*GetTime)(); | 58 PP_Time (*GetTime)(); |
77 | 59 |
78 /** | 60 /** |
79 * GetTimeTicks() returns the "tick time" according to the browser. | 61 * GetTimeTicks() returns the "tick time" according to the browser. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 * current thread is the main pepper thread, otherwise <code>PP_FALSE</code>. | 112 * current thread is the main pepper thread, otherwise <code>PP_FALSE</code>. |
131 */ | 113 */ |
132 PP_Bool (*IsMainThread)(); | 114 PP_Bool (*IsMainThread)(); |
133 }; | 115 }; |
134 /** | 116 /** |
135 * @} | 117 * @} |
136 */ | 118 */ |
137 | 119 |
138 | 120 |
139 #endif /* PPAPI_C_PPB_CORE_H_ */ | 121 #endif /* PPAPI_C_PPB_CORE_H_ */ |
OLD | NEW |