| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 def interface_context(interface): | 75 def interface_context(interface): |
| 76 includes.clear() | 76 includes.clear() |
| 77 includes.update(INTERFACE_CPP_INCLUDES) | 77 includes.update(INTERFACE_CPP_INCLUDES) |
| 78 header_includes = set(INTERFACE_H_INCLUDES) | 78 header_includes = set(INTERFACE_H_INCLUDES) |
| 79 | 79 |
| 80 parent_interface = interface.parent | 80 parent_interface = interface.parent |
| 81 if parent_interface: | 81 if parent_interface: |
| 82 header_includes.update(v8_types.includes_for_interface(parent_interface)
) | 82 header_includes.update(v8_types.includes_for_interface(parent_interface)
) |
| 83 extended_attributes = interface.extended_attributes | 83 extended_attributes = interface.extended_attributes |
| 84 | 84 |
| 85 is_array_buffer_or_view = interface.idl_type.is_array_buffer_or_view |
| 86 is_typed_array_type = interface.idl_type.is_typed_array |
| 87 if is_array_buffer_or_view: |
| 88 includes.add('bindings/core/v8/V8ArrayBuffer.h') |
| 89 if interface.name == 'ArrayBuffer': |
| 90 includes.add('core/dom/DOMArrayBufferDeallocationObserver.h') |
| 91 if interface.name == 'ArrayBufferView': |
| 92 includes.update(( |
| 93 'bindings/core/v8/V8Int8Array.h', |
| 94 'bindings/core/v8/V8Int16Array.h', |
| 95 'bindings/core/v8/V8Int32Array.h', |
| 96 'bindings/core/v8/V8Uint8Array.h', |
| 97 'bindings/core/v8/V8Uint8ClampedArray.h', |
| 98 'bindings/core/v8/V8Uint16Array.h', |
| 99 'bindings/core/v8/V8Uint32Array.h', |
| 100 'bindings/core/v8/V8Float32Array.h', |
| 101 'bindings/core/v8/V8Float64Array.h', |
| 102 'bindings/core/v8/V8DataView.h')) |
| 103 |
| 85 # [ActiveDOMObject] | 104 # [ActiveDOMObject] |
| 86 is_active_dom_object = 'ActiveDOMObject' in extended_attributes | 105 is_active_dom_object = 'ActiveDOMObject' in extended_attributes |
| 87 | 106 |
| 88 # [CheckSecurity] | 107 # [CheckSecurity] |
| 89 is_check_security = 'CheckSecurity' in extended_attributes | 108 is_check_security = 'CheckSecurity' in extended_attributes |
| 90 if is_check_security: | 109 if is_check_security: |
| 91 includes.add('bindings/core/v8/BindingSecurity.h') | 110 includes.add('bindings/core/v8/BindingSecurity.h') |
| 92 | 111 |
| 93 # [DependentLifetime] | 112 # [DependentLifetime] |
| 94 is_dependent_lifetime = 'DependentLifetime' in extended_attributes | 113 is_dependent_lifetime = 'DependentLifetime' in extended_attributes |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 'has_access_check_callbacks': (is_check_security and | 169 'has_access_check_callbacks': (is_check_security and |
| 151 interface.name != 'Window' and | 170 interface.name != 'Window' and |
| 152 interface.name != 'EventTarget'), | 171 interface.name != 'EventTarget'), |
| 153 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] | 172 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] |
| 154 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
oV8'), # [Custom=ToV8] | 173 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
oV8'), # [Custom=ToV8] |
| 155 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr
ap'), # [Custom=Wrap] | 174 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr
ap'), # [Custom=Wrap] |
| 156 'has_visit_dom_wrapper': has_visit_dom_wrapper, | 175 'has_visit_dom_wrapper': has_visit_dom_wrapper, |
| 157 'header_includes': header_includes, | 176 'header_includes': header_includes, |
| 158 'interface_name': interface.name, | 177 'interface_name': interface.name, |
| 159 'is_active_dom_object': is_active_dom_object, | 178 'is_active_dom_object': is_active_dom_object, |
| 179 'is_array_buffer_or_view': is_array_buffer_or_view, |
| 160 'is_check_security': is_check_security, | 180 'is_check_security': is_check_security, |
| 161 'is_dependent_lifetime': is_dependent_lifetime, | 181 'is_dependent_lifetime': is_dependent_lifetime, |
| 162 'is_event_target': inherits_interface(interface.name, 'EventTarget'), | 182 'is_event_target': inherits_interface(interface.name, 'EventTarget'), |
| 163 'is_exception': interface.is_exception, | 183 'is_exception': interface.is_exception, |
| 164 'is_node': inherits_interface(interface.name, 'Node'), | 184 'is_node': inherits_interface(interface.name, 'Node'), |
| 165 'is_script_wrappable': is_script_wrappable, | 185 'is_script_wrappable': is_script_wrappable, |
| 186 'is_typed_array_type': is_typed_array_type, |
| 166 'iterator_method': iterator_method, | 187 'iterator_method': iterator_method, |
| 167 'lifetime': 'Dependent' | 188 'lifetime': 'Dependent' |
| 168 if (has_visit_dom_wrapper or | 189 if (has_visit_dom_wrapper or |
| 169 is_active_dom_object or | 190 is_active_dom_object or |
| 170 is_dependent_lifetime) | 191 is_dependent_lifetime) |
| 171 else 'Independent', | 192 else 'Independent', |
| 172 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] | 193 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] |
| 173 'parent_interface': parent_interface, | 194 'parent_interface': parent_interface, |
| 174 'pass_cpp_type': cpp_template_type( | 195 'pass_cpp_type': cpp_template_type( |
| 175 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type), | 196 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type), |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 deleter = next( | 1154 deleter = next( |
| 1134 method | 1155 method |
| 1135 for method in interface.operations | 1156 for method in interface.operations |
| 1136 if ('deleter' in method.specials and | 1157 if ('deleter' in method.specials and |
| 1137 len(method.arguments) == 1 and | 1158 len(method.arguments) == 1 and |
| 1138 str(method.arguments[0].idl_type) == 'DOMString')) | 1159 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1139 except StopIteration: | 1160 except StopIteration: |
| 1140 return None | 1161 return None |
| 1141 | 1162 |
| 1142 return property_deleter(deleter) | 1163 return property_deleter(deleter) |
| OLD | NEW |