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

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

Issue 2273683003: Use visitDOMWrapper to preserve WebGL JS object wrappers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 # FIXME: properly should be: 202 # FIXME: properly should be:
203 # 'cpp_type': set_wrapper_reference_to_argument.idl_type.cpp_type_ar gs(raw_type=True), 203 # 'cpp_type': set_wrapper_reference_to_argument.idl_type.cpp_type_ar gs(raw_type=True),
204 # (if type is non-wrapper type like NodeFilter, normally RefPtr) 204 # (if type is non-wrapper type like NodeFilter, normally RefPtr)
205 # Raw pointers faster though, and NodeFilter hacky anyway. 205 # Raw pointers faster though, and NodeFilter hacky anyway.
206 'cpp_type': set_wrapper_reference_to_argument.idl_type.implemented_a s + '*', 206 'cpp_type': set_wrapper_reference_to_argument.idl_type.implemented_a s + '*',
207 'idl_type': set_wrapper_reference_to_argument.idl_type, 207 'idl_type': set_wrapper_reference_to_argument.idl_type,
208 'v8_type': v8_types.v8_type(set_wrapper_reference_to_argument.idl_ty pe.name), 208 'v8_type': v8_types.v8_type(set_wrapper_reference_to_argument.idl_ty pe.name),
209 } 209 }
210 set_wrapper_reference_to['idl_type'].add_includes_for_type() 210 set_wrapper_reference_to['idl_type'].add_includes_for_type()
211 211
212 # [Custom=VisitDOMWrapperExtra]
213 has_visit_dom_wrapper_extra = has_extended_attribute_value(interface, 'Custo m', 'VisitDOMWrapperExtra')
214
212 # [Custom=VisitDOMWrapper] 215 # [Custom=VisitDOMWrapper]
213 has_visit_dom_wrapper = ( 216 has_visit_dom_wrapper = (
214 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or 217 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
218 has_visit_dom_wrapper_extra or
215 set_wrapper_reference_from or set_wrapper_reference_to) 219 set_wrapper_reference_from or set_wrapper_reference_to)
216 220
217 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod e') else 'ObjectClassId') 221 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod e') else 'ObjectClassId')
218 222
219 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. 223 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime].
220 if active_scriptwrappable and not is_dependent_lifetime: 224 if active_scriptwrappable and not is_dependent_lifetime:
221 raise Exception('[ActiveScriptWrappable] interface must also specify ' 225 raise Exception('[ActiveScriptWrappable] interface must also specify '
222 '[DependentLifetime]: %s' % interface.name) 226 '[DependentLifetime]: %s' % interface.name)
223 227
224 v8_class_name = v8_utilities.v8_class_name(interface) 228 v8_class_name = v8_utilities.v8_class_name(interface)
225 cpp_class_name = cpp_name(interface) 229 cpp_class_name = cpp_name(interface)
226 cpp_class_name_or_partial = cpp_name_or_partial(interface) 230 cpp_class_name_or_partial = cpp_name_or_partial(interface)
227 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) 231 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface)
228 232
229 context = { 233 context = {
230 'cpp_class': cpp_class_name, 234 'cpp_class': cpp_class_name,
231 'cpp_class_or_partial': cpp_class_name_or_partial, 235 'cpp_class_or_partial': cpp_class_name_or_partial,
232 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target else 'NotInheritFromEventTarget', 236 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target else 'NotInheritFromEventTarget',
233 'is_gc_type': True, 237 'is_gc_type': True,
234 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 238 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699
235 'has_access_check_callbacks': (is_check_security and 239 'has_access_check_callbacks': (is_check_security and
236 interface.name != 'EventTarget'), 240 interface.name != 'EventTarget'),
237 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] 241 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
238 'has_partial_interface': len(interface.partial_interfaces) > 0, 242 'has_partial_interface': len(interface.partial_interfaces) > 0,
239 'has_visit_dom_wrapper': has_visit_dom_wrapper, 243 'has_visit_dom_wrapper': has_visit_dom_wrapper,
244 'has_visit_dom_wrapper_extra': has_visit_dom_wrapper_extra,
240 'header_includes': header_includes, 245 'header_includes': header_includes,
241 'interface_name': interface.name, 246 'interface_name': interface.name,
242 'is_array_buffer_or_view': is_array_buffer_or_view, 247 'is_array_buffer_or_view': is_array_buffer_or_view,
243 'is_check_security': is_check_security, 248 'is_check_security': is_check_security,
244 'is_event_target': is_event_target, 249 'is_event_target': is_event_target,
245 'is_exception': interface.is_exception, 250 'is_exception': interface.is_exception,
246 'is_global': is_global, 251 'is_global': is_global,
247 'is_node': inherits_interface(interface.name, 'Node'), 252 'is_node': inherits_interface(interface.name, 'Node'),
248 'is_partial': interface.is_partial, 253 'is_partial': interface.is_partial,
249 'is_typed_array_type': is_typed_array_type, 254 'is_typed_array_type': is_typed_array_type,
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 extended_attributes = deleter.extended_attributes 1406 extended_attributes = deleter.extended_attributes
1402 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1407 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1403 is_ce_reactions = 'CEReactions' in extended_attributes 1408 is_ce_reactions = 'CEReactions' in extended_attributes
1404 return { 1409 return {
1405 'is_call_with_script_state': is_call_with_script_state, 1410 'is_call_with_script_state': is_call_with_script_state,
1406 'is_ce_reactions': is_ce_reactions, 1411 'is_ce_reactions': is_ce_reactions,
1407 'is_custom': 'Custom' in extended_attributes, 1412 'is_custom': 'Custom' in extended_attributes,
1408 'is_raises_exception': 'RaisesException' in extended_attributes, 1413 'is_raises_exception': 'RaisesException' in extended_attributes,
1409 'name': cpp_name(deleter), 1414 'name': cpp_name(deleter),
1410 } 1415 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698