Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ppapi/c/pp_var.h

Issue 23757014: [PPAPI] Updated documentation for PP_VarType enum constants. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Mention refcounting in the OBJECT and ARRAY_BUFFER docs. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/api/pp_var.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /* From pp_var.idl modified Mon Feb 11 15:41:10 2013. */ 6 /* From pp_var.idl modified Wed Sep 4 10:11:31 2013. */
7 7
8 #ifndef PPAPI_C_PP_VAR_H_ 8 #ifndef PPAPI_C_PP_VAR_H_
9 #define PPAPI_C_PP_VAR_H_ 9 #define PPAPI_C_PP_VAR_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_macros.h" 12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_stdint.h" 13 #include "ppapi/c/pp_stdint.h"
14 14
15 /** 15 /**
16 * @file 16 * @file
(...skipping 29 matching lines...) Expand all
46 */ 46 */
47 PP_VARTYPE_INT32 = 3, 47 PP_VARTYPE_INT32 = 3,
48 /** 48 /**
49 * A double-precision floating point value. Use the <code>as_double</code> 49 * A double-precision floating point value. Use the <code>as_double</code>
50 * member of the var. 50 * member of the var.
51 */ 51 */
52 PP_VARTYPE_DOUBLE = 4, 52 PP_VARTYPE_DOUBLE = 4,
53 /** 53 /**
54 * The Var represents a string. The <code>as_id</code> field is used to 54 * The Var represents a string. The <code>as_id</code> field is used to
55 * identify the string, which may be created and retrieved from the 55 * identify the string, which may be created and retrieved from the
56 * <code>PPB_Var</code> interface. 56 * <code>PPB_Var</code> interface. These objects are reference counted, so
57 * AddRef and Release must be used properly to avoid memory leaks.
57 */ 58 */
58 PP_VARTYPE_STRING = 5, 59 PP_VARTYPE_STRING = 5,
59 /** 60 /**
60 * Represents a JavaScript object. This vartype is not currently usable 61 * Represents a JavaScript object. This vartype is not currently usable
61 * from modules, although it is used internally for some tasks. 62 * from modules, although it is used internally for some tasks. These objects
63 * are reference counted, so AddRef and Release must be used properly to avoid
64 * memory leaks.
62 */ 65 */
63 PP_VARTYPE_OBJECT = 6, 66 PP_VARTYPE_OBJECT = 6,
64 /** 67 /**
65 * Arrays and dictionaries are not currently supported but will be added 68 * Represents an array of Vars. The <code>as_id</code> field is used to
66 * in future revisions. These objects are reference counted so be sure 69 * identify the array, which may be created and manipulated from the
67 * to properly AddRef/Release them as you would with strings to ensure your 70 * <code>PPB_VarArray</code> interface. These objects are reference counted,
68 * module will continue to work with future versions of the API. 71 * so AddRef and Release must be used properly to avoid memory leaks.
69 */ 72 */
70 PP_VARTYPE_ARRAY = 7, 73 PP_VARTYPE_ARRAY = 7,
74 /**
75 * Represents a mapping from strings to Vars. The <code>as_id</code> field is
76 * used to identify the dictionary, which may be created and manipulated from
77 * the <code>PPB_VarDictionary</code> interface. These objects are reference
78 * counted, so AddRef and Release must be used properly to avoid memory leaks.
79 */
71 PP_VARTYPE_DICTIONARY = 8, 80 PP_VARTYPE_DICTIONARY = 8,
72 /** 81 /**
73 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which 82 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which
74 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is 83 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is
75 * only meant to contain basic numeric types, and is always stored 84 * only meant to contain basic numeric types, and is always stored
76 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to 85 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to
77 * ArrayBuffer vars. 86 * ArrayBuffer vars. These objects are reference counted, so AddRef and
87 * Release must be used properly to avoid memory leaks.
78 */ 88 */
79 PP_VARTYPE_ARRAY_BUFFER = 9 89 PP_VARTYPE_ARRAY_BUFFER = 9
80 } PP_VarType; 90 } PP_VarType;
81 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); 91 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4);
82 /** 92 /**
83 * @} 93 * @}
84 */ 94 */
85 95
86 /** 96 /**
87 * @addtogroup Structs 97 * @addtogroup Structs
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; 235 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} };
226 result.value.as_double = value; 236 result.value.as_double = value;
227 return result; 237 return result;
228 } 238 }
229 /** 239 /**
230 * @} 240 * @}
231 */ 241 */
232 242
233 #endif /* PPAPI_C_PP_VAR_H_ */ 243 #endif /* PPAPI_C_PP_VAR_H_ */
234 244
OLDNEW
« no previous file with comments | « ppapi/api/pp_var.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698