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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 'is_read_only': attribute.is_read_only, | 135 'is_read_only': attribute.is_read_only, |
136 'is_reflect': is_reflect, | 136 'is_reflect': is_reflect, |
137 'is_replaceable': 'Replaceable' in attribute.extended_attributes, | 137 'is_replaceable': 'Replaceable' in attribute.extended_attributes, |
138 'is_static': attribute.is_static, | 138 'is_static': attribute.is_static, |
139 'is_url': 'URL' in extended_attributes, | 139 'is_url': 'URL' in extended_attributes, |
140 'is_unforgeable': is_unforgeable(interface, attribute), | 140 'is_unforgeable': is_unforgeable(interface, attribute), |
141 'on_instance': v8_utilities.on_instance(interface, attribute), | 141 'on_instance': v8_utilities.on_instance(interface, attribute), |
142 'on_interface': v8_utilities.on_interface(interface, attribute), | 142 'on_interface': v8_utilities.on_interface(interface, attribute), |
143 'on_prototype': v8_utilities.on_prototype(interface, attribute), | 143 'on_prototype': v8_utilities.on_prototype(interface, attribute), |
144 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(attribute), # [OriginTrialEnabled] | 144 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(attribute), # [OriginTrialEnabled] |
| 145 'origin_trial_feature_name': v8_utilities.origin_trial_feature_name(attr
ibute), # [OriginTrialEnabled] |
145 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, | 146 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, |
146 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure
As] | 147 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure
As] |
147 'name': attribute.name, | 148 'name': attribute.name, |
148 'only_exposed_to_private_script': is_only_exposed_to_private_script, | 149 'only_exposed_to_private_script': is_only_exposed_to_private_script, |
149 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( | 150 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( |
150 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), | 151 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), |
151 'property_attributes': property_attributes(interface, attribute), | 152 'property_attributes': property_attributes(interface, attribute), |
152 'reflect_empty': extended_attributes.get('ReflectEmpty'), | 153 'reflect_empty': extended_attributes.get('ReflectEmpty'), |
153 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), | 154 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), |
154 'reflect_missing': extended_attributes.get('ReflectMissing'), | 155 'reflect_missing': extended_attributes.get('ReflectMissing'), |
(...skipping 13 matching lines...) Expand all Loading... |
168 getter_context(interface, attribute, context) | 169 getter_context(interface, attribute, context) |
169 if not has_custom_setter(attribute) and has_setter(interface, attribute): | 170 if not has_custom_setter(attribute) and has_setter(interface, attribute): |
170 setter_context(interface, attribute, context) | 171 setter_context(interface, attribute, context) |
171 | 172 |
172 return context | 173 return context |
173 | 174 |
174 | 175 |
175 def filter_has_accessor_configuration(attributes): | 176 def filter_has_accessor_configuration(attributes): |
176 return [attribute for attribute in attributes if | 177 return [attribute for attribute in attributes if |
177 not (attribute['exposed_test'] or | 178 not (attribute['exposed_test'] or |
| 179 attribute['origin_trial_enabled_function'] or |
178 attribute['runtime_enabled_function']) and | 180 attribute['runtime_enabled_function']) and |
179 not attribute['is_data_type_property'] and | 181 not attribute['is_data_type_property'] and |
180 attribute['should_be_exposed_to_script']] | 182 attribute['should_be_exposed_to_script']] |
181 | 183 |
182 | 184 |
183 def filter_has_attribute_configuration(attributes): | 185 def filter_has_attribute_configuration(attributes): |
184 return [attribute for attribute in attributes if | 186 return [attribute for attribute in attributes if |
185 not (attribute['exposed_test'] or | 187 not (attribute['exposed_test'] or |
| 188 attribute['origin_trial_enabled_function'] or |
186 attribute['runtime_enabled_function']) and | 189 attribute['runtime_enabled_function']) and |
187 attribute['is_data_type_property'] and | 190 attribute['is_data_type_property'] and |
188 attribute['should_be_exposed_to_script']] | 191 attribute['should_be_exposed_to_script']] |
189 | 192 |
190 | 193 |
| 194 def filter_origin_trial_enabled(attributes): |
| 195 return [attribute for attribute in attributes if |
| 196 attribute['origin_trial_feature_name'] and |
| 197 not attribute['exposed_test']] |
| 198 |
| 199 |
191 def filter_runtime_enabled(attributes): | 200 def filter_runtime_enabled(attributes): |
192 return [attribute for attribute in attributes if | 201 return [attribute for attribute in attributes if |
193 attribute['runtime_feature_name'] and | 202 attribute['runtime_feature_name'] and |
194 not attribute['exposed_test']] | 203 not attribute['exposed_test']] |
195 | 204 |
196 | 205 |
197 def attribute_filters(): | 206 def attribute_filters(): |
198 return {'has_accessor_configuration': filter_has_accessor_configuration, | 207 return {'has_accessor_configuration': filter_has_accessor_configuration, |
199 'has_attribute_configuration': filter_has_attribute_configuration, | 208 'has_attribute_configuration': filter_has_attribute_configuration, |
| 209 'origin_trial_enabled_attributes': filter_origin_trial_enabled, |
200 'runtime_enabled_attributes': filter_runtime_enabled, | 210 'runtime_enabled_attributes': filter_runtime_enabled, |
201 } | 211 } |
202 | 212 |
203 | 213 |
204 ################################################################################ | 214 ################################################################################ |
205 # Getter | 215 # Getter |
206 ################################################################################ | 216 ################################################################################ |
207 | 217 |
208 def getter_context(interface, attribute, context): | 218 def getter_context(interface, attribute, context): |
209 idl_type = attribute.idl_type | 219 idl_type = attribute.idl_type |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 lambda self: strip_suffix(self.base_type, 'Constructor')) | 553 lambda self: strip_suffix(self.base_type, 'Constructor')) |
544 | 554 |
545 | 555 |
546 def is_constructor_attribute(attribute): | 556 def is_constructor_attribute(attribute): |
547 # FIXME: replace this with [ConstructorAttribute] extended attribute | 557 # FIXME: replace this with [ConstructorAttribute] extended attribute |
548 return attribute.idl_type.name.endswith('Constructor') | 558 return attribute.idl_type.name.endswith('Constructor') |
549 | 559 |
550 | 560 |
551 def update_constructor_attribute_context(interface, attribute, context): | 561 def update_constructor_attribute_context(interface, attribute, context): |
552 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? | 562 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 |