 Chromium Code Reviews
 Chromium Code Reviews Issue 43243002:
  IDL compiler: Sync Python compiler to WrapperTypeInfo changes  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk
    
  
    Issue 43243002:
  IDL compiler: Sync Python compiler to WrapperTypeInfo changes  (Closed) 
  Base URL: svn://svn.chromium.org/blink/trunk| OLD | NEW | 
|---|---|
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 
| 2 # | 2 # | 
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without | 
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are | 
| 5 # met: | 5 # met: | 
| 6 # | 6 # | 
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright | 
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. | 
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above | 
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 'property_attributes': property_attributes(attribute), | 93 'property_attributes': property_attributes(attribute), | 
| 94 'setter_callback_name': setter_callback_name(interface, attribute), | 94 'setter_callback_name': setter_callback_name(interface, attribute), | 
| 95 'setter_callback_name_for_main_world': setter_callback_name_for_main_wor ld(interface, attribute), | 95 'setter_callback_name_for_main_world': setter_callback_name_for_main_wor ld(interface, attribute), | 
| 96 'v8_type': v8_types.v8_type(idl_type), | 96 'v8_type': v8_types.v8_type(idl_type), | 
| 97 'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_n ame(attribute), # [RuntimeEnabled] | 97 'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_n ame(attribute), # [RuntimeEnabled] | 
| 98 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings] | 98 'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended _attributes else [''], # [PerWorldBindings] | 
| 99 'wrapper_type_info': wrapper_type_info(attribute), | 99 'wrapper_type_info': wrapper_type_info(attribute), | 
| 100 } | 100 } | 
| 101 if is_constructor_attribute(attribute): | 101 if is_constructor_attribute(attribute): | 
| 102 includes.update(v8_types.includes_for_type(idl_type)) | 102 includes.update(v8_types.includes_for_type(idl_type)) | 
| 103 return contents, includes | 103 return contents | 
| 
Nils Barth (inactive)
2013/10/25 05:32:06
...also one last "global includes" sync.
 | |
| 104 if not has_custom_getter: | 104 if not has_custom_getter: | 
| 105 generate_getter(interface, attribute, contents) | 105 generate_getter(interface, attribute, contents) | 
| 106 if not attribute.is_read_only and not has_custom_setter: | 106 if not attribute.is_read_only and not has_custom_setter: | 
| 107 generate_setter(interface, attribute, contents) | 107 generate_setter(interface, attribute, contents) | 
| 108 | 108 | 
| 109 return contents | 109 return contents | 
| 110 | 110 | 
| 111 | 111 | 
| 112 # Getter | 112 # Getter | 
| 113 | 113 | 
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 def setter_callback_name_for_main_world(interface, attribute): | 339 def setter_callback_name_for_main_world(interface, attribute): | 
| 340 if ('PerWorldBindings' not in attribute.extended_attributes or | 340 if ('PerWorldBindings' not in attribute.extended_attributes or | 
| 341 attribute.is_read_only): | 341 attribute.is_read_only): | 
| 342 return '0' | 342 return '0' | 
| 343 return '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % (cpp_name(int erface), attribute.name) | 343 return '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % (cpp_name(int erface), attribute.name) | 
| 344 | 344 | 
| 345 | 345 | 
| 346 def wrapper_type_info(attribute): | 346 def wrapper_type_info(attribute): | 
| 347 if not is_constructor_attribute(attribute): | 347 if not is_constructor_attribute(attribute): | 
| 348 return '0' | 348 return '0' | 
| 349 return '&V8%s::info' % v8_types.constructor_type(attribute.data_type) | 349 return 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % v8_types.con structor_type(attribute.data_type) | 
| 350 | 350 | 
| 351 | 351 | 
| 352 # [DoNotCheckSecurity], [DoNotCheckSecurityOnGetter], [DoNotCheckSecurityOnSette r], [Unforgeable] | 352 # [DoNotCheckSecurity], [DoNotCheckSecurityOnGetter], [DoNotCheckSecurityOnSette r], [Unforgeable] | 
| 353 def access_control_list(attribute): | 353 def access_control_list(attribute): | 
| 354 extended_attributes = attribute.extended_attributes | 354 extended_attributes = attribute.extended_attributes | 
| 355 access_control = [] | 355 access_control = [] | 
| 356 if 'DoNotCheckSecurity' in extended_attributes: | 356 if 'DoNotCheckSecurity' in extended_attributes: | 
| 357 access_control.append('v8::ALL_CAN_READ') | 357 access_control.append('v8::ALL_CAN_READ') | 
| 358 if not attribute.is_read_only: | 358 if not attribute.is_read_only: | 
| 359 access_control.append('v8::ALL_CAN_WRITE') | 359 access_control.append('v8::ALL_CAN_WRITE') | 
| (...skipping 13 matching lines...) Expand all Loading... | |
| 373 if ('NotEnumerable' in extended_attributes or | 373 if ('NotEnumerable' in extended_attributes or | 
| 374 is_constructor_attribute(attribute)): | 374 is_constructor_attribute(attribute)): | 
| 375 property_attributes_list.append('v8::DontEnum') | 375 property_attributes_list.append('v8::DontEnum') | 
| 376 if 'Unforgeable' in extended_attributes: | 376 if 'Unforgeable' in extended_attributes: | 
| 377 property_attributes_list.append('v8::DontDelete') | 377 property_attributes_list.append('v8::DontDelete') | 
| 378 return property_attributes_list or ['v8::None'] | 378 return property_attributes_list or ['v8::None'] | 
| 379 | 379 | 
| 380 | 380 | 
| 381 def is_constructor_attribute(attribute): | 381 def is_constructor_attribute(attribute): | 
| 382 return attribute.data_type.endswith('Constructor') | 382 return attribute.data_type.endswith('Constructor') | 
| OLD | NEW |