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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 if (base_idl_type == 'EventHandler' and | 87 if (base_idl_type == 'EventHandler' and |
88 interface.name in ['Window', 'WorkerGlobalScope'] and | 88 interface.name in ['Window', 'WorkerGlobalScope'] and |
89 attribute.name == 'onerror'): | 89 attribute.name == 'onerror'): |
90 includes.add('bindings/v8/V8ErrorHandler.h') | 90 includes.add('bindings/v8/V8ErrorHandler.h') |
91 | 91 |
92 contents = { | 92 contents = { |
93 'access_control_list': access_control_list(attribute), | 93 'access_control_list': access_control_list(attribute), |
94 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] | 94 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] |
95 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] | 95 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] |
| 96 'activity_logging_include_old_value_for_setter': 'LogPreviousValue' in e
xtended_attributes, # [ActivityLogging] |
96 'cached_attribute_validation_method': extended_attributes.get('CachedAtt
ribute'), | 97 'cached_attribute_validation_method': extended_attributes.get('CachedAtt
ribute'), |
97 'conditional_string': v8_utilities.conditional_string(attribute), | 98 'conditional_string': v8_utilities.conditional_string(attribute), |
98 'constructor_type': idl_type.constructor_type_name | 99 'constructor_type': idl_type.constructor_type_name |
99 if is_constructor_attribute(attribute) else None, | 100 if is_constructor_attribute(attribute) else None, |
100 'cpp_name': cpp_name(attribute), | 101 'cpp_name': cpp_name(attribute), |
101 'cpp_type': idl_type.cpp_type, | 102 'cpp_type': idl_type.cpp_type, |
| 103 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value='origi
nal', creation_context='info.Holder()'), |
102 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] | 104 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] |
103 'enum_validation_expression': idl_type.enum_validation_expression, | 105 'enum_validation_expression': idl_type.enum_validation_expression, |
104 'has_custom_getter': has_custom_getter, | 106 'has_custom_getter': has_custom_getter, |
105 'has_custom_setter': has_custom_setter, | 107 'has_custom_setter': has_custom_setter, |
106 'has_setter_exception_state': | 108 'has_setter_exception_state': |
107 is_setter_raises_exception or has_type_checking_interface or | 109 is_setter_raises_exception or has_type_checking_interface or |
108 has_type_checking_nullable or has_type_checking_unrestricted or | 110 has_type_checking_nullable or has_type_checking_unrestricted or |
109 idl_type.is_integer_type, | 111 idl_type.is_integer_type, |
110 'has_type_checking_interface': has_type_checking_interface, | 112 'has_type_checking_interface': has_type_checking_interface, |
111 'has_type_checking_nullable': has_type_checking_nullable, | 113 'has_type_checking_nullable': has_type_checking_nullable, |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 lambda self: strip_suffix(self.base_type, 'Constructor')) | 421 lambda self: strip_suffix(self.base_type, 'Constructor')) |
420 | 422 |
421 | 423 |
422 def is_constructor_attribute(attribute): | 424 def is_constructor_attribute(attribute): |
423 # FIXME: replace this with [ConstructorAttribute] extended attribute | 425 # FIXME: replace this with [ConstructorAttribute] extended attribute |
424 return attribute.idl_type.base_type.endswith('Constructor') | 426 return attribute.idl_type.base_type.endswith('Constructor') |
425 | 427 |
426 | 428 |
427 def generate_constructor_getter(interface, attribute, contents): | 429 def generate_constructor_getter(interface, attribute, contents): |
428 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co
ntents['deprecate_as'] | 430 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co
ntents['deprecate_as'] |
OLD | NEW |