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

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

Issue 5340003: Make a new test to enforce the sizes of all structs and enums in the C API.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/c/ppb_url_response_info.h ('k') | ppapi/generate_ppapi_include_tests.py » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef PPAPI_C_PPB_VAR_H_ 5 #ifndef PPAPI_C_PPB_VAR_H_
6 #define PPAPI_C_PPB_VAR_H_ 6 #define PPAPI_C_PPB_VAR_H_
7 7
8 #include "ppapi/c/pp_bool.h" 8 #include "ppapi/c/pp_bool.h"
9 #include "ppapi/c/pp_instance.h" 9 #include "ppapi/c/pp_instance.h"
10 #include "ppapi/c/pp_macros.h" 10 #include "ppapi/c/pp_macros.h"
(...skipping 15 matching lines...) Expand all
26 * @{ 26 * @{
27 */ 27 */
28 28
29 enum PP_ObjectProperty_Modifier { 29 enum PP_ObjectProperty_Modifier {
30 PP_OBJECTPROPERTY_MODIFIER_NONE = 0, 30 PP_OBJECTPROPERTY_MODIFIER_NONE = 0,
31 PP_OBJECTPROPERTY_MODIFIER_READONLY = 1 << 0, 31 PP_OBJECTPROPERTY_MODIFIER_READONLY = 1 << 0,
32 PP_OBJECTPROPERTY_MODIFIER_DONTENUM = 1 << 1, 32 PP_OBJECTPROPERTY_MODIFIER_DONTENUM = 1 << 1,
33 PP_OBJECTPROPERTY_MODIFIER_DONTDELETE = 1 << 2, 33 PP_OBJECTPROPERTY_MODIFIER_DONTDELETE = 1 << 2,
34 PP_OBJECTPROPERTY_MODIFIER_HASVALUE = 1 << 3 34 PP_OBJECTPROPERTY_MODIFIER_HASVALUE = 1 << 3
35 }; 35 };
36 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_ObjectProperty_Modifier, 4);
36 37
37 struct PP_ObjectProperty { 38 struct PP_ObjectProperty {
38 struct PP_Var name; 39 struct PP_Var name;
39 struct PP_Var value; 40 struct PP_Var value;
40 struct PP_Var getter; 41 struct PP_Var getter;
41 struct PP_Var setter; 42 struct PP_Var setter;
42 uint32_t modifiers; 43 uint32_t modifiers;
44
45 /** Ensure that this struct is 72 bytes wide by padding the end. In some
46 * compilers, PP_Var is 8-byte aligned, so those compilers align this struct
47 * on 8-byte boundaries as well and pad it to 72 bytes even without this
48 * padding attribute. This padding makes its size consistent across
49 * compilers.
50 */
51 int32_t padding;
43 }; 52 };
53 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_ObjectProperty, 72);
44 54
45 /** 55 /**
46 * PPB_Var API 56 * PPB_Var API
47 * 57 *
48 * JavaScript specification: 58 * JavaScript specification:
49 * 59 *
50 * When referencing JS specification, we will refer to ECMAScript, 5th edition, 60 * When referencing JS specification, we will refer to ECMAScript, 5th edition,
51 * and we will put section numbers in square brackets. 61 * and we will put section numbers in square brackets.
52 * 62 *
53 * Exception handling: 63 * Exception handling:
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 result.setter = PP_MakeUndefined(); 300 result.setter = PP_MakeUndefined();
291 result.modifiers = PP_OBJECTPROPERTY_MODIFIER_HASVALUE; 301 result.modifiers = PP_OBJECTPROPERTY_MODIFIER_HASVALUE;
292 return result; 302 return result;
293 } 303 }
294 304
295 /** 305 /**
296 * @} 306 * @}
297 * End addtogroup PPB 307 * End addtogroup PPB
298 */ 308 */
299 #endif // PPAPI_C_PPB_VAR_H_ 309 #endif // PPAPI_C_PPB_VAR_H_
OLDNEW
« no previous file with comments | « ppapi/c/ppb_url_response_info.h ('k') | ppapi/generate_ppapi_include_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698