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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 if (base_idl_type == 'EventHandler' and | 87 if (base_idl_type == 'EventHandler' and |
88 interface.name in ['Window', 'WorkerGlobalScope'] and | 88 interface.name in ['Window', 'WorkerGlobalScope'] and |
89 attribute.name == 'onerror'): | 89 attribute.name == 'onerror'): |
90 includes.add('bindings/core/v8/V8ErrorHandler.h') | 90 includes.add('bindings/core/v8/V8ErrorHandler.h') |
91 | 91 |
92 cached_attribute_validation_method = extended_attributes.get('CachedAttribut
e') | 92 cached_attribute_validation_method = extended_attributes.get('CachedAttribut
e') |
93 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) | 93 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) |
94 if cached_attribute_validation_method or keep_alive_for_gc: | 94 if cached_attribute_validation_method or keep_alive_for_gc: |
95 includes.add('bindings/core/v8/V8HiddenValue.h') | 95 includes.add('bindings/core/v8/V8HiddenValue.h') |
96 | 96 |
97 if 'RuntimeEnabled' in extended_attributes: | |
98 includes.add('platform/RuntimeEnabledFeatures.h') | |
99 | |
100 if 'OriginTrialEnabled' in extended_attributes: | |
101 includes.add('core/inspector/ConsoleMessage.h') | |
102 includes.add('core/origin_trials/OriginTrials.h') | |
103 | |
104 context = { | 97 context = { |
105 'access_control_list': access_control_list(interface, attribute), | 98 'access_control_list': access_control_list(interface, attribute), |
106 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] | 99 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] |
107 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] | 100 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] |
108 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] | 101 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] |
109 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 102 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
110 'cached_attribute_validation_method': cached_attribute_validation_method
, | 103 'cached_attribute_validation_method': cached_attribute_validation_method
, |
111 'constructor_type': constructor_type, | 104 'constructor_type': constructor_type, |
112 'cpp_name': cpp_name(attribute), | 105 'cpp_name': cpp_name(attribute), |
113 'cpp_type': idl_type.cpp_type, | 106 'cpp_type': idl_type.cpp_type, |
114 'cpp_type_initializer': idl_type.cpp_type_initializer, | 107 'cpp_type_initializer': idl_type.cpp_type_initializer, |
115 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] | 108 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] |
116 'enum_type': idl_type.enum_type, | 109 'enum_type': idl_type.enum_type, |
117 'enum_values': idl_type.enum_values, | 110 'enum_values': idl_type.enum_values, |
118 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] | 111 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] |
119 'has_custom_getter': has_custom_getter(attribute), | 112 'has_custom_getter': has_custom_getter(attribute), |
120 'has_custom_setter': has_custom_setter(attribute), | 113 'has_custom_setter': has_custom_setter(attribute), |
121 'has_setter': has_setter(interface, attribute), | 114 'has_setter': has_setter(interface, attribute), |
122 'idl_type': str(idl_type), # need trailing [] on array for Dictionary::
ConversionContext::setConversionType | 115 'idl_type': str(idl_type), # need trailing [] on array for Dictionary::
ConversionContext::setConversionType |
123 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(at
tribute) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTri
alEnabled] | |
124 'is_call_with_execution_context': has_extended_attribute_value(attribute
, 'CallWith', 'ExecutionContext'), | 116 'is_call_with_execution_context': has_extended_attribute_value(attribute
, 'CallWith', 'ExecutionContext'), |
125 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca
llWith', 'ScriptState'), | 117 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca
llWith', 'ScriptState'), |
126 'is_check_security_for_receiver': is_check_security_for_receiver, | 118 'is_check_security_for_receiver': is_check_security_for_receiver, |
127 'is_check_security_for_return_value': is_check_security_for_return_value
, | 119 'is_check_security_for_return_value': is_check_security_for_return_value
, |
128 'is_custom_element_callbacks': is_custom_element_callbacks, | 120 'is_custom_element_callbacks': is_custom_element_callbacks, |
129 # TODO(yukishiino): Make all DOM attributes accessor-type properties. | 121 # TODO(yukishiino): Make all DOM attributes accessor-type properties. |
130 'is_data_type_property': is_data_type_property(interface, attribute), | 122 'is_data_type_property': is_data_type_property(interface, attribute), |
131 'is_getter_raises_exception': # [RaisesException] | 123 'is_getter_raises_exception': # [RaisesException] |
132 'RaisesException' in extended_attributes and | 124 'RaisesException' in extended_attributes and |
133 extended_attributes['RaisesException'] in (None, 'Getter'), | 125 extended_attributes['RaisesException'] in (None, 'Getter'), |
134 'is_implemented_in_private_script': is_implemented_in_private_script, | 126 'is_implemented_in_private_script': is_implemented_in_private_script, |
135 'is_keep_alive_for_gc': keep_alive_for_gc, | 127 'is_keep_alive_for_gc': keep_alive_for_gc, |
136 'is_lenient_this': 'LenientThis' in extended_attributes, | 128 'is_lenient_this': 'LenientThis' in extended_attributes, |
137 'is_nullable': idl_type.is_nullable, | 129 'is_nullable': idl_type.is_nullable, |
138 'is_explicit_nullable': idl_type.is_explicit_nullable, | 130 'is_explicit_nullable': idl_type.is_explicit_nullable, |
139 'is_partial_interface_member': | 131 'is_partial_interface_member': |
140 'PartialInterfaceImplementedAs' in extended_attributes, | 132 'PartialInterfaceImplementedAs' in extended_attributes, |
141 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, | 133 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, |
142 'is_put_forwards': 'PutForwards' in extended_attributes, | 134 'is_put_forwards': 'PutForwards' in extended_attributes, |
143 'is_read_only': attribute.is_read_only, | 135 'is_read_only': attribute.is_read_only, |
144 'is_reflect': is_reflect, | 136 'is_reflect': is_reflect, |
145 'is_replaceable': 'Replaceable' in attribute.extended_attributes, | 137 'is_replaceable': 'Replaceable' in attribute.extended_attributes, |
146 'is_static': attribute.is_static, | 138 'is_static': attribute.is_static, |
147 'is_url': 'URL' in extended_attributes, | 139 'is_url': 'URL' in extended_attributes, |
148 'is_unforgeable': is_unforgeable(interface, attribute), | 140 'is_unforgeable': is_unforgeable(interface, attribute), |
149 'on_instance': v8_utilities.on_instance(interface, attribute), | 141 'on_instance': v8_utilities.on_instance(interface, attribute), |
150 'on_interface': v8_utilities.on_interface(interface, attribute), | 142 'on_interface': v8_utilities.on_interface(interface, attribute), |
151 'on_prototype': v8_utilities.on_prototype(interface, attribute), | 143 'on_prototype': v8_utilities.on_prototype(interface, attribute), |
152 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(attri
bute), # [OriginTrialEnabled] | 144 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(attribute, interface), # [OriginTrialEnabled] |
153 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_
function(interface), # [OriginTrialEnabled] | |
154 'origin_trial_name': extended_attributes.get('OriginTrialEnabled'), # [
OriginTrialEnabled] | |
155 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, | 145 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, |
156 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure
As] | 146 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure
As] |
157 'name': attribute.name, | 147 'name': attribute.name, |
158 'only_exposed_to_private_script': is_only_exposed_to_private_script, | 148 'only_exposed_to_private_script': is_only_exposed_to_private_script, |
159 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( | 149 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( |
160 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), | 150 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), |
161 'property_attributes': property_attributes(interface, attribute), | 151 'property_attributes': property_attributes(interface, attribute), |
162 'reflect_empty': extended_attributes.get('ReflectEmpty'), | 152 'reflect_empty': extended_attributes.get('ReflectEmpty'), |
163 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), | 153 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), |
164 'reflect_missing': extended_attributes.get('ReflectMissing'), | 154 'reflect_missing': extended_attributes.get('ReflectMissing'), |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 # FIXME: replace this with a [ConstructorAttribute] extended attribute | 516 # FIXME: replace this with a [ConstructorAttribute] extended attribute |
527 lambda self: strip_suffix(self.base_type, 'Constructor')) | 517 lambda self: strip_suffix(self.base_type, 'Constructor')) |
528 | 518 |
529 | 519 |
530 def is_constructor_attribute(attribute): | 520 def is_constructor_attribute(attribute): |
531 # FIXME: replace this with [ConstructorAttribute] extended attribute | 521 # FIXME: replace this with [ConstructorAttribute] extended attribute |
532 return attribute.idl_type.name.endswith('Constructor') | 522 return attribute.idl_type.name.endswith('Constructor') |
533 | 523 |
534 | 524 |
535 def update_constructor_attribute_context(interface, attribute, context): | 525 def update_constructor_attribute_context(interface, attribute, context): |
536 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] or context['origin_trial_name'] | 526 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] or context['origin_trial_enabled_function'] # TODO(chasej):
Should/can this be true when OriginTrialEnabled is inherited from containing in
terface? |
OLD | NEW |