| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 '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'), |
| 118 'is_check_security_for_frame': is_check_security_for_frame, | 118 'is_check_security_for_frame': is_check_security_for_frame, |
| 119 'is_check_security_for_node': is_check_security_for_node, | 119 'is_check_security_for_node': is_check_security_for_node, |
| 120 'is_check_security_for_window': is_check_security_for_window, | 120 'is_check_security_for_window': is_check_security_for_window, |
| 121 'is_custom_element_callbacks': is_custom_element_callbacks, | 121 'is_custom_element_callbacks': is_custom_element_callbacks, |
| 122 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute), | 122 'is_expose_js_accessors': is_expose_js_accessors(interface, attribute), |
| 123 'is_getter_raises_exception': # [RaisesException] | 123 'is_getter_raises_exception': # [RaisesException] |
| 124 'RaisesException' in extended_attributes and | 124 'RaisesException' in extended_attributes and |
| 125 extended_attributes['RaisesException'] in (None, 'Getter'), | 125 extended_attributes['RaisesException'] in (None, 'Getter'), |
| 126 'is_implemented_in_private_script': is_implemented_in_private_script, | 126 'is_implemented_in_private_script': is_implemented_in_private_script, |
| 127 'is_initialized_by_event_constructor': | |
| 128 'InitializedByEventConstructor' in extended_attributes, | |
| 129 'is_keep_alive_for_gc': keep_alive_for_gc, | 127 'is_keep_alive_for_gc': keep_alive_for_gc, |
| 130 'is_nullable': idl_type.is_nullable, | 128 'is_nullable': idl_type.is_nullable, |
| 131 'is_explicit_nullable': idl_type.is_explicit_nullable, | 129 'is_explicit_nullable': idl_type.is_explicit_nullable, |
| 132 'is_partial_interface_member': | 130 'is_partial_interface_member': |
| 133 'PartialInterfaceImplementedAs' in extended_attributes, | 131 'PartialInterfaceImplementedAs' in extended_attributes, |
| 134 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, | 132 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, |
| 135 'is_put_forwards': 'PutForwards' in extended_attributes, | 133 'is_put_forwards': 'PutForwards' in extended_attributes, |
| 136 'is_read_only': attribute.is_read_only, | 134 'is_read_only': attribute.is_read_only, |
| 137 'is_reflect': is_reflect, | 135 'is_reflect': is_reflect, |
| 138 'is_replaceable': 'Replaceable' in attribute.extended_attributes, | 136 'is_replaceable': 'Replaceable' in attribute.extended_attributes, |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 return attribute.idl_type.name.endswith('Constructor') | 539 return attribute.idl_type.name.endswith('Constructor') |
| 542 | 540 |
| 543 | 541 |
| 544 def update_constructor_attribute_context(interface, attribute, context): | 542 def update_constructor_attribute_context(interface, attribute, context): |
| 545 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 543 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| 546 # When the attribute name is the same as the interface name, do not generate | 544 # When the attribute name is the same as the interface name, do not generate |
| 547 # callback functions for each attribute and use | 545 # callback functions for each attribute and use |
| 548 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 546 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
| 549 # a callback function in order to hard-code the attribute name. | 547 # a callback function in order to hard-code the attribute name. |
| 550 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 548 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
| OLD | NEW |