Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: Source/bindings/scripts/unstable/v8_interface.py

Issue 134683007: IDL compiler: sync Python to r166680 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Order Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/Frame.h']) 84 'core/frame/Frame.h'])
85 85
86 # [CheckSecurity] 86 # [CheckSecurity]
87 is_check_security = 'CheckSecurity' in extended_attributes 87 is_check_security = 'CheckSecurity' in extended_attributes
88 if is_check_security: 88 if is_check_security:
89 includes.add('bindings/v8/BindingSecurity.h') 89 includes.add('bindings/v8/BindingSecurity.h')
90 90
91 # [GarbageCollected]
92 is_garbage_collected = 'GarbageCollected' in extended_attributes
93
94 # [MeasureAs] 91 # [MeasureAs]
95 is_measure_as = 'MeasureAs' in extended_attributes 92 is_measure_as = 'MeasureAs' in extended_attributes
96 if is_measure_as: 93 if is_measure_as:
97 includes.add('core/frame/UseCounter.h') 94 includes.add('core/frame/UseCounter.h')
98 95
99 # [SetWrapperReferenceFrom] 96 # [SetWrapperReferenceFrom]
100 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom') 97 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
101 if reachable_node_function: 98 if reachable_node_function:
102 includes.update(['bindings/v8/V8GCController.h', 99 includes.update(['bindings/v8/V8GCController.h',
103 'core/dom/Element.h']) 100 'core/dom/Element.h'])
104 101
105 # [SetWrapperReferenceTo] 102 # [SetWrapperReferenceTo]
106 set_wrapper_reference_to_list = [{ 103 set_wrapper_reference_to_list = [{
107 'name': argument.name, 104 'name': argument.name,
108 'idl_type': argument.idl_type, 105 'idl_type': argument.idl_type,
109 'v8_type': v8_types.v8_type(argument.idl_type), 106 'v8_type': v8_types.v8_type(argument.idl_type),
110 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])] 107 } for argument in extended_attributes.get('SetWrapperReferenceTo', [])]
111 for set_wrapper_reference_to in set_wrapper_reference_to_list: 108 for set_wrapper_reference_to in set_wrapper_reference_to_list:
112 v8_types.add_includes_for_type(set_wrapper_reference_to['idl_type']) 109 v8_types.add_includes_for_type(set_wrapper_reference_to['idl_type'])
113 110
114 # [SpecialWrapFor] 111 # [SpecialWrapFor]
115 if 'SpecialWrapFor' in extended_attributes: 112 if 'SpecialWrapFor' in extended_attributes:
116 special_wrap_for = extended_attributes['SpecialWrapFor'].split('|') 113 special_wrap_for = extended_attributes['SpecialWrapFor'].split('|')
117 else: 114 else:
118 special_wrap_for = [] 115 special_wrap_for = []
119 for special_wrap_interface in special_wrap_for: 116 for special_wrap_interface in special_wrap_for:
120 v8_types.add_includes_for_type(special_wrap_interface) 117 v8_types.add_includes_for_type(special_wrap_interface)
121 118
119 # [WillBeGarbageCollected]
120 is_will_be_garbage_collected = 'WillBeGarbageCollected' in extended_attribut es
121
122 template_contents = { 122 template_contents = {
123 'conditional_string': conditional_string(interface), # [Conditional] 123 'conditional_string': conditional_string(interface), # [Conditional]
124 'cpp_class': cpp_name(interface), 124 'cpp_class': cpp_name(interface),
125 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] 125 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
126 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T oV8'), # [Custom=ToV8] 126 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T oV8'), # [Custom=ToV8]
127 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr ap'), # [Custom=Wrap] 127 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr ap'), # [Custom=Wrap]
128 'has_visit_dom_wrapper': ( 128 'has_visit_dom_wrapper': (
129 # [Custom=Wrap], [SetWrapperReferenceFrom] 129 # [Custom=Wrap], [SetWrapperReferenceFrom]
130 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or 130 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
131 reachable_node_function or set_wrapper_reference_to_list), 131 reachable_node_function or set_wrapper_reference_to_list),
132 'header_includes': header_includes, 132 'header_includes': header_includes,
133 'interface_name': interface.name, 133 'interface_name': interface.name,
134 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject] 134 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject]
135 'is_audio_buffer': is_audio_buffer, 135 'is_audio_buffer': is_audio_buffer,
136 'is_check_security': is_check_security, 136 'is_check_security': is_check_security,
137 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime] 137 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime]
138 'is_document': is_document, 138 'is_document': is_document,
139 'is_event_target': inherits_interface(interface.name, 'EventTarget'), 139 'is_event_target': inherits_interface(interface.name, 'EventTarget'),
140 'is_exception': interface.is_exception, 140 'is_exception': interface.is_exception,
141 'is_garbage_collected': is_garbage_collected, 141 'is_will_be_garbage_collected': is_will_be_garbage_collected,
142 'is_node': inherits_interface(interface.name, 'Node'), 142 'is_node': inherits_interface(interface.name, 'Node'),
143 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] 143 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
144 'parent_interface': parent_interface, 144 'parent_interface': parent_interface,
145 'pass_ref_ptr': 'PassRefPtrWillBeRawPtr' if is_garbage_collected else 145 'pass_ref_ptr': 'PassRefPtrWillBeRawPtr'
146 'PassRefPtr', 146 if is_will_be_garbage_collected else 'PassRefPtr',
147 'reachable_node_function': reachable_node_function, 147 'reachable_node_function': reachable_node_function,
148 'ref_ptr': 'RefPtrWillBeRawPtr' if is_garbage_collected else 'RefPtr', 148 'ref_ptr': 'RefPtrWillBeRawPtr'
149 if is_will_be_garbage_collected else 'RefPtr',
149 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled] 150 'runtime_enabled_function': runtime_enabled_function_name(interface), # [RuntimeEnabled]
150 'set_wrapper_reference_to_list': set_wrapper_reference_to_list, 151 'set_wrapper_reference_to_list': set_wrapper_reference_to_list,
151 'special_wrap_for': special_wrap_for, 152 'special_wrap_for': special_wrap_for,
152 'v8_class': v8_utilities.v8_class_name(interface), 153 'v8_class': v8_utilities.v8_class_name(interface),
153 } 154 }
154 155
155 # Constructors 156 # Constructors
156 constructors = [generate_constructor(interface, constructor) 157 constructors = [generate_constructor(interface, constructor)
157 for constructor in interface.constructors 158 for constructor in interface.constructors
158 # FIXME: shouldn't put named constructors with constructors 159 # FIXME: shouldn't put named constructors with constructors
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 deleter = next( 709 deleter = next(
709 method 710 method
710 for method in interface.operations 711 for method in interface.operations
711 if ('deleter' in method.specials and 712 if ('deleter' in method.specials and
712 len(method.arguments) == 1 and 713 len(method.arguments) == 1 and
713 method.arguments[0].idl_type == 'DOMString')) 714 method.arguments[0].idl_type == 'DOMString'))
714 except StopIteration: 715 except StopIteration:
715 return None 716 return None
716 717
717 return property_deleter(deleter) 718 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/code_generator_v8.py ('k') | Source/bindings/scripts/unstable/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698