OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # coding=utf-8 | 2 # coding=utf-8 |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 'cpp_type': argument.idl_type.implemented_as + '*', | 159 'cpp_type': argument.idl_type.implemented_as + '*', |
160 'idl_type': argument.idl_type, | 160 'idl_type': argument.idl_type, |
161 'v8_type': v8_types.v8_type(argument.idl_type.name), | 161 'v8_type': v8_types.v8_type(argument.idl_type.name), |
162 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] | 162 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] |
163 for set_wrapper_reference_to in set_wrapper_reference_to_list: | 163 for set_wrapper_reference_to in set_wrapper_reference_to_list: |
164 set_wrapper_reference_to['idl_type'].add_includes_for_type() | 164 set_wrapper_reference_to['idl_type'].add_includes_for_type() |
165 | 165 |
166 # [NotScriptWrappable] | 166 # [NotScriptWrappable] |
167 is_script_wrappable = 'NotScriptWrappable' not in extended_attributes | 167 is_script_wrappable = 'NotScriptWrappable' not in extended_attributes |
168 | 168 |
169 # [Custom=Wrap], [SetWrapperReferenceFrom] | 169 # [SetWrapperReferenceFrom] |
170 has_visit_dom_wrapper = ( | 170 has_visit_dom_wrapper = ( |
171 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or | 171 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or |
172 reachable_node_function or | 172 reachable_node_function or |
173 set_wrapper_reference_to_list) | 173 set_wrapper_reference_to_list) |
174 | 174 |
175 this_gc_type = gc_type(interface) | 175 this_gc_type = gc_type(interface) |
176 | 176 |
177 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod
e') else 'ObjectClassId') | 177 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod
e') else 'ObjectClassId') |
178 | 178 |
179 v8_class_name = v8_utilities.v8_class_name(interface) | 179 v8_class_name = v8_utilities.v8_class_name(interface) |
180 cpp_class_name = cpp_name(interface) | 180 cpp_class_name = cpp_name(interface) |
181 cpp_class_name_or_partial = cpp_name_or_partial(interface) | 181 cpp_class_name_or_partial = cpp_name_or_partial(interface) |
182 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) | 182 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) |
183 | 183 |
184 context = { | 184 context = { |
185 'conditional_string': conditional_string(interface), # [Conditional] | 185 'conditional_string': conditional_string(interface), # [Conditional] |
186 'cpp_class': cpp_class_name, | 186 'cpp_class': cpp_class_name, |
187 'cpp_class_or_partial': cpp_class_name_or_partial, | 187 'cpp_class_or_partial': cpp_class_name_or_partial, |
188 'gc_type': this_gc_type, | 188 'gc_type': this_gc_type, |
189 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 | 189 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 |
190 'has_access_check_callbacks': (is_check_security and | 190 'has_access_check_callbacks': (is_check_security and |
191 interface.name != 'Window' and | 191 interface.name != 'Window' and |
192 interface.name != 'EventTarget'), | 192 interface.name != 'EventTarget'), |
193 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] | 193 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] |
194 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
oV8'), # [Custom=ToV8] | 194 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
oV8'), # [Custom=ToV8] |
195 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr
ap'), # [Custom=Wrap] | |
196 'has_partial_interface': len(interface.partial_interfaces) > 0, | 195 'has_partial_interface': len(interface.partial_interfaces) > 0, |
197 'has_visit_dom_wrapper': has_visit_dom_wrapper, | 196 'has_visit_dom_wrapper': has_visit_dom_wrapper, |
198 'header_includes': header_includes, | 197 'header_includes': header_includes, |
199 'interface_name': interface.name, | 198 'interface_name': interface.name, |
200 'is_active_dom_object': is_active_dom_object, | 199 'is_active_dom_object': is_active_dom_object, |
201 'is_array_buffer_or_view': is_array_buffer_or_view, | 200 'is_array_buffer_or_view': is_array_buffer_or_view, |
202 'is_check_security': is_check_security, | 201 'is_check_security': is_check_security, |
203 'is_dependent_lifetime': is_dependent_lifetime, | 202 'is_dependent_lifetime': is_dependent_lifetime, |
204 'is_event_target': is_event_target, | 203 'is_event_target': is_event_target, |
205 'is_exception': interface.is_exception, | 204 'is_exception': interface.is_exception, |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 deleter = next( | 1238 deleter = next( |
1240 method | 1239 method |
1241 for method in interface.operations | 1240 for method in interface.operations |
1242 if ('deleter' in method.specials and | 1241 if ('deleter' in method.specials and |
1243 len(method.arguments) == 1 and | 1242 len(method.arguments) == 1 and |
1244 str(method.arguments[0].idl_type) == 'DOMString')) | 1243 str(method.arguments[0].idl_type) == 'DOMString')) |
1245 except StopIteration: | 1244 except StopIteration: |
1246 return None | 1245 return None |
1247 | 1246 |
1248 return property_deleter(deleter) | 1247 return property_deleter(deleter) |
OLD | NEW |