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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_attributes.py

Issue 2043503002: Add [CEReactions] IDL attributes for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yukishiino review Created 4 years, 6 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) 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 not is_do_not_check_security) 60 not is_do_not_check_security)
61 is_check_security_for_return_value = ( 61 is_check_security_for_return_value = (
62 has_extended_attribute_value(attribute, 'CheckSecurity', 'ReturnValue')) 62 has_extended_attribute_value(attribute, 'CheckSecurity', 'ReturnValue'))
63 if is_check_security_for_receiver or is_check_security_for_return_value: 63 if is_check_security_for_receiver or is_check_security_for_return_value:
64 includes.add('bindings/core/v8/BindingSecurity.h') 64 includes.add('bindings/core/v8/BindingSecurity.h')
65 # [Constructor] 65 # [Constructor]
66 # TODO(yukishiino): Constructors are much like methods although constructors 66 # TODO(yukishiino): Constructors are much like methods although constructors
67 # are not methods. Constructors must be data-type properties, and we can 67 # are not methods. Constructors must be data-type properties, and we can
68 # support them as a kind of methods. 68 # support them as a kind of methods.
69 constructor_type = idl_type.constructor_type_name if is_constructor_attribut e(attribute) else None 69 constructor_type = idl_type.constructor_type_name if is_constructor_attribut e(attribute) else None
70 # [CEReactions]
71 is_ce_reactions = 'CEReactions' in extended_attributes
72 if is_ce_reactions:
73 includes.add('core/dom/custom/CEReactionsScope.h')
70 # [CustomElementCallbacks], [Reflect] 74 # [CustomElementCallbacks], [Reflect]
71 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute s 75 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute s
72 is_reflect = 'Reflect' in extended_attributes 76 is_reflect = 'Reflect' in extended_attributes
73 if is_custom_element_callbacks or is_reflect: 77 if is_custom_element_callbacks or is_reflect:
74 includes.add('core/dom/custom/V0CustomElementProcessingStack.h') 78 includes.add('core/dom/custom/V0CustomElementProcessingStack.h')
75 # [ImplementedInPrivateScript] 79 # [ImplementedInPrivateScript]
76 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes 80 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes
77 if is_implemented_in_private_script: 81 if is_implemented_in_private_script:
78 includes.add('bindings/core/v8/PrivateScriptRunner.h') 82 includes.add('bindings/core/v8/PrivateScriptRunner.h')
79 includes.add('core/frame/LocalFrame.h') 83 includes.add('core/frame/LocalFrame.h')
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] 118 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
115 'enum_type': idl_type.enum_type, 119 'enum_type': idl_type.enum_type,
116 'enum_values': idl_type.enum_values, 120 'enum_values': idl_type.enum_values,
117 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] 121 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed]
118 'has_custom_getter': has_custom_getter(attribute), 122 'has_custom_getter': has_custom_getter(attribute),
119 'has_custom_setter': has_custom_setter(attribute), 123 'has_custom_setter': has_custom_setter(attribute),
120 'has_setter': has_setter(interface, attribute), 124 'has_setter': has_setter(interface, attribute),
121 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType 125 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType
122 'is_call_with_execution_context': has_extended_attribute_value(attribute , 'CallWith', 'ExecutionContext'), 126 'is_call_with_execution_context': has_extended_attribute_value(attribute , 'CallWith', 'ExecutionContext'),
123 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca llWith', 'ScriptState'), 127 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca llWith', 'ScriptState'),
128 'is_ce_reactions': is_ce_reactions,
124 'is_check_security_for_receiver': is_check_security_for_receiver, 129 'is_check_security_for_receiver': is_check_security_for_receiver,
125 'is_check_security_for_return_value': is_check_security_for_return_value , 130 'is_check_security_for_return_value': is_check_security_for_return_value ,
126 'is_custom_element_callbacks': is_custom_element_callbacks, 131 'is_custom_element_callbacks': is_custom_element_callbacks,
127 # TODO(yukishiino): Make all DOM attributes accessor-type properties. 132 # TODO(yukishiino): Make all DOM attributes accessor-type properties.
128 'is_data_type_property': is_data_type_property(interface, attribute), 133 'is_data_type_property': is_data_type_property(interface, attribute),
129 'is_getter_raises_exception': # [RaisesException] 134 'is_getter_raises_exception': # [RaisesException]
130 'RaisesException' in extended_attributes and 135 'RaisesException' in extended_attributes and
131 extended_attributes['RaisesException'] in (None, 'Getter'), 136 extended_attributes['RaisesException'] in (None, 'Getter'),
132 'is_implemented_in_private_script': is_implemented_in_private_script, 137 'is_implemented_in_private_script': is_implemented_in_private_script,
133 'is_keep_alive_for_gc': keep_alive_for_gc, 138 'is_keep_alive_for_gc': keep_alive_for_gc,
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 lambda self: strip_suffix(self.base_type, 'Constructor')) 572 lambda self: strip_suffix(self.base_type, 'Constructor'))
568 573
569 574
570 def is_constructor_attribute(attribute): 575 def is_constructor_attribute(attribute):
571 # FIXME: replace this with [ConstructorAttribute] extended attribute 576 # FIXME: replace this with [ConstructorAttribute] extended attribute
572 return attribute.idl_type.name.endswith('Constructor') 577 return attribute.idl_type.name.endswith('Constructor')
573 578
574 579
575 def update_constructor_attribute_context(interface, attribute, context): 580 def update_constructor_attribute_context(interface, attribute, context):
576 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 581 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698