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

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

Issue 483163003: Introduce ES6 iterator for DOM objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 is_active_dom_object = 'ActiveDOMObject' in extended_attributes 96 is_active_dom_object = 'ActiveDOMObject' in extended_attributes
97 97
98 # [CheckSecurity] 98 # [CheckSecurity]
99 is_check_security = 'CheckSecurity' in extended_attributes 99 is_check_security = 'CheckSecurity' in extended_attributes
100 if is_check_security: 100 if is_check_security:
101 includes.add('bindings/core/v8/BindingSecurity.h') 101 includes.add('bindings/core/v8/BindingSecurity.h')
102 102
103 # [DependentLifetime] 103 # [DependentLifetime]
104 is_dependent_lifetime = 'DependentLifetime' in extended_attributes 104 is_dependent_lifetime = 'DependentLifetime' in extended_attributes
105 105
106 # [Iterable]
107 iterator_method = None
108 if 'Iterable' in extended_attributes:
109 iterator_operation = IdlOperation(interface.idl_name)
110 iterator_operation.name = 'iterator'
111 iterator_operation.idl_type = IdlType('Iterator')
112 iterator_operation.extended_attributes['RaisesException'] = None
113 iterator_operation.extended_attributes['CallWith'] = 'ScriptState'
114 iterator_method = v8_methods.method_context(interface,
115 iterator_operation)
116
106 # [MeasureAs] 117 # [MeasureAs]
107 is_measure_as = 'MeasureAs' in extended_attributes 118 is_measure_as = 'MeasureAs' in extended_attributes
108 if is_measure_as: 119 if is_measure_as:
109 includes.add('core/frame/UseCounter.h') 120 includes.add('core/frame/UseCounter.h')
110 121
111 # [SetWrapperReferenceFrom] 122 # [SetWrapperReferenceFrom]
112 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom') 123 reachable_node_function = extended_attributes.get('SetWrapperReferenceFrom')
113 if reachable_node_function: 124 if reachable_node_function:
114 includes.update(['bindings/core/v8/V8GCController.h', 125 includes.update(['bindings/core/v8/V8GCController.h',
115 'core/dom/Element.h']) 126 'core/dom/Element.h'])
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 'interface_name': interface.name, 176 'interface_name': interface.name,
166 'is_active_dom_object': is_active_dom_object, 177 'is_active_dom_object': is_active_dom_object,
167 'is_audio_buffer': is_audio_buffer, 178 'is_audio_buffer': is_audio_buffer,
168 'is_check_security': is_check_security, 179 'is_check_security': is_check_security,
169 'is_dependent_lifetime': is_dependent_lifetime, 180 'is_dependent_lifetime': is_dependent_lifetime,
170 'is_document': is_document, 181 'is_document': is_document,
171 'is_event_target': inherits_interface(interface.name, 'EventTarget'), 182 'is_event_target': inherits_interface(interface.name, 'EventTarget'),
172 'is_exception': interface.is_exception, 183 'is_exception': interface.is_exception,
173 'is_node': inherits_interface(interface.name, 'Node'), 184 'is_node': inherits_interface(interface.name, 'Node'),
174 'is_script_wrappable': is_script_wrappable, 185 'is_script_wrappable': is_script_wrappable,
186 'iterator_method': iterator_method,
175 'lifetime': 'Dependent' 187 'lifetime': 'Dependent'
176 if (has_visit_dom_wrapper or 188 if (has_visit_dom_wrapper or
177 is_active_dom_object or 189 is_active_dom_object or
178 is_dependent_lifetime) 190 is_dependent_lifetime)
179 else 'Independent', 191 else 'Independent',
180 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs] 192 'measure_as': v8_utilities.measure_as(interface), # [MeasureAs]
181 'parent_interface': parent_interface, 193 'parent_interface': parent_interface,
182 'pass_cpp_type': cpp_template_type( 194 'pass_cpp_type': cpp_template_type(
183 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type), 195 cpp_ptr_type('PassRefPtr', 'RawPtr', this_gc_type),
184 cpp_name(interface)), 196 cpp_name(interface)),
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 deleter = next( 1146 deleter = next(
1135 method 1147 method
1136 for method in interface.operations 1148 for method in interface.operations
1137 if ('deleter' in method.specials and 1149 if ('deleter' in method.specials and
1138 len(method.arguments) == 1 and 1150 len(method.arguments) == 1 and
1139 str(method.arguments[0].idl_type) == 'DOMString')) 1151 str(method.arguments[0].idl_type) == 'DOMString'))
1140 except StopIteration: 1152 except StopIteration:
1141 return None 1153 return None
1142 1154
1143 return property_deleter(deleter) 1155 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8DOMConfiguration.cpp ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698