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

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

Issue 618373003: [bindings] partial interfaces should not violate componentization (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 return '%s::%sAttr' % (namespace, content_attribute_name) 427 return '%s::%sAttr' % (namespace, content_attribute_name)
428 428
429 429
430 ################################################################################ 430 ################################################################################
431 # Attribute configuration 431 # Attribute configuration
432 ################################################################################ 432 ################################################################################
433 433
434 # [Replaceable] 434 # [Replaceable]
435 def setter_callback_name(interface, attribute): 435 def setter_callback_name(interface, attribute):
436 cpp_class_name = cpp_name(interface) 436 cpp_class_name = cpp_name(interface)
437 namespace_name = [cpp_class_name]
438 if interface.original_interface:
439 namespace_name.append('Partial')
440 namespace_name.append('V8Internal')
haraken 2014/10/16 04:24:08 Can we move actual_cpp_class and remove this code?
tasak 2014/10/17 07:38:18 Done. Added cpp_name_or_partial().
441
437 extended_attributes = attribute.extended_attributes 442 extended_attributes = attribute.extended_attributes
438 if (('Replaceable' in extended_attributes and 443 if (('Replaceable' in extended_attributes and
439 'PutForwards' not in extended_attributes) or 444 'PutForwards' not in extended_attributes) or
440 is_constructor_attribute(attribute)): 445 is_constructor_attribute(attribute)):
441 return '{0}V8Internal::{0}ForceSetAttributeOnThisCallback'.format(cpp_cl ass_name) 446 return '%s::%sForceSetAttributeOnThisCallback' % (
447 ''.join(namespace_name), cpp_class_name)
442 if attribute.is_read_only and 'PutForwards' not in extended_attributes: 448 if attribute.is_read_only and 'PutForwards' not in extended_attributes:
443 return '0' 449 return '0'
444 return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribut e.name) 450 return '%s::%sAttributeSetterCallback' % (''.join(namespace_name), attribute .name)
445 451
446 452
447 # [DoNotCheckSecurity], [Unforgeable] 453 # [DoNotCheckSecurity], [Unforgeable]
448 def access_control_list(attribute): 454 def access_control_list(attribute):
449 extended_attributes = attribute.extended_attributes 455 extended_attributes = attribute.extended_attributes
450 access_control = [] 456 access_control = []
451 if 'DoNotCheckSecurity' in extended_attributes: 457 if 'DoNotCheckSecurity' in extended_attributes:
452 do_not_check_security = extended_attributes['DoNotCheckSecurity'] 458 do_not_check_security = extended_attributes['DoNotCheckSecurity']
453 if do_not_check_security == 'Setter': 459 if do_not_check_security == 'Setter':
454 access_control.append('v8::ALL_CAN_WRITE') 460 access_control.append('v8::ALL_CAN_WRITE')
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 lambda self: strip_suffix(self.base_type, 'Constructor')) 504 lambda self: strip_suffix(self.base_type, 'Constructor'))
499 505
500 506
501 def is_constructor_attribute(attribute): 507 def is_constructor_attribute(attribute):
502 # FIXME: replace this with [ConstructorAttribute] extended attribute 508 # FIXME: replace this with [ConstructorAttribute] extended attribute
503 return attribute.idl_type.name.endswith('Constructor') 509 return attribute.idl_type.name.endswith('Constructor')
504 510
505 511
506 def constructor_getter_context(interface, attribute, context): 512 def constructor_getter_context(interface, attribute, context):
507 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 513 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698