diff options
author | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-19 15:58:08 +0000 |
---|---|---|
committer | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-19 15:58:08 +0000 |
commit | 81216b5e1666b1c72c1db208b9d871a0869c740b (patch) | |
tree | dcf8c0c1de2851c63d272bb09bbc8854b74dc90b /ppapi/c | |
parent | 779dd28c4bf2b8b47ef012c2f76d64e07e8340aa (diff) | |
download | chromium_src-81216b5e1666b1c72c1db208b9d871a0869c740b.zip chromium_src-81216b5e1666b1c72c1db208b9d871a0869c740b.tar.gz chromium_src-81216b5e1666b1c72c1db208b9d871a0869c740b.tar.bz2 |
[PPAPI] Added new Pepper interface PPB_VarResource_Dev.
This interface allows the plugin to create resource vars from PP_Resource, and
also to extract the PP_Resource from a resource var. This facilitates sending
and receiving resources through the JavaScript messaging interface.
Currently only available to plugins with DEV permission.
BUG=177017
Review URL: https://codereview.chromium.org/26464002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_var_resource_dev.h | 60 | ||||
-rw-r--r-- | ppapi/c/pp_macros.h | 4 |
2 files changed, 62 insertions, 2 deletions
diff --git a/ppapi/c/dev/ppb_var_resource_dev.h b/ppapi/c/dev/ppb_var_resource_dev.h new file mode 100644 index 0000000..463f10a --- /dev/null +++ b/ppapi/c/dev/ppb_var_resource_dev.h @@ -0,0 +1,60 @@ +/* Copyright 2013 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From dev/ppb_var_resource_dev.idl modified Fri Oct 11 10:31:47 2013. */ + +#ifndef PPAPI_C_DEV_PPB_VAR_RESOURCE_DEV_H_ +#define PPAPI_C_DEV_PPB_VAR_RESOURCE_DEV_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_resource.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/pp_var.h" + +#define PPB_VAR_RESOURCE_DEV_INTERFACE_0_1 "PPB_VarResource(Dev);0.1" +#define PPB_VAR_RESOURCE_DEV_INTERFACE PPB_VAR_RESOURCE_DEV_INTERFACE_0_1 + +/** + * @file + * This file defines the <code>PPB_VarResource</code> struct providing + * a way to interact with resource vars. + */ + + +/** + * @addtogroup Interfaces + * @{ + */ +struct PPB_VarResource_Dev_0_1 { + /** + * Converts a resource-type var to a <code>PP_Resource</code>. + * + * @param[in] var A <code>PP_Var</code> struct containing a resource-type var. + * + * @return A <code>PP_Resource</code> retrieved from the var, or 0 if the var + * is not a resource. The reference count of the resource is incremented on + * behalf of the caller. + */ + PP_Resource (*VarToResource)(struct PP_Var var); + /** + * Creates a new <code>PP_Var</code> from a given resource. + * + * @param[in] resource A <code>PP_Resource</code> to be wrapped in a var. + * + * @return A <code>PP_Var</code> created for this resource, with type + * <code>PP_VARTYPE_RESOURCE</code>. The reference count of the var is set to + * 1 on behalf of the caller. + */ + struct PP_Var (*VarFromResource)(PP_Resource resource); +}; + +typedef struct PPB_VarResource_Dev_0_1 PPB_VarResource_Dev; +/** + * @} + */ + +#endif /* PPAPI_C_DEV_PPB_VAR_RESOURCE_DEV_H_ */ + diff --git a/ppapi/c/pp_macros.h b/ppapi/c/pp_macros.h index a552885..73d14f0 100644 --- a/ppapi/c/pp_macros.h +++ b/ppapi/c/pp_macros.h @@ -3,13 +3,13 @@ * found in the LICENSE file. */ -/* From pp_macros.idl modified Wed Apr 10 11:57:14 2013. */ +/* From pp_macros.idl modified Tue Oct 8 17:55:09 2013. */ #ifndef PPAPI_C_PP_MACROS_H_ #define PPAPI_C_PP_MACROS_H_ -#define PPAPI_RELEASE 31 +#define PPAPI_RELEASE 32 /** * @file |