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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 def access_control_list(interface, attribute): | 447 def access_control_list(interface, attribute): |
448 extended_attributes = attribute.extended_attributes | 448 extended_attributes = attribute.extended_attributes |
449 access_control = [] | 449 access_control = [] |
450 if 'DoNotCheckSecurity' in extended_attributes: | 450 if 'DoNotCheckSecurity' in extended_attributes: |
451 do_not_check_security = extended_attributes['DoNotCheckSecurity'] | 451 do_not_check_security = extended_attributes['DoNotCheckSecurity'] |
452 if do_not_check_security == 'Setter': | 452 if do_not_check_security == 'Setter': |
453 access_control.append('v8::ALL_CAN_WRITE') | 453 access_control.append('v8::ALL_CAN_WRITE') |
454 else: | 454 else: |
455 access_control.append('v8::ALL_CAN_READ') | 455 access_control.append('v8::ALL_CAN_READ') |
456 if (not attribute.is_read_only or | 456 if (not attribute.is_read_only or |
| 457 'PutForwards' in extended_attributes or |
457 'Replaceable' in extended_attributes): | 458 'Replaceable' in extended_attributes): |
458 access_control.append('v8::ALL_CAN_WRITE') | 459 access_control.append('v8::ALL_CAN_WRITE') |
459 if is_unforgeable(interface, attribute): | 460 if is_unforgeable(interface, attribute): |
460 access_control.append('v8::PROHIBITS_OVERWRITING') | 461 access_control.append('v8::PROHIBITS_OVERWRITING') |
461 return access_control or ['v8::DEFAULT'] | 462 return access_control or ['v8::DEFAULT'] |
462 | 463 |
463 | 464 |
464 # [NotEnumerable], [Unforgeable] | 465 # [NotEnumerable], [Unforgeable] |
465 def property_attributes(interface, attribute): | 466 def property_attributes(interface, attribute): |
466 extended_attributes = attribute.extended_attributes | 467 extended_attributes = attribute.extended_attributes |
(...skipping 30 matching lines...) Expand all Loading... |
497 lambda self: strip_suffix(self.base_type, 'Constructor')) | 498 lambda self: strip_suffix(self.base_type, 'Constructor')) |
498 | 499 |
499 | 500 |
500 def is_constructor_attribute(attribute): | 501 def is_constructor_attribute(attribute): |
501 # FIXME: replace this with [ConstructorAttribute] extended attribute | 502 # FIXME: replace this with [ConstructorAttribute] extended attribute |
502 return attribute.idl_type.name.endswith('Constructor') | 503 return attribute.idl_type.name.endswith('Constructor') |
503 | 504 |
504 | 505 |
505 def constructor_getter_context(interface, attribute, context): | 506 def constructor_getter_context(interface, attribute, context): |
506 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 507 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
OLD | NEW |