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

Unified Diff: ppapi/c/ppb_var.h

Issue 148213016: [PPAPI] Moving pp::VarResource_Dev API into pp::Var (now stable). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/dev/ppb_var_resource_dev.h ('k') | ppapi/cpp/dev/var_resource_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_var.h
diff --git a/ppapi/c/ppb_var.h b/ppapi/c/ppb_var.h
index 523622dbd77b5206f52f7d49842b8c6696dbcb9d..91a65921ae0286e44bb36937e4fe608cdca92457 100644
--- a/ppapi/c/ppb_var.h
+++ b/ppapi/c/ppb_var.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From ppb_var.idl modified Wed Dec 14 18:08:00 2011. */
+/* From ppb_var.idl modified Thu Feb 6 13:48:33 2014. */
#ifndef PPAPI_C_PPB_VAR_H_
#define PPAPI_C_PPB_VAR_H_
@@ -11,12 +11,14 @@
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_module.h"
+#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_var.h"
#define PPB_VAR_INTERFACE_1_0 "PPB_Var;1.0"
#define PPB_VAR_INTERFACE_1_1 "PPB_Var;1.1"
-#define PPB_VAR_INTERFACE PPB_VAR_INTERFACE_1_1
+#define PPB_VAR_INTERFACE_1_2 "PPB_Var;1.2"
+#define PPB_VAR_INTERFACE PPB_VAR_INTERFACE_1_2
/**
* @file
@@ -31,7 +33,7 @@
/**
* PPB_Var API
*/
-struct PPB_Var_1_1 {
+struct PPB_Var_1_2 {
/**
* AddRef() adds a reference to the given var. If this is not a refcounted
* object, this function will do nothing so you can always call it no matter
@@ -93,9 +95,29 @@ struct PPB_Var_1_1 {
* @return A char* encoded in UTF-8.
*/
const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len);
+ /**
+ * 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_Var_1_1 PPB_Var;
+typedef struct PPB_Var_1_2 PPB_Var;
struct PPB_Var_1_0 {
void (*AddRef)(struct PP_Var var);
@@ -105,6 +127,13 @@ struct PPB_Var_1_0 {
uint32_t len);
const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len);
};
+
+struct PPB_Var_1_1 {
+ void (*AddRef)(struct PP_Var var);
+ void (*Release)(struct PP_Var var);
+ struct PP_Var (*VarFromUtf8)(const char* data, uint32_t len);
+ const char* (*VarToUtf8)(struct PP_Var var, uint32_t* len);
+};
/**
* @}
*/
« no previous file with comments | « ppapi/c/dev/ppb_var_resource_dev.h ('k') | ppapi/cpp/dev/var_resource_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698