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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 /** | 38 /** |
39 * A double-precision floating point value. Use the <code>as_double</code> | 39 * A double-precision floating point value. Use the <code>as_double</code> |
40 * member of the var. | 40 * member of the var. |
41 */ | 41 */ |
42 PP_VARTYPE_DOUBLE = 4, | 42 PP_VARTYPE_DOUBLE = 4, |
43 | 43 |
44 /** | 44 /** |
45 * The Var represents a string. The <code>as_id</code> field is used to | 45 * The Var represents a string. The <code>as_id</code> field is used to |
46 * identify the string, which may be created and retrieved from the | 46 * identify the string, which may be created and retrieved from the |
47 * <code>PPB_Var</code> interface. | 47 * <code>PPB_Var</code> interface. These objects are reference counted, so |
| 48 * AddRef and Release must be used properly to avoid memory leaks. |
48 */ | 49 */ |
49 PP_VARTYPE_STRING = 5, | 50 PP_VARTYPE_STRING = 5, |
50 | 51 |
51 /** | 52 /** |
52 * Represents a JavaScript object. This vartype is not currently usable | 53 * Represents a JavaScript object. This vartype is not currently usable |
53 * from modules, although it is used internally for some tasks. | 54 * from modules, although it is used internally for some tasks. These objects |
| 55 * are reference counted, so AddRef and Release must be used properly to avoid |
| 56 * memory leaks. |
54 */ | 57 */ |
55 PP_VARTYPE_OBJECT = 6, | 58 PP_VARTYPE_OBJECT = 6, |
56 | 59 |
57 /** | 60 /** |
58 * Arrays and dictionaries are not currently supported but will be added | 61 * Represents an array of Vars. The <code>as_id</code> field is used to |
59 * in future revisions. These objects are reference counted so be sure | 62 * identify the array, which may be created and manipulated from the |
60 * to properly AddRef/Release them as you would with strings to ensure your | 63 * <code>PPB_VarArray</code> interface. These objects are reference counted, |
61 * module will continue to work with future versions of the API. | 64 * so AddRef and Release must be used properly to avoid memory leaks. |
62 */ | 65 */ |
63 PP_VARTYPE_ARRAY = 7, | 66 PP_VARTYPE_ARRAY = 7, |
| 67 |
| 68 /** |
| 69 * Represents a mapping from strings to Vars. The <code>as_id</code> field is |
| 70 * used to identify the dictionary, which may be created and manipulated from |
| 71 * the <code>PPB_VarDictionary</code> interface. These objects are reference |
| 72 * counted, so AddRef and Release must be used properly to avoid memory leaks. |
| 73 */ |
64 PP_VARTYPE_DICTIONARY = 8, | 74 PP_VARTYPE_DICTIONARY = 8, |
65 | 75 |
66 /** | 76 /** |
67 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which | 77 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which |
68 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is | 78 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is |
69 * only meant to contain basic numeric types, and is always stored | 79 * only meant to contain basic numeric types, and is always stored |
70 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to | 80 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to |
71 * ArrayBuffer vars. | 81 * ArrayBuffer vars. These objects are reference counted, so AddRef and |
| 82 * Release must be used properly to avoid memory leaks. |
72 */ | 83 */ |
73 PP_VARTYPE_ARRAY_BUFFER = 9 | 84 PP_VARTYPE_ARRAY_BUFFER = 9 |
74 }; | 85 }; |
75 | 86 |
76 | 87 |
77 /** | 88 /** |
78 * The PP_VarValue union stores the data for any one of the types listed | 89 * The PP_VarValue union stores the data for any one of the types listed |
79 * in the PP_VarType enum. | 90 * in the PP_VarType enum. |
80 */ | 91 */ |
81 [union] struct PP_VarValue { | 92 [union] struct PP_VarValue { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 227 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
217 result.value.as_double = value; | 228 result.value.as_double = value; |
218 return result; | 229 return result; |
219 } | 230 } |
220 /** | 231 /** |
221 * @} | 232 * @} |
222 */ | 233 */ |
223 | 234 |
224 #endinl | 235 #endinl |
225 | 236 |
OLD | NEW |