| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 else ['']), # [PerWorldBindings] | 175 else ['']), # [PerWorldBindings] |
| 176 } | 176 } |
| 177 | 177 |
| 178 if is_constructor_attribute(attribute): | 178 if is_constructor_attribute(attribute): |
| 179 update_constructor_attribute_context(interface, attribute, context) | 179 update_constructor_attribute_context(interface, attribute, context) |
| 180 if not has_custom_getter(attribute): | 180 if not has_custom_getter(attribute): |
| 181 getter_context(interface, attribute, context) | 181 getter_context(interface, attribute, context) |
| 182 if not has_custom_setter(attribute) and has_setter(interface, attribute): | 182 if not has_custom_setter(attribute) and has_setter(interface, attribute): |
| 183 setter_context(interface, attribute, context) | 183 setter_context(interface, attribute, context) |
| 184 | 184 |
| 185 # [OriginTrialEnabled] | |
| 186 # TODO(iclelland): Allow origin trials on static interfaces | |
| 187 # (crbug.com/614352) | |
| 188 if context['origin_trial_feature_name'] and context['on_interface']: | |
| 189 raise Exception('[OriginTrialEnabled] cannot be specified on static ' | |
| 190 'attributes: %s.%s' % (interface.name, attribute.name)) | |
| 191 | |
| 192 return context | 185 return context |
| 193 | 186 |
| 194 | 187 |
| 195 def filter_has_accessor_configuration(attributes): | 188 def filter_has_accessor_configuration(attributes): |
| 196 return [attribute for attribute in attributes if | 189 return [attribute for attribute in attributes if |
| 197 not (attribute['exposed_test'] or | 190 not (attribute['exposed_test'] or |
| 198 attribute['origin_trial_enabled_function'] or | 191 attribute['origin_trial_enabled_function'] or |
| 199 attribute['runtime_enabled_function']) and | 192 attribute['runtime_enabled_function']) and |
| 200 not attribute['is_data_type_property'] and | 193 not attribute['is_data_type_property'] and |
| 201 attribute['should_be_exposed_to_script']] | 194 attribute['should_be_exposed_to_script']] |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 lambda self: strip_suffix(self.base_type, 'Constructor')) | 564 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 572 | 565 |
| 573 | 566 |
| 574 def is_constructor_attribute(attribute): | 567 def is_constructor_attribute(attribute): |
| 575 # FIXME: replace this with [ConstructorAttribute] extended attribute | 568 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 576 return attribute.idl_type.name.endswith('Constructor') | 569 return attribute.idl_type.name.endswith('Constructor') |
| 577 | 570 |
| 578 | 571 |
| 579 def update_constructor_attribute_context(interface, attribute, context): | 572 def update_constructor_attribute_context(interface, attribute, context): |
| 580 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 573 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |