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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 def generate_interface(interface): | 62 def generate_interface(interface): |
63 includes.clear() | 63 includes.clear() |
64 includes.update(INTERFACE_CPP_INCLUDES) | 64 includes.update(INTERFACE_CPP_INCLUDES) |
65 header_includes = INTERFACE_H_INCLUDES | 65 header_includes = INTERFACE_H_INCLUDES |
66 | 66 |
67 parent_interface = interface.parent | 67 parent_interface = interface.parent |
68 if parent_interface: | 68 if parent_interface: |
69 header_includes.update(v8_types.includes_for_type(parent_interface)) | 69 header_includes.update(v8_types.includes_for_type(parent_interface)) |
70 extended_attributes = interface.extended_attributes | 70 extended_attributes = interface.extended_attributes |
71 | 71 |
| 72 is_audio_buffer = inherits_interface(interface, 'AudioBuffer') |
| 73 if is_audio_buffer: |
| 74 includes.add('modules/webaudio/AudioBuffer.h') |
| 75 |
72 # [CheckSecurity] | 76 # [CheckSecurity] |
73 is_check_security = 'CheckSecurity' in extended_attributes | 77 is_check_security = 'CheckSecurity' in extended_attributes |
74 if is_check_security: | 78 if is_check_security: |
75 includes.add('bindings/v8/BindingSecurity.h') | 79 includes.add('bindings/v8/BindingSecurity.h') |
76 | 80 |
77 # [GenerateVisitDOMWrapper] | 81 # [GenerateVisitDOMWrapper] |
78 reachable_node_function = extended_attributes.get('GenerateVisitDOMWrapper') | 82 reachable_node_function = extended_attributes.get('GenerateVisitDOMWrapper') |
79 if reachable_node_function: | 83 if reachable_node_function: |
80 includes.update(['bindings/v8/V8GCController.h', | 84 includes.update(['bindings/v8/V8GCController.h', |
81 'core/dom/Element.h']) | 85 'core/dom/Element.h']) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 'has_event_constructor': has_event_constructor, | 149 'has_event_constructor': has_event_constructor, |
146 'has_visit_dom_wrapper': ( | 150 'has_visit_dom_wrapper': ( |
147 # [Custom=Wrap], [GenerateVisitDOMWrapper] | 151 # [Custom=Wrap], [GenerateVisitDOMWrapper] |
148 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper')
or | 152 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper')
or |
149 reachable_node_function or set_reference_list), | 153 reachable_node_function or set_reference_list), |
150 'header_includes': header_includes, | 154 'header_includes': header_includes, |
151 'interface_length': | 155 'interface_length': |
152 interface_length(interface, constructors + custom_constructors), | 156 interface_length(interface, constructors + custom_constructors), |
153 'interface_name': interface.name, | 157 'interface_name': interface.name, |
154 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac
tiveDOMObject] | 158 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac
tiveDOMObject] |
| 159 'is_audio_buffer': is_audio_buffer, |
155 'is_check_security': is_check_security, | 160 'is_check_security': is_check_security, |
156 'is_constructor_call_with_document': has_extended_attribute_value( | 161 'is_constructor_call_with_document': has_extended_attribute_value( |
157 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi
th=Document] | 162 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi
th=Document] |
158 'is_constructor_call_with_execution_context': has_extended_attribute_val
ue( | 163 'is_constructor_call_with_execution_context': has_extended_attribute_val
ue( |
159 interface, 'ConstructorCallWith', 'ExecutionContext'), # [Construct
orCallWith=ExeuctionContext] | 164 interface, 'ConstructorCallWith', 'ExecutionContext'), # [Construct
orCallWith=ExeuctionContext] |
160 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept
ion') == 'Constructor', # [RaisesException=Constructor] | 165 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept
ion') == 'Constructor', # [RaisesException=Constructor] |
161 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, #
[DependentLifetime] | 166 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, #
[DependentLifetime] |
162 'is_event_target': inherits_interface(interface, 'EventTarget'), | 167 'is_event_target': inherits_interface(interface, 'EventTarget'), |
163 'is_exception': interface.is_exception, | 168 'is_exception': interface.is_exception, |
164 'is_node': inherits_interface(interface, 'Node'), | 169 'is_node': inherits_interface(interface, 'Node'), |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 return min(constructor['number_of_required_arguments'] | 436 return min(constructor['number_of_required_arguments'] |
432 for constructor in constructors) | 437 for constructor in constructors) |
433 | 438 |
434 | 439 |
435 # Interface dependencies | 440 # Interface dependencies |
436 | 441 |
437 def inherits_interface(interface, ancestor): | 442 def inherits_interface(interface, ancestor): |
438 # FIXME: support distant ancestors (but don't parse all ancestors!) | 443 # FIXME: support distant ancestors (but don't parse all ancestors!) |
439 # Do by computing ancestor chain in compute_dependencies.py | 444 # Do by computing ancestor chain in compute_dependencies.py |
440 return ancestor in [interface.name, interface.parent] | 445 return ancestor in [interface.name, interface.parent] |
OLD | NEW |