diff options
author | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-12 00:59:31 +0000 |
---|---|---|
committer | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-12 00:59:31 +0000 |
commit | b2b420d78ea19d0121dceb1d025bf8db8626a2d4 (patch) | |
tree | c8f86cdb49ce09235e52f68d4cf77b9e3456464f /ppapi/c/pp_var.h | |
parent | ba7fd4a9ccc5c568e1357d6a739c53411c8f8e13 (diff) | |
download | chromium_src-b2b420d78ea19d0121dceb1d025bf8db8626a2d4.zip chromium_src-b2b420d78ea19d0121dceb1d025bf8db8626a2d4.tar.gz chromium_src-b2b420d78ea19d0121dceb1d025bf8db8626a2d4.tar.bz2 |
Trivial changes to PPAPI headers
These trivial changes make the PPAPI headers more consistent.
This allows the headers to more closely match the autogenerated
ones simplifying validation before we switch over to IDL.
TEST= tryserver
BUG= http://code.google.com/p/chromium/issues/detail?id=76271
Review URL: http://codereview.chromium.org/7333003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c/pp_var.h')
-rw-r--r-- | ppapi/c/pp_var.h | 82 |
1 files changed, 49 insertions, 33 deletions
diff --git a/ppapi/c/pp_var.h b/ppapi/c/pp_var.h index ad465f0..34b364a 100644 --- a/ppapi/c/pp_var.h +++ b/ppapi/c/pp_var.h @@ -80,6 +80,54 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); * @} */ + +/** + * @addtogroup Structs + * @{ + */ + +/** + * The PP_VarValue union stores the data for any one of the types listed + * in the PP_VarType enum. + */ +union PP_VarValue { + /** + * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, + * <code>as_bool</code> represents the value of this <code>PP_Var</code> as + * <code>PP_Bool</code>. + */ + PP_Bool as_bool; + + /** + * If <code>type</code> is <code>PP_VARTYPE_INT32</code>, + * <code>as_int</code> represents the value of this <code>PP_Var</code> as + * <code>int32_t</code>. + */ + int32_t as_int; + + /** + * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, + * <code>as_double</code> represents the value of this <code>PP_Var</code> + * as <code>double</code>. + */ + double as_double; + + /** + * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, + * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or + * <code>PP_VARTYPE_DICTIONARY</code>, + * <code>as_id</code> represents the value of this <code>PP_Var</code> as + * an opaque handle assigned by the browser. This handle is guaranteed + * never to be 0, so a module can initialize this ID to 0 to indicate a + * "NULL handle." + */ + int64_t as_id; +}; +/** + * @} + */ + + /** * @addtogroup Structs * @{ @@ -115,39 +163,7 @@ struct PP_Var { * the fields of <code>value</code> is valid at a time based upon * <code>type</code>. */ - union { - /** - * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, - * <code>as_bool</code> represents the value of this <code>PP_Var</code> as - * <code>PP_Bool</code>. - */ - PP_Bool as_bool; - - /** - * If <code>type</code> is <code>PP_VARTYPE_INT32</code>, - * <code>as_int</code> represents the value of this <code>PP_Var</code> as - * <code>int32_t</code>. - */ - int32_t as_int; - - /** - * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, - * <code>as_double</code> represents the value of this <code>PP_Var</code> - * as <code>double</code>. - */ - double as_double; - - /** - * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, - * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or - * <code>PP_VARTYPE_DICTIONARY</code>, - * <code>as_id</code> represents the value of this <code>PP_Var</code> as - * an opaque handle assigned by the browser. This handle is guaranteed - * never to be 0, so a module can initialize this ID to 0 to indicate a - * "NULL handle." - */ - int64_t as_id; - } value; + union PP_VarValue value; }; PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Var, 16); /** |