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 /** | 6 /** |
7 * PP_ArrayOutput_GetDataBuffer is a callback function to allocate plugin | 7 * PP_ArrayOutput_GetDataBuffer is a callback function to allocate plugin |
8 * memory for an array. It returns the allocated memory or null on failure. | 8 * memory for an array. It returns the allocated memory or null on failure. |
9 * | 9 * |
10 * This function will be called reentrantly. This means that if you call a | 10 * This function will be called reentrantly. This means that if you call a |
(...skipping 25 matching lines...) Expand all Loading... |
36 * @return Returns a pointer to the allocated memory. On failure, returns null. | 36 * @return Returns a pointer to the allocated memory. On failure, returns null. |
37 * You can also return null if the element_count is 0. | 37 * You can also return null if the element_count is 0. |
38 */ | 38 */ |
39 typedef mem_t PP_ArrayOutput_GetDataBuffer([inout] mem_t user_data, | 39 typedef mem_t PP_ArrayOutput_GetDataBuffer([inout] mem_t user_data, |
40 [in] uint32_t element_count, | 40 [in] uint32_t element_count, |
41 [in] uint32_t element_size); | 41 [in] uint32_t element_size); |
42 | 42 |
43 /** | 43 /** |
44 * A structure that defines a way for the browser to return arrays of data | 44 * A structure that defines a way for the browser to return arrays of data |
45 * to the plugin. The browser can not allocate memory on behalf of the plugin | 45 * to the plugin. The browser can not allocate memory on behalf of the plugin |
46 * becaues the plugin and browser may have different allocators. | 46 * because the plugin and browser may have different allocators. |
47 * | 47 * |
48 * Array output works by having the browser call to the plugin to allocate a | 48 * Array output works by having the browser call to the plugin to allocate a |
49 * buffer, and then the browser will copy the contents of the array into that | 49 * buffer, and then the browser will copy the contents of the array into that |
50 * buffer. | 50 * buffer. |
51 * | 51 * |
52 * In C, you would typically implement this as follows: | 52 * In C, you would typically implement this as follows: |
53 * | 53 * |
54 * @code | 54 * @code |
55 * struct MyArrayOutput { | 55 * struct MyArrayOutput { |
56 * void* data; | 56 * void* data; |
(...skipping 24 matching lines...) Expand all Loading... |
81 * A pointer to the allocation function that the browser implements. | 81 * A pointer to the allocation function that the browser implements. |
82 */ | 82 */ |
83 PP_ArrayOutput_GetDataBuffer GetDataBuffer; | 83 PP_ArrayOutput_GetDataBuffer GetDataBuffer; |
84 | 84 |
85 /** | 85 /** |
86 * Data that is passed to the allocation function. Typically, this is used | 86 * Data that is passed to the allocation function. Typically, this is used |
87 * to communicate how the data should be stored. | 87 * to communicate how the data should be stored. |
88 */ | 88 */ |
89 mem_t user_data; | 89 mem_t user_data; |
90 }; | 90 }; |
OLD | NEW |