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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 has_extended_attribute_value, scoped_name, strip_suffi
x, | 42 has_extended_attribute_value, scoped_name, strip_suffi
x, |
43 uncapitalize, extended_attribute_value_as_list, is_unf
orgeable, | 43 uncapitalize, extended_attribute_value_as_list, is_unf
orgeable, |
44 is_legacy_interface_type_checking) | 44 is_legacy_interface_type_checking) |
45 | 45 |
46 | 46 |
47 def attribute_context(interface, attribute): | 47 def attribute_context(interface, attribute): |
48 idl_type = attribute.idl_type | 48 idl_type = attribute.idl_type |
49 base_idl_type = idl_type.base_type | 49 base_idl_type = idl_type.base_type |
50 extended_attributes = attribute.extended_attributes | 50 extended_attributes = attribute.extended_attributes |
51 | 51 |
52 idl_type.add_includes_for_type() | 52 idl_type.add_includes_for_type(extended_attributes) |
53 if idl_type.enum_values: | 53 if idl_type.enum_values: |
54 includes.add('core/inspector/ConsoleMessage.h') | 54 includes.add('core/inspector/ConsoleMessage.h') |
55 | 55 |
56 # [CheckSecurity] | 56 # [CheckSecurity] |
57 is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes | 57 is_do_not_check_security = 'DoNotCheckSecurity' in extended_attributes |
58 is_check_security_for_frame = ( | 58 is_check_security_for_frame = ( |
59 has_extended_attribute_value(interface, 'CheckSecurity', 'Frame') and | 59 has_extended_attribute_value(interface, 'CheckSecurity', 'Frame') and |
60 not is_do_not_check_security) | 60 not is_do_not_check_security) |
61 is_check_security_for_node = ( | 61 is_check_security_for_node = ( |
62 has_extended_attribute_value(attribute, 'CheckSecurity', 'Node')) | 62 has_extended_attribute_value(attribute, 'CheckSecurity', 'Node')) |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 return attribute.idl_type.name.endswith('Constructor') | 554 return attribute.idl_type.name.endswith('Constructor') |
555 | 555 |
556 | 556 |
557 def update_constructor_attribute_context(interface, attribute, context): | 557 def update_constructor_attribute_context(interface, attribute, context): |
558 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 558 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
559 # When the attribute name is the same as the interface name, do not generate | 559 # When the attribute name is the same as the interface name, do not generate |
560 # callback functions for each attribute and use | 560 # callback functions for each attribute and use |
561 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 561 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
562 # a callback function in order to hard-code the attribute name. | 562 # a callback function in order to hard-code the attribute name. |
563 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 563 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
OLD | NEW |