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

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

Issue 18599005: [PPAPI] Added PP_VARTYPE_RESOURCE as a PP_VarType enum value. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unittest_utils comparison of resource vars. 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
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 Wed Sep 4 10:11:31 2013. */ 6 /* From pp_var.idl modified Tue Sep 10 08:19:47 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 */ 79 */
80 PP_VARTYPE_DICTIONARY = 8, 80 PP_VARTYPE_DICTIONARY = 8,
81 /** 81 /**
82 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which 82 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which
83 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is 83 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is
84 * only meant to contain basic numeric types, and is always stored 84 * only meant to contain basic numeric types, and is always stored
85 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to 85 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to
86 * ArrayBuffer vars. These objects are reference counted, so AddRef and 86 * ArrayBuffer vars. These objects are reference counted, so AddRef and
87 * Release must be used properly to avoid memory leaks. 87 * Release must be used properly to avoid memory leaks.
88 */ 88 */
89 PP_VARTYPE_ARRAY_BUFFER = 9 89 PP_VARTYPE_ARRAY_BUFFER = 9,
90 /**
91 * Resources are not currently supported but will be added in future
92 * revisions. These objects are reference counted, so AddRef and Release must
93 * be used properly to avoid memory leaks.
94 */
95 PP_VARTYPE_RESOURCE = 10
90 } PP_VarType; 96 } PP_VarType;
91 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); 97 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4);
92 /** 98 /**
93 * @} 99 * @}
94 */ 100 */
95 101
96 /** 102 /**
97 * @addtogroup Structs 103 * @addtogroup Structs
98 * @{ 104 * @{
99 */ 105 */
(...skipping 15 matching lines...) Expand all
115 */ 121 */
116 int32_t as_int; 122 int32_t as_int;
117 /** 123 /**
118 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, 124 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>,
119 * <code>as_double</code> represents the value of this <code>PP_Var</code> 125 * <code>as_double</code> represents the value of this <code>PP_Var</code>
120 * as <code>double</code>. 126 * as <code>double</code>.
121 */ 127 */
122 double as_double; 128 double as_double;
123 /** 129 /**
124 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, 130 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>,
125 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or 131 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>,
126 * <code>PP_VARTYPE_DICTIONARY</code>, 132 * <code>PP_VARTYPE_DICTIONARY</code>, <code>PP_VARTYPE_ARRAY_BUFFER</code>,
127 * <code>as_id</code> represents the value of this <code>PP_Var</code> as 133 * or <code>PP_VARTYPE_RESOURCE</code>, <code>as_id</code> represents the
128 * an opaque handle assigned by the browser. This handle is guaranteed 134 * value of this <code>PP_Var</code> as an opaque handle assigned by the
129 * never to be 0, so a module can initialize this ID to 0 to indicate a 135 * browser. This handle is guaranteed never to be 0, so a module can
130 * "NULL handle." 136 * initialize this ID to 0 to indicate a "NULL handle."
131 */ 137 */
132 int64_t as_id; 138 int64_t as_id;
133 }; 139 };
134 140
135 /** 141 /**
136 * The <code>PP_VAR</code> struct is a variant data type and can contain any 142 * The <code>PP_VAR</code> struct is a variant data type and can contain any
137 * value of one of the types named in the <code>PP_VarType</code> enum. This 143 * value of one of the types named in the <code>PP_VarType</code> enum. This
138 * structure is for passing data between native code which can be strongly 144 * structure is for passing data between native code which can be strongly
139 * typed and the browser (JavaScript) which isn't strongly typed. 145 * typed and the browser (JavaScript) which isn't strongly typed.
140 * 146 *
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; 241 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} };
236 result.value.as_double = value; 242 result.value.as_double = value;
237 return result; 243 return result;
238 } 244 }
239 /** 245 /**
240 * @} 246 * @}
241 */ 247 */
242 248
243 #endif /* PPAPI_C_PP_VAR_H_ */ 249 #endif /* PPAPI_C_PP_VAR_H_ */
244 250
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698