Chromium Code Reviews| 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 |
|
yzshen1
2013/09/03 18:04:54
If you would like to mention about ref counting, a
Matt Giuca
2013/09/04 00:12:53
Done. The reason I did that was because the existi
yzshen1
2013/09/04 00:18:15
Yes, mentioning it for string/array/dictionary but
| |
| 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. |
| 54 */ | 55 */ |
| 55 PP_VARTYPE_OBJECT = 6, | 56 PP_VARTYPE_OBJECT = 6, |
| 56 | 57 |
| 57 /** | 58 /** |
| 58 * Arrays and dictionaries are not currently supported but will be added | 59 * 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 | 60 * 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 | 61 * <code>PPB_VarArray</code> interface. These objects are reference counted, |
| 61 * module will continue to work with future versions of the API. | 62 * so AddRef and Release must be used properly to avoid memory leaks. |
| 62 */ | 63 */ |
| 63 PP_VARTYPE_ARRAY = 7, | 64 PP_VARTYPE_ARRAY = 7, |
| 65 | |
| 66 /** | |
| 67 * Represents a mapping from strings to Vars. The <code>as_id</code> field is | |
| 68 * used to identify the dictionary, which may be created and manipulated from | |
| 69 * the <code>PPB_VarDictionary</code> interface. These objects are reference | |
| 70 * counted, so AddRef and Release must be used properly to avoid memory leaks. | |
| 71 */ | |
| 64 PP_VARTYPE_DICTIONARY = 8, | 72 PP_VARTYPE_DICTIONARY = 8, |
| 65 | 73 |
| 66 /** | 74 /** |
| 67 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which | 75 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which |
| 68 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is | 76 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is |
| 69 * only meant to contain basic numeric types, and is always stored | 77 * only meant to contain basic numeric types, and is always stored |
| 70 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to | 78 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to |
| 71 * ArrayBuffer vars. | 79 * ArrayBuffer vars. |
| 72 */ | 80 */ |
| 73 PP_VARTYPE_ARRAY_BUFFER = 9 | 81 PP_VARTYPE_ARRAY_BUFFER = 9 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 224 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
| 217 result.value.as_double = value; | 225 result.value.as_double = value; |
| 218 return result; | 226 return result; |
| 219 } | 227 } |
| 220 /** | 228 /** |
| 221 * @} | 229 * @} |
| 222 */ | 230 */ |
| 223 | 231 |
| 224 #endinl | 232 #endinl |
| 225 | 233 |
| OLD | NEW |