OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /** | 6 /** |
7 * This file defines the API for handling the passing of data types between | 7 * This file defines the API for handling the passing of data types between |
8 * your module and the page. | 8 * your module and the page. |
9 */ | 9 */ |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 */ | 48 */ |
49 PP_VARTYPE_STRING = 5, | 49 PP_VARTYPE_STRING = 5, |
50 | 50 |
51 /** | 51 /** |
52 * Represents a JavaScript object. This vartype is not currently usable | 52 * Represents a JavaScript object. This vartype is not currently usable |
53 * from modules, although it is used internally for some tasks. | 53 * from modules, although it is used internally for some tasks. |
54 */ | 54 */ |
55 PP_VARTYPE_OBJECT = 6, | 55 PP_VARTYPE_OBJECT = 6, |
56 | 56 |
57 /** | 57 /** |
58 * Arrays and dictionaries are not currently supported but will be added | 58 * Arrays and dictionaries are not currently supported but will be added |
Matt Giuca
2013/09/03 08:36:31
FYI I have a CL out to fix this comment. (https://
Matt Giuca
2013/09/10 01:17:13
Done.
| |
59 * in future revisions. These objects are reference counted so be sure | 59 * in future revisions. These objects are reference counted so be sure |
60 * to properly AddRef/Release them as you would with strings to ensure your | 60 * to properly AddRef/Release them as you would with strings to ensure your |
61 * module will continue to work with future versions of the API. | 61 * module will continue to work with future versions of the API. |
62 */ | 62 */ |
63 PP_VARTYPE_ARRAY = 7, | 63 PP_VARTYPE_ARRAY = 7, |
64 PP_VARTYPE_DICTIONARY = 8, | 64 PP_VARTYPE_DICTIONARY = 8, |
65 | 65 |
66 /** | 66 /** |
67 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which | 67 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which |
68 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is | 68 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is |
69 * only meant to contain basic numeric types, and is always stored | 69 * only meant to contain basic numeric types, and is always stored |
70 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to | 70 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to |
71 * ArrayBuffer vars. | 71 * ArrayBuffer vars. |
72 */ | 72 */ |
73 PP_VARTYPE_ARRAY_BUFFER = 9 | 73 PP_VARTYPE_ARRAY_BUFFER = 9, |
74 | |
75 /** | |
76 * Resources are not currently supported but will be added in future | |
77 * revisions. These objects are reference counted, so AddRef and Release must | |
78 * be used properly to avoid memory leaks. | |
79 */ | |
80 PP_VARTYPE_RESOURCE = 10 | |
74 }; | 81 }; |
75 | 82 |
76 | 83 |
77 /** | 84 /** |
78 * The PP_VarValue union stores the data for any one of the types listed | 85 * The PP_VarValue union stores the data for any one of the types listed |
79 * in the PP_VarType enum. | 86 * in the PP_VarType enum. |
80 */ | 87 */ |
81 [union] struct PP_VarValue { | 88 [union] struct PP_VarValue { |
82 /** | 89 /** |
83 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, | 90 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, |
(...skipping 11 matching lines...) Expand all Loading... | |
95 | 102 |
96 /** | 103 /** |
97 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, | 104 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, |
98 * <code>as_double</code> represents the value of this <code>PP_Var</code> | 105 * <code>as_double</code> represents the value of this <code>PP_Var</code> |
99 * as <code>double</code>. | 106 * as <code>double</code>. |
100 */ | 107 */ |
101 double_t as_double; | 108 double_t as_double; |
102 | 109 |
103 /** | 110 /** |
104 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, | 111 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, |
105 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or | 112 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, |
yzshen1
2013/09/03 20:19:53
Please also add PP_VARTYPE_ARRAY_BUFFER here.
Matt Giuca
2013/09/10 01:17:13
Done.
| |
106 * <code>PP_VARTYPE_DICTIONARY</code>, | 113 * <code>PP_VARTYPE_DICTIONARY</code>, or <code>PP_VARTYPE_RESOURCE</code>, |
107 * <code>as_id</code> represents the value of this <code>PP_Var</code> as | 114 * <code>as_id</code> represents the value of this <code>PP_Var</code> as |
108 * an opaque handle assigned by the browser. This handle is guaranteed | 115 * an opaque handle assigned by the browser. This handle is guaranteed |
109 * never to be 0, so a module can initialize this ID to 0 to indicate a | 116 * never to be 0, so a module can initialize this ID to 0 to indicate a |
110 * "NULL handle." | 117 * "NULL handle." |
111 */ | 118 */ |
112 int64_t as_id; | 119 int64_t as_id; |
113 }; | 120 }; |
114 | 121 |
115 /** | 122 /** |
116 * The <code>PP_VAR</code> struct is a variant data type and can contain any | 123 * The <code>PP_VAR</code> struct is a variant data type and can contain any |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 223 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
217 result.value.as_double = value; | 224 result.value.as_double = value; |
218 return result; | 225 return result; |
219 } | 226 } |
220 /** | 227 /** |
221 * @} | 228 * @} |
222 */ | 229 */ |
223 | 230 |
224 #endinl | 231 #endinl |
225 | 232 |
OLD | NEW |