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

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

Issue 2671553003: Remove uses of VisitDOMWrapper (Closed)
Patch Set: Add DependentLifetime when removing Custom=VisitDOMWrapper Created 3 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
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 # FIXME: properly should be: 228 # FIXME: properly should be:
229 # 'cpp_type': set_wrapper_reference_to_argument.idl_type.cpp_type_ar gs(raw_type=True), 229 # 'cpp_type': set_wrapper_reference_to_argument.idl_type.cpp_type_ar gs(raw_type=True),
230 # (if type is non-wrapper type like NodeFilter, normally RefPtr) 230 # (if type is non-wrapper type like NodeFilter, normally RefPtr)
231 # Raw pointers faster though, and NodeFilter hacky anyway. 231 # Raw pointers faster though, and NodeFilter hacky anyway.
232 'cpp_type': set_wrapper_reference_to_argument.idl_type.implemented_a s + '*', 232 'cpp_type': set_wrapper_reference_to_argument.idl_type.implemented_a s + '*',
233 'idl_type': set_wrapper_reference_to_argument.idl_type, 233 'idl_type': set_wrapper_reference_to_argument.idl_type,
234 'v8_type': v8_types.v8_type(set_wrapper_reference_to_argument.idl_ty pe.name), 234 'v8_type': v8_types.v8_type(set_wrapper_reference_to_argument.idl_ty pe.name),
235 } 235 }
236 set_wrapper_reference_to['idl_type'].add_includes_for_type() 236 set_wrapper_reference_to['idl_type'].add_includes_for_type()
237 237
238 # [Custom=VisitDOMWrapper] 238 has_visit_dom_wrapper = (set_wrapper_reference_from or set_wrapper_reference _to)
239 has_visit_dom_wrapper_custom = (
240 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper'))
241
242 has_visit_dom_wrapper = (has_visit_dom_wrapper_custom or
243 set_wrapper_reference_from or set_wrapper_reference_to)
244 239
245 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod e') else 'ObjectClassId') 240 wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Nod e') else 'ObjectClassId')
246 241
247 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. 242 # [ActiveScriptWrappable] must be accompanied with [DependentLifetime].
248 if active_scriptwrappable and not is_dependent_lifetime: 243 if active_scriptwrappable and not is_dependent_lifetime:
249 raise Exception('[ActiveScriptWrappable] interface must also specify ' 244 raise Exception('[ActiveScriptWrappable] interface must also specify '
250 '[DependentLifetime]: %s' % interface.name) 245 '[DependentLifetime]: %s' % interface.name)
251 246
252 v8_class_name = v8_utilities.v8_class_name(interface) 247 v8_class_name = v8_utilities.v8_class_name(interface)
253 cpp_class_name = cpp_name(interface) 248 cpp_class_name = cpp_name(interface)
254 cpp_class_name_or_partial = cpp_name_or_partial(interface) 249 cpp_class_name_or_partial = cpp_name_or_partial(interface)
255 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface) 250 v8_class_name_or_partial = v8_utilities.v8_class_name_or_partial(interface)
256 251
257 # TODO(peria): Generate the target list from 'Window' and 'HTMLDocument'. 252 # TODO(peria): Generate the target list from 'Window' and 'HTMLDocument'.
258 needs_runtime_enabled_installer = v8_class_name in [ 253 needs_runtime_enabled_installer = v8_class_name in [
259 'V8Window', 'V8HTMLDocument', 'V8Document', 'V8Node', 'V8EventTarget'] 254 'V8Window', 'V8HTMLDocument', 'V8Document', 'V8Node', 'V8EventTarget']
260 255
261 context = { 256 context = {
262 'cpp_class': cpp_class_name, 257 'cpp_class': cpp_class_name,
263 'cpp_class_or_partial': cpp_class_name_or_partial, 258 'cpp_class_or_partial': cpp_class_name_or_partial,
264 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target else 'NotInheritFromEventTarget', 259 'event_target_inheritance': 'InheritFromEventTarget' if is_event_target else 'NotInheritFromEventTarget',
265 'is_gc_type': True, 260 'is_gc_type': True,
266 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699 261 # FIXME: Remove 'EventTarget' special handling, http://crbug.com/383699
267 'has_access_check_callbacks': (is_check_security and 262 'has_access_check_callbacks': (is_check_security and
268 interface.name != 'EventTarget'), 263 interface.name != 'EventTarget'),
269 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] 264 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
270 'has_partial_interface': len(interface.partial_interfaces) > 0, 265 'has_partial_interface': len(interface.partial_interfaces) > 0,
271 'has_visit_dom_wrapper': has_visit_dom_wrapper, 266 'has_visit_dom_wrapper': has_visit_dom_wrapper,
272 'has_visit_dom_wrapper_custom': has_visit_dom_wrapper_custom,
273 'header_includes': header_includes, 267 'header_includes': header_includes,
274 'interface_name': interface.name, 268 'interface_name': interface.name,
275 'is_array_buffer_or_view': is_array_buffer_or_view, 269 'is_array_buffer_or_view': is_array_buffer_or_view,
276 'is_check_security': is_check_security, 270 'is_check_security': is_check_security,
277 'is_event_target': is_event_target, 271 'is_event_target': is_event_target,
278 'is_exception': interface.is_exception, 272 'is_exception': interface.is_exception,
279 'is_global': is_global, 273 'is_global': is_global,
280 'is_immutable_prototype': is_immutable_prototype, 274 'is_immutable_prototype': is_immutable_prototype,
281 'is_node': inherits_interface(interface.name, 'Node'), 275 'is_node': inherits_interface(interface.name, 'Node'),
282 'is_partial': interface.is_partial, 276 'is_partial': interface.is_partial,
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 extended_attributes = deleter.extended_attributes 1495 extended_attributes = deleter.extended_attributes
1502 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState') 1496 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete r, 'CallWith', 'ScriptState')
1503 is_ce_reactions = 'CEReactions' in extended_attributes 1497 is_ce_reactions = 'CEReactions' in extended_attributes
1504 return { 1498 return {
1505 'is_call_with_script_state': is_call_with_script_state, 1499 'is_call_with_script_state': is_call_with_script_state,
1506 'is_ce_reactions': is_ce_reactions, 1500 'is_ce_reactions': is_ce_reactions,
1507 'is_custom': 'Custom' in extended_attributes, 1501 'is_custom': 'Custom' in extended_attributes,
1508 'is_raises_exception': 'RaisesException' in extended_attributes, 1502 'is_raises_exception': 'RaisesException' in extended_attributes,
1509 'name': cpp_name(deleter), 1503 'name': cpp_name(deleter),
1510 } 1504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698