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

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

Issue 2809543002: bindings: Pass is_null flag to attribute setters when they are nullable (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl » ('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 # 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 arguments.append( 453 arguments.append(
454 'V8EventListenerHelper::EnsureEventListener<V8ErrorHandler>(' + 454 'V8EventListenerHelper::EnsureEventListener<V8ErrorHandler>(' +
455 'v8Value, true, ScriptState::ForReceiverObject(info))') 455 'v8Value, true, ScriptState::ForReceiverObject(info))')
456 else: 456 else:
457 arguments.append( 457 arguments.append(
458 'V8EventListenerHelper::GetEventListener(' + 458 'V8EventListenerHelper::GetEventListener(' +
459 'ScriptState::ForReceiverObject(info), v8Value, true, ' + 459 'ScriptState::ForReceiverObject(info), v8Value, true, ' +
460 'kListenerFindOrCreate)') 460 'kListenerFindOrCreate)')
461 else: 461 else:
462 arguments.append('cppValue') 462 arguments.append('cppValue')
463 if idl_type.is_explicit_nullable:
464 arguments.append('isNull')
463 if context['is_setter_raises_exception']: 465 if context['is_setter_raises_exception']:
464 arguments.append('exceptionState') 466 arguments.append('exceptionState')
465 467
466 return '%s(%s)' % (setter_name, ', '.join(arguments)) 468 return '%s(%s)' % (setter_name, ', '.join(arguments))
467 469
468 470
469 CONTENT_ATTRIBUTE_SETTER_NAMES = { 471 CONTENT_ATTRIBUTE_SETTER_NAMES = {
470 'boolean': 'SetBooleanAttribute', 472 'boolean': 'SetBooleanAttribute',
471 'long': 'SetIntegralAttribute', 473 'long': 'SetIntegralAttribute',
472 'unsigned long': 'SetUnsignedIntegralAttribute', 474 'unsigned long': 'SetUnsignedIntegralAttribute',
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 def is_constructor_attribute(attribute): 564 def is_constructor_attribute(attribute):
563 return attribute.idl_type.name.endswith('Constructor') 565 return attribute.idl_type.name.endswith('Constructor')
564 566
565 567
566 def is_named_constructor_attribute(attribute): 568 def is_named_constructor_attribute(attribute):
567 return attribute.idl_type.name.endswith('ConstructorConstructor') 569 return attribute.idl_type.name.endswith('ConstructorConstructor')
568 570
569 571
570 def update_constructor_attribute_context(interface, attribute, context): 572 def update_constructor_attribute_context(interface, attribute, context):
571 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 573 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698