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 'has_custom_setter': has_custom_setter(attribute), | 117 'has_custom_setter': has_custom_setter(attribute), |
118 'has_setter': has_setter(attribute), | 118 'has_setter': has_setter(attribute), |
119 'idl_type': str(idl_type), # need trailing [] on array for Dictionary::
ConversionContext::setConversionType | 119 'idl_type': str(idl_type), # need trailing [] on array for Dictionary::
ConversionContext::setConversionType |
120 'is_call_with_execution_context': has_extended_attribute_value(attribute
, 'CallWith', 'ExecutionContext'), | 120 'is_call_with_execution_context': has_extended_attribute_value(attribute
, 'CallWith', 'ExecutionContext'), |
121 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca
llWith', 'ScriptState'), | 121 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca
llWith', 'ScriptState'), |
122 'is_check_security_for_frame': is_check_security_for_frame, | 122 'is_check_security_for_frame': is_check_security_for_frame, |
123 'is_check_security_for_node': is_check_security_for_node, | 123 'is_check_security_for_node': is_check_security_for_node, |
124 'is_check_security_for_window': is_check_security_for_window, | 124 'is_check_security_for_window': is_check_security_for_window, |
125 'is_custom_element_callbacks': is_custom_element_callbacks, | 125 'is_custom_element_callbacks': is_custom_element_callbacks, |
126 # TODO(yukishiino): Make all DOM attributes accessor-type properties. | 126 # TODO(yukishiino): Make all DOM attributes accessor-type properties. |
127 'is_data_type_property': constructor_type or interface.name == 'Window'
or interface.name == 'Location' or (interface.name == 'Event' and attribute.name
== 'isTrusted'), | 127 'is_data_type_property': constructor_type or interface.name == 'Window'
or interface.name == 'Location', |
128 'is_getter_raises_exception': # [RaisesException] | 128 'is_getter_raises_exception': # [RaisesException] |
129 'RaisesException' in extended_attributes and | 129 'RaisesException' in extended_attributes and |
130 extended_attributes['RaisesException'] in (None, 'Getter'), | 130 extended_attributes['RaisesException'] in (None, 'Getter'), |
131 'is_implemented_in_private_script': is_implemented_in_private_script, | 131 'is_implemented_in_private_script': is_implemented_in_private_script, |
132 'is_keep_alive_for_gc': keep_alive_for_gc, | 132 'is_keep_alive_for_gc': keep_alive_for_gc, |
133 'is_lenient_this': 'LenientThis' in extended_attributes, | 133 'is_lenient_this': 'LenientThis' in extended_attributes, |
134 'is_nullable': idl_type.is_nullable, | 134 'is_nullable': idl_type.is_nullable, |
135 'is_explicit_nullable': idl_type.is_explicit_nullable, | 135 'is_explicit_nullable': idl_type.is_explicit_nullable, |
136 'is_partial_interface_member': | 136 'is_partial_interface_member': |
137 'PartialInterfaceImplementedAs' in extended_attributes, | 137 'PartialInterfaceImplementedAs' in extended_attributes, |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return attribute.idl_type.name.endswith('Constructor') | 508 return attribute.idl_type.name.endswith('Constructor') |
509 | 509 |
510 | 510 |
511 def update_constructor_attribute_context(interface, attribute, context): | 511 def update_constructor_attribute_context(interface, attribute, context): |
512 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 512 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
513 # When the attribute name is the same as the interface name, do not generate | 513 # When the attribute name is the same as the interface name, do not generate |
514 # callback functions for each attribute and use | 514 # callback functions for each attribute and use |
515 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 515 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
516 # a callback function in order to hard-code the attribute name. | 516 # a callback function in order to hard-code the attribute name. |
517 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 517 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
OLD | NEW |