| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 76     is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer') | 76     is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer') | 
| 77     if is_audio_buffer: | 77     if is_audio_buffer: | 
| 78         includes.add('modules/webaudio/AudioBuffer.h') | 78         includes.add('modules/webaudio/AudioBuffer.h') | 
| 79 | 79 | 
| 80     is_document = inherits_interface(interface.name, 'Document') | 80     is_document = inherits_interface(interface.name, 'Document') | 
| 81     if is_document: | 81     if is_document: | 
| 82         includes.update(['bindings/v8/ScriptController.h', | 82         includes.update(['bindings/v8/ScriptController.h', | 
| 83                          'bindings/v8/V8WindowShell.h', | 83                          'bindings/v8/V8WindowShell.h', | 
| 84                          'core/frame/LocalFrame.h']) | 84                          'core/frame/LocalFrame.h']) | 
| 85 | 85 | 
|  | 86     # [ActiveDOMObject] | 
|  | 87     is_active_dom_object = 'ActiveDOMObject' in extended_attributes | 
|  | 88 | 
| 86     # [CheckSecurity] | 89     # [CheckSecurity] | 
| 87     is_check_security = 'CheckSecurity' in extended_attributes | 90     is_check_security = 'CheckSecurity' in extended_attributes | 
| 88     if is_check_security: | 91     if is_check_security: | 
| 89         includes.add('bindings/v8/BindingSecurity.h') | 92         includes.add('bindings/v8/BindingSecurity.h') | 
| 90 | 93 | 
|  | 94     # [DependentLifetime] | 
|  | 95     is_dependent_lifetime = 'DependentLifetime' in extended_attributes | 
|  | 96 | 
| 91     # [MeasureAs] | 97     # [MeasureAs] | 
| 92     is_measure_as = 'MeasureAs' in extended_attributes | 98     is_measure_as = 'MeasureAs' in extended_attributes | 
| 93     if is_measure_as: | 99     if is_measure_as: | 
| 94         includes.add('core/frame/UseCounter.h') | 100         includes.add('core/frame/UseCounter.h') | 
| 95 | 101 | 
| 96     # [SetWrapperReferenceFrom] | 102     # [SetWrapperReferenceFrom] | 
| 97     reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom') | 103     reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom') | 
| 98     if reachable_node_function: | 104     if reachable_node_function: | 
| 99         includes.update(['bindings/v8/V8GCController.h', | 105         includes.update(['bindings/v8/V8GCController.h', | 
| 100                          'core/dom/Element.h']) | 106                          'core/dom/Element.h']) | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 117     if 'SpecialWrapFor' in extended_attributes: | 123     if 'SpecialWrapFor' in extended_attributes: | 
| 118         special_wrap_for = extended_attributes['SpecialWrapFor'].split('|') | 124         special_wrap_for = extended_attributes['SpecialWrapFor'].split('|') | 
| 119     else: | 125     else: | 
| 120         special_wrap_for = [] | 126         special_wrap_for = [] | 
| 121     for special_wrap_interface in special_wrap_for: | 127     for special_wrap_interface in special_wrap_for: | 
| 122         v8_types.add_includes_for_interface(special_wrap_interface) | 128         v8_types.add_includes_for_interface(special_wrap_interface) | 
| 123 | 129 | 
| 124     # [WillBeGarbageCollected] | 130     # [WillBeGarbageCollected] | 
| 125     is_will_be_garbage_collected = 'WillBeGarbageCollected' in extended_attribut
     es | 131     is_will_be_garbage_collected = 'WillBeGarbageCollected' in extended_attribut
     es | 
| 126 | 132 | 
|  | 133     # [Custom=Wrap], [SetWrapperReferenceFrom] | 
|  | 134     has_visit_dom_wrapper = ( | 
|  | 135         has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or | 
|  | 136         reachable_node_function or | 
|  | 137         set_wrapper_reference_to_list) | 
|  | 138 | 
| 127     template_contents = { | 139     template_contents = { | 
| 128         'conditional_string': conditional_string(interface),  # [Conditional] | 140         'conditional_string': conditional_string(interface),  # [Conditional] | 
| 129         'cpp_class': cpp_name(interface), | 141         'cpp_class': cpp_name(interface), | 
| 130         'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
     face, 'Custom', 'LegacyCallAsFunction'),  # [Custom=LegacyCallAsFunction] | 142         'has_custom_legacy_call_as_function': has_extended_attribute_value(inter
     face, 'Custom', 'LegacyCallAsFunction'),  # [Custom=LegacyCallAsFunction] | 
| 131         'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
     oV8'),  # [Custom=ToV8] | 143         'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T
     oV8'),  # [Custom=ToV8] | 
| 132         'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr
     ap'),  # [Custom=Wrap] | 144         'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr
     ap'),  # [Custom=Wrap] | 
| 133         'has_visit_dom_wrapper': ( | 145         'has_visit_dom_wrapper': has_visit_dom_wrapper, | 
| 134             # [Custom=Wrap], [SetWrapperReferenceFrom] |  | 
| 135             has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper')
      or |  | 
| 136             reachable_node_function or |  | 
| 137             set_wrapper_reference_to_list), |  | 
| 138         'header_includes': header_includes, | 146         'header_includes': header_includes, | 
| 139         'interface_name': interface.name, | 147         'interface_name': interface.name, | 
| 140         'is_active_dom_object': 'ActiveDOMObject' in extended_attributes,  # [Ac
     tiveDOMObject] | 148         'is_active_dom_object': is_active_dom_object, | 
| 141         'is_audio_buffer': is_audio_buffer, | 149         'is_audio_buffer': is_audio_buffer, | 
| 142         'is_check_security': is_check_security, | 150         'is_check_security': is_check_security, | 
| 143         'is_dependent_lifetime': 'DependentLifetime' in extended_attributes,  # 
     [DependentLifetime] | 151         'is_dependent_lifetime': is_dependent_lifetime, | 
| 144         'is_document': is_document, | 152         'is_document': is_document, | 
| 145         'is_event_target': inherits_interface(interface.name, 'EventTarget'), | 153         'is_event_target': inherits_interface(interface.name, 'EventTarget'), | 
| 146         'is_exception': interface.is_exception, | 154         'is_exception': interface.is_exception, | 
| 147         'is_will_be_garbage_collected': is_will_be_garbage_collected, | 155         'is_will_be_garbage_collected': is_will_be_garbage_collected, | 
| 148         'is_node': inherits_interface(interface.name, 'Node'), | 156         'is_node': inherits_interface(interface.name, 'Node'), | 
| 149         'measure_as': v8_utilities.measure_as(interface),  # [MeasureAs] | 157         'measure_as': v8_utilities.measure_as(interface),  # [MeasureAs] | 
| 150         'parent_interface': parent_interface, | 158         'parent_interface': parent_interface, | 
| 151         'pass_ref_ptr': 'PassRefPtrWillBeRawPtr' | 159         'pass_ref_ptr': 'PassRefPtrWillBeRawPtr' | 
| 152                         if is_will_be_garbage_collected else 'PassRefPtr', | 160                         if is_will_be_garbage_collected else 'PassRefPtr', | 
| 153         'reachable_node_function': reachable_node_function, | 161         'reachable_node_function': reachable_node_function, | 
| 154         'ref_ptr': 'RefPtrWillBeRawPtr' | 162         'ref_ptr': 'RefPtrWillBeRawPtr' | 
| 155                    if is_will_be_garbage_collected else 'RefPtr', | 163                    if is_will_be_garbage_collected else 'RefPtr', | 
| 156         'runtime_enabled_function': runtime_enabled_function_name(interface),  #
      [RuntimeEnabled] | 164         'runtime_enabled_function': runtime_enabled_function_name(interface),  #
      [RuntimeEnabled] | 
| 157         'set_wrapper_reference_to_list': set_wrapper_reference_to_list, | 165         'set_wrapper_reference_to_list': set_wrapper_reference_to_list, | 
| 158         'special_wrap_for': special_wrap_for, | 166         'special_wrap_for': special_wrap_for, | 
| 159         'v8_class': v8_utilities.v8_class_name(interface), | 167         'v8_class': v8_utilities.v8_class_name(interface), | 
|  | 168         'wrapper_configuration': 'WrapperConfiguration::Dependent' | 
|  | 169             if (has_visit_dom_wrapper or | 
|  | 170                 is_active_dom_object or | 
|  | 171                 is_dependent_lifetime) | 
|  | 172             else 'WrapperConfiguration::Independent', | 
| 160     } | 173     } | 
| 161 | 174 | 
| 162     # Constructors | 175     # Constructors | 
| 163     constructors = [generate_constructor(interface, constructor) | 176     constructors = [generate_constructor(interface, constructor) | 
| 164                     for constructor in interface.constructors | 177                     for constructor in interface.constructors | 
| 165                     # FIXME: shouldn't put named constructors with constructors | 178                     # FIXME: shouldn't put named constructors with constructors | 
| 166                     # (currently needed for Perl compatibility) | 179                     # (currently needed for Perl compatibility) | 
| 167                     # Handle named constructors separately | 180                     # Handle named constructors separately | 
| 168                     if constructor.name == 'Constructor'] | 181                     if constructor.name == 'Constructor'] | 
| 169     generate_constructor_overloads(constructors) | 182     generate_constructor_overloads(constructors) | 
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 710         deleter = next( | 723         deleter = next( | 
| 711             method | 724             method | 
| 712             for method in interface.operations | 725             for method in interface.operations | 
| 713             if ('deleter' in method.specials and | 726             if ('deleter' in method.specials and | 
| 714                 len(method.arguments) == 1 and | 727                 len(method.arguments) == 1 and | 
| 715                 str(method.arguments[0].idl_type) == 'DOMString')) | 728                 str(method.arguments[0].idl_type) == 'DOMString')) | 
| 716     except StopIteration: | 729     except StopIteration: | 
| 717         return None | 730         return None | 
| 718 | 731 | 
| 719     return property_deleter(deleter) | 732     return property_deleter(deleter) | 
| OLD | NEW | 
|---|