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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 if (base_idl_type == 'EventHandler' and | 80 if (base_idl_type == 'EventHandler' and |
81 interface.name in ['Window', 'WorkerGlobalScope'] and | 81 interface.name in ['Window', 'WorkerGlobalScope'] and |
82 attribute.name == 'onerror'): | 82 attribute.name == 'onerror'): |
83 includes.add('bindings/core/v8/V8ErrorHandler.h') | 83 includes.add('bindings/core/v8/V8ErrorHandler.h') |
84 | 84 |
85 context = { | 85 context = { |
86 'access_control_list': access_control_list(attribute), | 86 'access_control_list': access_control_list(attribute), |
87 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] | 87 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] |
88 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] | 88 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] |
89 'activity_logging_include_old_value_for_setter': 'LogPreviousValue' in e
xtended_attributes, # [ActivityLogging] | |
90 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] | 89 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] |
91 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 90 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
92 'cached_attribute_validation_method': extended_attributes.get('CachedAtt
ribute'), | 91 'cached_attribute_validation_method': extended_attributes.get('CachedAtt
ribute'), |
93 'conditional_string': v8_utilities.conditional_string(attribute), | 92 'conditional_string': v8_utilities.conditional_string(attribute), |
94 'constructor_type': idl_type.constructor_type_name | 93 'constructor_type': idl_type.constructor_type_name |
95 if is_constructor_attribute(attribute) else None, | 94 if is_constructor_attribute(attribute) else None, |
96 'cpp_name': cpp_name(attribute), | 95 'cpp_name': cpp_name(attribute), |
97 'cpp_type': idl_type.cpp_type, | 96 'cpp_type': idl_type.cpp_type, |
98 'cpp_type_initializer': idl_type.cpp_type_initializer, | 97 'cpp_type_initializer': idl_type.cpp_type_initializer, |
99 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] | 98 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 raise Exception('Private scripts supports only primitive types and D
OM wrappers.') | 181 raise Exception('Private scripts supports only primitive types and D
OM wrappers.') |
183 | 182 |
184 context['cpp_value_original'] = cpp_value | 183 context['cpp_value_original'] = cpp_value |
185 cpp_value = 'result' | 184 cpp_value = 'result' |
186 # EventHandler has special handling | 185 # EventHandler has special handling |
187 if base_idl_type != 'EventHandler': | 186 if base_idl_type != 'EventHandler': |
188 release = idl_type.release | 187 release = idl_type.release |
189 elif (idl_type.is_explicit_nullable or | 188 elif (idl_type.is_explicit_nullable or |
190 base_idl_type == 'EventHandler' or | 189 base_idl_type == 'EventHandler' or |
191 'CachedAttribute' in extended_attributes or | 190 'CachedAttribute' in extended_attributes or |
192 'LogPreviousValue' in extended_attributes or | |
193 'ReflectOnly' in extended_attributes or | 191 'ReflectOnly' in extended_attributes or |
194 context['is_keep_alive_for_gc'] or | 192 context['is_keep_alive_for_gc'] or |
195 context['is_getter_raises_exception']): | 193 context['is_getter_raises_exception']): |
196 context['cpp_value_original'] = cpp_value | 194 context['cpp_value_original'] = cpp_value |
197 cpp_value = 'cppValue' | 195 cpp_value = 'cppValue' |
198 # EventHandler has special handling | 196 # EventHandler has special handling |
199 if base_idl_type != 'EventHandler': | 197 if base_idl_type != 'EventHandler': |
200 release = idl_type.release | 198 release = idl_type.release |
201 | 199 |
202 def v8_set_return_value_statement(for_main_world=False): | 200 def v8_set_return_value_statement(for_main_world=False): |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 lambda self: strip_suffix(self.base_type, 'Constructor')) | 493 lambda self: strip_suffix(self.base_type, 'Constructor')) |
496 | 494 |
497 | 495 |
498 def is_constructor_attribute(attribute): | 496 def is_constructor_attribute(attribute): |
499 # FIXME: replace this with [ConstructorAttribute] extended attribute | 497 # FIXME: replace this with [ConstructorAttribute] extended attribute |
500 return attribute.idl_type.name.endswith('Constructor') | 498 return attribute.idl_type.name.endswith('Constructor') |
501 | 499 |
502 | 500 |
503 def constructor_getter_context(interface, attribute, context): | 501 def constructor_getter_context(interface, attribute, context): |
504 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 502 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
OLD | NEW |