Chromium Code Reviews| Index: ppapi/c/pp_var.h |
| =================================================================== |
| --- ppapi/c/pp_var.h (revision 80958) |
| +++ ppapi/c/pp_var.h (working copy) |
| @@ -26,13 +26,53 @@ |
| * within a PP_VAR structure. |
| */ |
| typedef enum { |
| + /** |
| + * A var with an undefined value. |
|
dmichael(do not use this one)
2011/04/08 22:16:28
Maybe just say 'An undefined value.' to be consist
|
| + */ |
| PP_VARTYPE_UNDEFINED, |
| + |
| + /** |
| + * A NULL value. This is similar to undefined, but JavaScript differentiates |
| + * the two so we expose it here as well. |
| + */ |
| PP_VARTYPE_NULL, |
| + |
| + /** |
| + * A boolean value, use the as_bool member of the var. |
| + */ |
| PP_VARTYPE_BOOL, |
| + |
| + /** |
| + * A 32-bit integer value. Use the as_int member of the var. |
| + */ |
| PP_VARTYPE_INT32, |
| + |
| + /** |
| + * A double-precision floating point value. Use the as_double member of the |
| + * var. |
| + */ |
| PP_VARTYPE_DOUBLE, |
| + |
| + /** |
| + * The Var represents a string. The as_id field is used to identify the |
| + * string, which may be created and retrieved from the PPB_Var interface. |
| + */ |
| PP_VARTYPE_STRING, |
| - PP_VARTYPE_OBJECT |
| + |
| + /** |
| + * Represents a JavaScript object. This vartype is not currently usable |
|
dmichael(do not use this one)
2011/04/08 22:16:28
maybe take out 'currently'? We should avoid givin
|
| + * from plugins, although it is used internally for some tasks. |
| + */ |
| + PP_VARTYPE_OBJECT, |
| + |
| + /** |
| + * Arrays and dictionaries are not currently supported but will be added |
| + * in future revisions. These objects are reference counteed so be sure |
|
dmichael(do not use this one)
2011/04/08 22:16:28
s/counteed/counted
|
| + * to properly AddRef/Release them as you would with strings to ensure your |
| + * plugin will continue to work with future versions of the API. |
| + */ |
| + PP_VARTYPE_ARRAY, |
| + PP_VARTYPE_DICTIONARY |
|
dmichael(do not use this one)
2011/04/08 22:16:28
After thinking about it a little more, I still hav
brettw
2011/04/09 16:41:34
If we had designed this API without scripting from
dmichael (off chromium)
2011/04/11 00:09:16
Thanks for explaining. I think we may still need
|
| } PP_VarType; |
| PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); |
| /** |
| @@ -73,9 +113,10 @@ |
| double as_double; |
| /** |
| - * Internal ID for strings and objects. The identifier is an opaque handle |
| - * assigned by the browser to the plugin. It is guaranteed never to be 0, |
| - * so a plugin can initialize this ID to 0 to indicate a "NULL handle." |
| + * Internal ID for strings objects, arrays, and dictionaries. The |
| + * identifier is an opaque handle assigned by the browser to the plugin. It |
| + * is guaranteed never to be 0, so a plugin can initialize this ID to 0 to |
| + * indicate a "NULL handle." |
|
dmichael(do not use this one)
2011/04/08 22:16:28
if we _don't_ do reference counting, we can use a
|
| */ |
| int64_t as_id; |
| } value; |