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

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 tests; slightly better behaviour if user passes a resource to a message. 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 Mon Feb 11 15:41:10 2013. */ 6 /* From pp_var.idl modified Tue Sep 3 13:35:39 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 */ 69 */
70 PP_VARTYPE_ARRAY = 7, 70 PP_VARTYPE_ARRAY = 7,
71 PP_VARTYPE_DICTIONARY = 8, 71 PP_VARTYPE_DICTIONARY = 8,
72 /** 72 /**
73 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which 73 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which
74 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is 74 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is
75 * only meant to contain basic numeric types, and is always stored 75 * only meant to contain basic numeric types, and is always stored
76 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to 76 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to
77 * ArrayBuffer vars. 77 * ArrayBuffer vars.
78 */ 78 */
79 PP_VARTYPE_ARRAY_BUFFER = 9 79 PP_VARTYPE_ARRAY_BUFFER = 9,
80 /**
81 * Resources are not currently supported but will be added in future
82 * revisions. These objects are reference counted, so AddRef and Release must
83 * be used properly to avoid memory leaks.
84 */
85 PP_VARTYPE_RESOURCE = 10
80 } PP_VarType; 86 } PP_VarType;
81 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); 87 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4);
82 /** 88 /**
83 * @} 89 * @}
84 */ 90 */
85 91
86 /** 92 /**
87 * @addtogroup Structs 93 * @addtogroup Structs
88 * @{ 94 * @{
89 */ 95 */
(...skipping 15 matching lines...) Expand all
105 */ 111 */
106 int32_t as_int; 112 int32_t as_int;
107 /** 113 /**
108 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>, 114 * If <code>type</code> is <code>PP_VARTYPE_DOUBLE</code>,
109 * <code>as_double</code> represents the value of this <code>PP_Var</code> 115 * <code>as_double</code> represents the value of this <code>PP_Var</code>
110 * as <code>double</code>. 116 * as <code>double</code>.
111 */ 117 */
112 double as_double; 118 double as_double;
113 /** 119 /**
114 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>, 120 * If <code>type</code> is <code>PP_VARTYPE_STRING</code>,
115 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>, or 121 * <code>PP_VARTYPE_OBJECT</code>, <code>PP_VARTYPE_ARRAY</code>,
116 * <code>PP_VARTYPE_DICTIONARY</code>, 122 * <code>PP_VARTYPE_DICTIONARY</code>, or <code>PP_VARTYPE_RESOURCE</code>,
117 * <code>as_id</code> represents the value of this <code>PP_Var</code> as 123 * <code>as_id</code> represents the value of this <code>PP_Var</code> as
118 * an opaque handle assigned by the browser. This handle is guaranteed 124 * an opaque handle assigned by the browser. This handle is guaranteed
119 * never to be 0, so a module can initialize this ID to 0 to indicate a 125 * never to be 0, so a module can initialize this ID to 0 to indicate a
120 * "NULL handle." 126 * "NULL handle."
121 */ 127 */
122 int64_t as_id; 128 int64_t as_id;
123 }; 129 };
124 130
125 /** 131 /**
126 * The <code>PP_VAR</code> struct is a variant data type and can contain any 132 * The <code>PP_VAR</code> struct is a variant data type and can contain any
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; 231 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} };
226 result.value.as_double = value; 232 result.value.as_double = value;
227 return result; 233 return result;
228 } 234 }
229 /** 235 /**
230 * @} 236 * @}
231 */ 237 */
232 238
233 #endif /* PPAPI_C_PP_VAR_H_ */ 239 #endif /* PPAPI_C_PP_VAR_H_ */
234 240
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698