OLD | NEW |
(Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From dev/ppb_arraybuffer.idl modified Tue Nov 8 14:56:24 2011. */ |
| 7 |
| 8 #ifndef PPAPI_C_DEV_PPB_ARRAYBUFFER_H_ |
| 9 #define PPAPI_C_DEV_PPB_ARRAYBUFFER_H_ |
| 10 |
| 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_module.h" |
| 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_var.h" |
| 16 |
| 17 #define PPB_ARRAYBUFFER_DEV_INTERFACE_0_1 "PPB_ArrayBuffer(Dev);0.1" |
| 18 #define PPB_ARRAYBUFFER_DEV_INTERFACE PPB_ARRAYBUFFER_DEV_INTERFACE_0_1 |
| 19 |
| 20 /** |
| 21 * @file |
| 22 * This file defines the <code>PPB_ArrayBuffer_Dev</code> struct. |
| 23 */ |
| 24 |
| 25 |
| 26 /** |
| 27 * @addtogroup Interfaces |
| 28 * @{ |
| 29 */ |
| 30 /** |
| 31 * PPB_ArrayBuffer_Dev API. This provides a way to interact with JavaScript |
| 32 * ArrayBuffers, which are the underlying implementation for TypedArrays. |
| 33 * To manage the reference count for an ArrayBuffer, please see PPB_Var. |
| 34 */ |
| 35 struct PPB_ArrayBuffer_Dev { |
| 36 /** |
| 37 * Create a zero-initialized ArrayBuffer. |
| 38 * |
| 39 * @param[in] module A PP_Module uniquely identifying the module. |
| 40 * @param[in] size_in_bytes The size of the array that will be created. |
| 41 * |
| 42 * @return A PP_Var which represents an ArrayBuffer of the requested size with |
| 43 * a reference count of 1. |
| 44 */ |
| 45 struct PP_Var (*Create)(PP_Module module, uint32_t size_in_bytes); |
| 46 /** |
| 47 * Returns the length of the ArrayBuffer in bytes. |
| 48 * |
| 49 * @return The length of the ArrayBuffer in bytes. |
| 50 */ |
| 51 uint32_t (*ByteLength)(struct PP_Var array); |
| 52 /** |
| 53 * Returns a pointer to the beginning of the buffer for the given array. |
| 54 * |
| 55 * @param[in] array The array whose buffer should be returned. |
| 56 * |
| 57 * @return A pointer to the buffer for this array. |
| 58 */ |
| 59 void* (*GetBuffer)(struct PP_Var array); |
| 60 }; |
| 61 /** |
| 62 * @} |
| 63 */ |
| 64 |
| 65 #endif /* PPAPI_C_DEV_PPB_ARRAYBUFFER_H_ */ |
| 66 |
OLD | NEW |