Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ppapi / c / ppb_var.h
index 523622d..91a6592 100644 (file)
@@ -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_
 #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);
+};
 /**
  * @}
  */