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

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

Issue 293053007: V8AbstractEventListener should hold a ScriptState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 not attribute.is_static): 319 not attribute.is_static):
320 arguments.append('*impl') 320 arguments.append('*impl')
321 idl_type = attribute.idl_type 321 idl_type = attribute.idl_type
322 if idl_type.base_type == 'EventHandler': 322 if idl_type.base_type == 'EventHandler':
323 getter_name = scoped_name(interface, attribute, cpp_name(attribute)) 323 getter_name = scoped_name(interface, attribute, cpp_name(attribute))
324 contents['event_handler_getter_expression'] = '%s(%s)' % ( 324 contents['event_handler_getter_expression'] = '%s(%s)' % (
325 getter_name, ', '.join(arguments)) 325 getter_name, ', '.join(arguments))
326 if (interface.name in ['Window', 'WorkerGlobalScope'] and 326 if (interface.name in ['Window', 'WorkerGlobalScope'] and
327 attribute.name == 'onerror'): 327 attribute.name == 'onerror'):
328 includes.add('bindings/v8/V8ErrorHandler.h') 328 includes.add('bindings/v8/V8ErrorHandler.h')
329 arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHa ndler>(v8Value, true, info.GetIsolate())') 329 arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHa ndler>(v8Value, true, ScriptState::current(info.GetIsolate()))')
330 else: 330 else:
331 arguments.append('V8EventListenerList::getEventListener(ScriptState: :current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)') 331 arguments.append('V8EventListenerList::getEventListener(ScriptState: :current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)')
332 elif idl_type.is_interface_type and not idl_type.array_type: 332 elif idl_type.is_interface_type and not idl_type.array_type:
333 # FIXME: should be able to eliminate WTF::getPtr in most or all cases 333 # FIXME: should be able to eliminate WTF::getPtr in most or all cases
334 arguments.append('WTF::getPtr(cppValue)') 334 arguments.append('WTF::getPtr(cppValue)')
335 else: 335 else:
336 arguments.append('cppValue') 336 arguments.append('cppValue')
337 if contents['is_setter_raises_exception']: 337 if contents['is_setter_raises_exception']:
338 arguments.append('exceptionState') 338 arguments.append('exceptionState')
339 339
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 lambda self: strip_suffix(self.base_type, 'Constructor')) 422 lambda self: strip_suffix(self.base_type, 'Constructor'))
423 423
424 424
425 def is_constructor_attribute(attribute): 425 def is_constructor_attribute(attribute):
426 # FIXME: replace this with [ConstructorAttribute] extended attribute 426 # FIXME: replace this with [ConstructorAttribute] extended attribute
427 return attribute.idl_type.base_type.endswith('Constructor') 427 return attribute.idl_type.base_type.endswith('Constructor')
428 428
429 429
430 def generate_constructor_getter(interface, attribute, contents): 430 def generate_constructor_getter(interface, attribute, contents):
431 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as'] 431 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698