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
3 * found in the LICENSE file.
6 /* From dev/ppb_buffer_dev.idl modified Wed Oct 5 14:06:02 2011. */
8 #ifndef PPAPI_C_DEV_PPB_BUFFER_DEV_H_
9 #define PPAPI_C_DEV_PPB_BUFFER_DEV_H_
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_resource.h"
15 #include "ppapi/c/pp_stdint.h"
17 #define PPB_BUFFER_DEV_INTERFACE_0_4 "PPB_Buffer(Dev);0.4"
18 #define PPB_BUFFER_DEV_INTERFACE PPB_BUFFER_DEV_INTERFACE_0_4
22 * This file defines the <code>PPB_Buffer_Dev</code> interface.
27 * @addtogroup Interfaces
30 struct PPB_Buffer_Dev_0_4
{
32 * Allocates a buffer of the given size in bytes. The return value will have
33 * a non-zero ID on success, or zero on failure. Failure means the module
34 * handle was invalid. The buffer will be initialized to contain zeroes.
36 PP_Resource (*Create
)(PP_Instance instance
, uint32_t size_in_bytes
);
38 * Returns PP_TRUE if the given resource is a Buffer. Returns PP_FALSE if the
39 * resource is invalid or some type other than a Buffer.
41 PP_Bool (*IsBuffer
)(PP_Resource resource
);
43 * Gets the size of the buffer. Returns PP_TRUE on success, PP_FALSE
44 * if the resource is not a buffer. On failure, |*size_in_bytes| is not set.
46 PP_Bool (*Describe
)(PP_Resource resource
, uint32_t* size_in_bytes
);
48 * Maps this buffer into the plugin address space and returns a pointer to
49 * the beginning of the data.
51 void* (*Map
)(PP_Resource resource
);
55 void (*Unmap
)(PP_Resource resource
);
58 typedef struct PPB_Buffer_Dev_0_4 PPB_Buffer_Dev
;
63 #endif /* PPAPI_C_DEV_PPB_BUFFER_DEV_H_ */