OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 | 5 |
6 /* From pp_array_output.idl modified Thu Mar 28 11:07:53 2013. */ | 6 /* From pp_array_output.idl modified Tue Oct 22 15:09:25 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PP_ARRAY_OUTPUT_H_ | 8 #ifndef PPAPI_C_PP_ARRAY_OUTPUT_H_ |
9 #define PPAPI_C_PP_ARRAY_OUTPUT_H_ | 9 #define PPAPI_C_PP_ARRAY_OUTPUT_H_ |
10 | 10 |
11 #include "ppapi/c/pp_macros.h" | 11 #include "ppapi/c/pp_macros.h" |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 | 13 |
14 /** | 14 /** |
15 * @file | 15 * @file |
16 * PP_ArrayOutput_GetDataBuffer is a callback function to allocate plugin | 16 * PP_ArrayOutput_GetDataBuffer is a callback function to allocate plugin |
(...skipping 19 matching lines...) Expand all Loading... |
36 * @param user_data The pointer provided in the PP_ArrayOutput structure. This | 36 * @param user_data The pointer provided in the PP_ArrayOutput structure. This |
37 * has no meaning to the browser, it is intended to be used by the | 37 * has no meaning to the browser, it is intended to be used by the |
38 * implementation to figure out where to put the data. | 38 * implementation to figure out where to put the data. |
39 * | 39 * |
40 * @param element_count The number of elements in the array. This will be 0 | 40 * @param element_count The number of elements in the array. This will be 0 |
41 * if there is no data to return. | 41 * if there is no data to return. |
42 * | 42 * |
43 * @param element_size The size of each element in bytes. | 43 * @param element_size The size of each element in bytes. |
44 * | 44 * |
45 * @return Returns a pointer to the allocated memory. On failure, returns null. | 45 * @return Returns a pointer to the allocated memory. On failure, returns null. |
46 * You can also return null if the element_count is 0. | 46 * You can also return null if the element_count is 0. When a non-null value is |
| 47 * returned, the buffer must remain valid until after the callback runs. If used |
| 48 * with a blocking callback, the buffer must remain valid until after the |
| 49 * function returns. The plugin can then free any memory that it allocated. |
47 */ | 50 */ |
48 | 51 |
49 | 52 |
50 /** | 53 /** |
51 * @addtogroup Typedefs | 54 * @addtogroup Typedefs |
52 * @{ | 55 * @{ |
53 */ | 56 */ |
54 typedef void* (*PP_ArrayOutput_GetDataBuffer)(void* user_data, | 57 typedef void* (*PP_ArrayOutput_GetDataBuffer)(void* user_data, |
55 uint32_t element_count, | 58 uint32_t element_count, |
56 uint32_t element_size); | 59 uint32_t element_size); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 * } | 95 * } |
93 * void MyFunction() { | 96 * void MyFunction() { |
94 * MyArrayOutput array = { NULL, 0 }; | 97 * MyArrayOutput array = { NULL, 0 }; |
95 * PP_ArrayOutput output = { &MyGetDataBuffer, &array }; | 98 * PP_ArrayOutput output = { &MyGetDataBuffer, &array }; |
96 * ppb_foo->GetData(&output); | 99 * ppb_foo->GetData(&output); |
97 * } | 100 * } |
98 * @endcode | 101 * @endcode |
99 */ | 102 */ |
100 struct PP_ArrayOutput { | 103 struct PP_ArrayOutput { |
101 /** | 104 /** |
102 * A pointer to the allocation function that the browser implements. | 105 * A pointer to the allocation function that the browser will call. |
103 */ | 106 */ |
104 PP_ArrayOutput_GetDataBuffer GetDataBuffer; | 107 PP_ArrayOutput_GetDataBuffer GetDataBuffer; |
105 /** | 108 /** |
106 * Data that is passed to the allocation function. Typically, this is used | 109 * Data that is passed to the allocation function. Typically, this is used |
107 * to communicate how the data should be stored. | 110 * to communicate how the data should be stored. |
108 */ | 111 */ |
109 void* user_data; | 112 void* user_data; |
110 }; | 113 }; |
111 /** | 114 /** |
112 * @} | 115 * @} |
113 */ | 116 */ |
114 | 117 |
115 #endif /* PPAPI_C_PP_ARRAY_OUTPUT_H_ */ | 118 #endif /* PPAPI_C_PP_ARRAY_OUTPUT_H_ */ |
116 | 119 |
OLD | NEW |