Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: ppapi/c/dev/ppb_var_array_buffer_dev.h

Issue 8502030: Draft of a PPAPI interface for ArrayBuffer and typed arrays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cut back down to just the API for review. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_var_array_buffer_dev.idl modified Fri Dec 2 11:27:11 2011. */
7
8 #ifndef PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_
9 #define PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_stdint.h"
15 #include "ppapi/c/pp_var.h"
16
17 #define PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE_0_1 "PPB_VarArrayBuffer(Dev);0.1"
18 #define PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE \
19 PPB_VAR_ARRAY_BUFFER_DEV_INTERFACE_0_1
20
21 /**
22 * @file
23 * This file defines the <code>PPB_VarArrayBuffer_Dev</code> struct.
24 */
25
26
27 /**
28 * @addtogroup Interfaces
29 * @{
30 */
31 /**
32 * PPB_VarArrayBuffer_Dev API. This provides a way to interact with JavaScript
33 * ArrayBuffers, which represent a contiguous sequence of bytes. To manage the
34 * reference count for a VarArrayBuffer, please see PPB_Var. Note that
35 * these Vars are not part of the embedding page's DOM, and can only be shared
36 * with JavaScript via pp::Instance's PostMessage and HandleMessage functions.
37 */
38 struct PPB_VarArrayBuffer_Dev {
39 /**
40 * Create a zero-initialized VarArrayBuffer.
41 *
42 * @param[in] instance A PP_Instance uniquely identifying the instance.
43 * @param[in] size_in_bytes The size of the array buffer that will be created.
44 *
45 * @return A PP_Var which represents an VarArrayBuffer of the requested size
46 * with a reference count of 1.
47 */
48 struct PP_Var (*Create)(PP_Instance instance, uint32_t size_in_bytes);
49 /**
50 * Returns the length of the VarArrayBuffer in bytes.
51 *
52 * @return The length of the VarArrayBuffer in bytes.
53 */
54 uint32_t (*ByteLength)(struct PP_Var array);
55 /**
56 * Returns a pointer to the beginning of the buffer for the given array.
57 *
58 * @param[in] array The array whose buffer should be returned.
59 *
60 * @return A pointer to the buffer for this array.
61 */
62 void* (*Map)(struct PP_Var array);
63 };
64 /**
65 * @}
66 */
67
68 #endif /* PPAPI_C_DEV_PPB_VAR_ARRAY_BUFFER_DEV_H_ */
69
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698