| OLD | NEW |
| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->G
etCurrentContext()))') | 451 arguments.append('toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->G
etCurrentContext()))') |
| 452 arguments.append('impl') | 452 arguments.append('impl') |
| 453 arguments.append('cppValue') | 453 arguments.append('cppValue') |
| 454 elif idl_type.base_type == 'EventHandler': | 454 elif idl_type.base_type == 'EventHandler': |
| 455 getter_name = scoped_name(interface, attribute, cpp_name(attribute)) | 455 getter_name = scoped_name(interface, attribute, cpp_name(attribute)) |
| 456 context['event_handler_getter_expression'] = '%s(%s)' % ( | 456 context['event_handler_getter_expression'] = '%s(%s)' % ( |
| 457 getter_name, ', '.join(arguments)) | 457 getter_name, ', '.join(arguments)) |
| 458 if (interface.name in ['Window', 'WorkerGlobalScope'] and | 458 if (interface.name in ['Window', 'WorkerGlobalScope'] and |
| 459 attribute.name == 'onerror'): | 459 attribute.name == 'onerror'): |
| 460 includes.add('bindings/core/v8/V8ErrorHandler.h') | 460 includes.add('bindings/core/v8/V8ErrorHandler.h') |
| 461 arguments.append('V8EventListenerHelper::ensureEventListener<V8Error
Handler>(v8Value, true, ScriptState::current(info.GetIsolate()))') | 461 arguments.append( |
| 462 'V8EventListenerHelper::ensureEventListener<V8ErrorHandler>(' + |
| 463 'v8Value, true, ScriptState::forReceiverObject(info))') |
| 462 else: | 464 else: |
| 463 arguments.append('V8EventListenerHelper::getEventListener(ScriptStat
e::current(info.GetIsolate()), v8Value, true, ListenerFindOrCreate)') | 465 arguments.append( |
| 466 'V8EventListenerHelper::getEventListener(' + |
| 467 'ScriptState::forReceiverObject(info), v8Value, true, ' + |
| 468 'ListenerFindOrCreate)') |
| 464 else: | 469 else: |
| 465 arguments.append('cppValue') | 470 arguments.append('cppValue') |
| 466 if context['is_setter_raises_exception']: | 471 if context['is_setter_raises_exception']: |
| 467 arguments.append('exceptionState') | 472 arguments.append('exceptionState') |
| 468 | 473 |
| 469 return '%s(%s)' % (setter_name, ', '.join(arguments)) | 474 return '%s(%s)' % (setter_name, ', '.join(arguments)) |
| 470 | 475 |
| 471 | 476 |
| 472 CONTENT_ATTRIBUTE_SETTER_NAMES = { | 477 CONTENT_ATTRIBUTE_SETTER_NAMES = { |
| 473 'boolean': 'setBooleanAttribute', | 478 'boolean': 'setBooleanAttribute', |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 lambda self: strip_suffix(self.base_type, 'Constructor')) | 587 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 583 | 588 |
| 584 | 589 |
| 585 def is_constructor_attribute(attribute): | 590 def is_constructor_attribute(attribute): |
| 586 # FIXME: replace this with [ConstructorAttribute] extended attribute | 591 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 587 return attribute.idl_type.name.endswith('Constructor') | 592 return attribute.idl_type.name.endswith('Constructor') |
| 588 | 593 |
| 589 | 594 |
| 590 def update_constructor_attribute_context(interface, attribute, context): | 595 def update_constructor_attribute_context(interface, attribute, context): |
| 591 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 596 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |