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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 return '%s::%sAttr' % (namespace, content_attribute_name) | 422 return '%s::%sAttr' % (namespace, content_attribute_name) |
423 | 423 |
424 | 424 |
425 ################################################################################ | 425 ################################################################################ |
426 # Attribute configuration | 426 # Attribute configuration |
427 ################################################################################ | 427 ################################################################################ |
428 | 428 |
429 # [Replaceable] | 429 # [Replaceable] |
430 def setter_callback_name(interface, attribute): | 430 def setter_callback_name(interface, attribute): |
431 cpp_class_name = cpp_name(interface) | 431 cpp_class_name = cpp_name(interface) |
| 432 namespace_name = [cpp_class_name] |
| 433 if interface.original_interface: |
| 434 namespace_name.append('Partial') |
| 435 namespace_name.append('V8Internal') |
| 436 |
432 extended_attributes = attribute.extended_attributes | 437 extended_attributes = attribute.extended_attributes |
433 if (('Replaceable' in extended_attributes and | 438 if (('Replaceable' in extended_attributes and |
434 'PutForwards' not in extended_attributes) or | 439 'PutForwards' not in extended_attributes) or |
435 is_constructor_attribute(attribute)): | 440 is_constructor_attribute(attribute)): |
436 return '{0}V8Internal::{0}ForceSetAttributeOnThisCallback'.format(cpp_cl
ass_name) | 441 return '%s::%sForceSetAttributeOnThisCallback' % ( |
| 442 ''.join(namespace_name), cpp_class_name) |
437 if attribute.is_read_only and 'PutForwards' not in extended_attributes: | 443 if attribute.is_read_only and 'PutForwards' not in extended_attributes: |
438 return '0' | 444 return '0' |
439 return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribut
e.name) | 445 return '%s::%sAttributeSetterCallback' % (''.join(namespace_name), attribute
.name) |
440 | 446 |
441 | 447 |
442 # [DoNotCheckSecurity], [Unforgeable] | 448 # [DoNotCheckSecurity], [Unforgeable] |
443 def access_control_list(attribute): | 449 def access_control_list(attribute): |
444 extended_attributes = attribute.extended_attributes | 450 extended_attributes = attribute.extended_attributes |
445 access_control = [] | 451 access_control = [] |
446 if 'DoNotCheckSecurity' in extended_attributes: | 452 if 'DoNotCheckSecurity' in extended_attributes: |
447 do_not_check_security = extended_attributes['DoNotCheckSecurity'] | 453 do_not_check_security = extended_attributes['DoNotCheckSecurity'] |
448 if do_not_check_security == 'Setter': | 454 if do_not_check_security == 'Setter': |
449 access_control.append('v8::ALL_CAN_WRITE') | 455 access_control.append('v8::ALL_CAN_WRITE') |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 lambda self: strip_suffix(self.base_type, 'Constructor')) | 499 lambda self: strip_suffix(self.base_type, 'Constructor')) |
494 | 500 |
495 | 501 |
496 def is_constructor_attribute(attribute): | 502 def is_constructor_attribute(attribute): |
497 # FIXME: replace this with [ConstructorAttribute] extended attribute | 503 # FIXME: replace this with [ConstructorAttribute] extended attribute |
498 return attribute.idl_type.name.endswith('Constructor') | 504 return attribute.idl_type.name.endswith('Constructor') |
499 | 505 |
500 | 506 |
501 def constructor_getter_context(interface, attribute, context): | 507 def constructor_getter_context(interface, attribute, context): |
502 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 508 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
OLD | NEW |