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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 PP_VARTYPE_DICTIONARY = 8, | 74 PP_VARTYPE_DICTIONARY = 8, |
75 | 75 |
76 /** | 76 /** |
77 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which | 77 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which |
78 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is | 78 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is |
79 * only meant to contain basic numeric types, and is always stored | 79 * only meant to contain basic numeric types, and is always stored |
80 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to | 80 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to |
81 * ArrayBuffer vars. These objects are reference counted, so AddRef and | 81 * ArrayBuffer vars. These objects are reference counted, so AddRef and |
82 * Release must be used properly to avoid memory leaks. | 82 * Release must be used properly to avoid memory leaks. |
83 */ | 83 */ |
84 PP_VARTYPE_ARRAY_BUFFER = 9 | 84 PP_VARTYPE_ARRAY_BUFFER = 9, |
85 | |
86 /** | |
87 * Resources are not currently supported but will be added in future | |
88 * revisions. These objects are reference counted, so AddRef and Release must | |
raymes
2013/09/11 22:52:29
future revisions -> the future
Matt Giuca
2013/09/12 07:08:24
Done. (Haha, note that I copied this text from the
| |
89 * be used properly to avoid memory leaks. | |
90 */ | |
91 PP_VARTYPE_RESOURCE = 10 | |
85 }; | 92 }; |
86 | 93 |
87 | 94 |
88 /** | 95 /** |
89 * The PP_VarValue union stores the data for any one of the types listed | 96 * The PP_VarValue union stores the data for any one of the types listed |
90 * in the PP_VarType enum. | 97 * in the PP_VarType enum. |
91 */ | 98 */ |
92 [union] struct PP_VarValue { | 99 [union] struct PP_VarValue { |
93 /** | 100 /** |
94 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, | 101 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, |
(...skipping 11 matching lines...) Expand all Loading... | |
106 | 113 |
107 /** | 114 /** |
108 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, | 115 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, |
109 * <code>as_double</code> represents the value of this <code>PP_Var</code> | 116 * <code>as_double</code> represents the value of this <code>PP_Var</code> |
110 * as <code>double</code>. | 117 * as <code>double</code>. |
111 */ | 118 */ |
112 double_t as_double; | 119 double_t as_double; |
113 | 120 |
114 /** | 121 /** |
115 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, | 122 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, |
116 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or | 123 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, |
117 * <code>PP_VARTYPE_DICTIONARY</code>, | 124 * <code>PP_VARTYPE_DICTIONARY</code>, <code>PP_VARTYPE_ARRAY_BUFFER</code>, |
118 * <code>as_id</code> represents the value of this <code>PP_Var</code> as | 125 * or <code>PP_VARTYPE_RESOURCE</code>, <code>as_id</code> represents the |
119 * an opaque handle assigned by the browser. This handle is guaranteed | 126 * value of this <code>PP_Var</code> as an opaque handle assigned by the |
120 * never to be 0, so a module can initialize this ID to 0 to indicate a | 127 * browser. This handle is guaranteed never to be 0, so a module can |
121 * "NULL handle." | 128 * initialize this ID to 0 to indicate a "NULL handle." |
122 */ | 129 */ |
123 int64_t as_id; | 130 int64_t as_id; |
124 }; | 131 }; |
125 | 132 |
126 /** | 133 /** |
127 * The <code>PP_VAR</code> struct is a variant data type and can contain any | 134 * The <code>PP_VAR</code> struct is a variant data type and can contain any |
128 * value of one of the types named in the <code>PP_VarType</code> enum. This | 135 * value of one of the types named in the <code>PP_VarType</code> enum. This |
129 * structure is for passing data between native code which can be strongly | 136 * structure is for passing data between native code which can be strongly |
130 * typed and the browser (JavaScript) which isn't strongly typed. | 137 * typed and the browser (JavaScript) which isn't strongly typed. |
131 * | 138 * |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 234 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
228 result.value.as_double = value; | 235 result.value.as_double = value; |
229 return result; | 236 return result; |
230 } | 237 } |
231 /** | 238 /** |
232 * @} | 239 * @} |
233 */ | 240 */ |
234 | 241 |
235 #endinl | 242 #endinl |
236 | 243 |
OLD | NEW |