| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 cached_attribute_validation_method = extended_attributes.get('CachedAttribut
e') | 92 cached_attribute_validation_method = extended_attributes.get('CachedAttribut
e') |
| 93 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) | 93 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) |
| 94 if cached_attribute_validation_method or keep_alive_for_gc: | 94 if cached_attribute_validation_method or keep_alive_for_gc: |
| 95 includes.add('bindings/core/v8/V8HiddenValue.h') | 95 includes.add('bindings/core/v8/V8HiddenValue.h') |
| 96 | 96 |
| 97 context = { | 97 context = { |
| 98 'access_control_list': access_control_list(interface, attribute), | 98 'access_control_list': access_control_list(interface, attribute), |
| 99 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] | 99 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_
world_list(attribute, 'Getter'), # [ActivityLogging] |
| 100 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] | 100 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_
world_list(attribute, 'Setter'), # [ActivityLogging] |
| 101 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] | 101 'activity_logging_world_check': v8_utilities.activity_logging_world_chec
k(attribute), # [ActivityLogging] |
| 102 'api_experiment_name': v8_utilities.api_experiment_name(attribute), # [
APIExperimentEnabled] |
| 102 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 103 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
| 103 'cached_attribute_validation_method': cached_attribute_validation_method
, | 104 'cached_attribute_validation_method': cached_attribute_validation_method
, |
| 104 'conditional_string': v8_utilities.conditional_string(attribute), | 105 'conditional_string': v8_utilities.conditional_string(attribute), |
| 105 'constructor_type': constructor_type, | 106 'constructor_type': constructor_type, |
| 106 'cpp_name': cpp_name(attribute), | 107 'cpp_name': cpp_name(attribute), |
| 107 'cpp_type': idl_type.cpp_type, | 108 'cpp_type': idl_type.cpp_type, |
| 108 'cpp_type_initializer': idl_type.cpp_type_initializer, | 109 'cpp_type_initializer': idl_type.cpp_type_initializer, |
| 109 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] | 110 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] |
| 110 'enum_type': idl_type.enum_type, | 111 'enum_type': idl_type.enum_type, |
| 111 'enum_values': idl_type.enum_values, | 112 'enum_values': idl_type.enum_values, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 'name': attribute.name, | 148 'name': attribute.name, |
| 148 'only_exposed_to_private_script': is_only_exposed_to_private_script, | 149 'only_exposed_to_private_script': is_only_exposed_to_private_script, |
| 149 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( | 150 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( |
| 150 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), | 151 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa
lse', isolate='scriptState->isolate()'), |
| 151 'property_attributes': property_attributes(interface, attribute), | 152 'property_attributes': property_attributes(interface, attribute), |
| 152 'reflect_empty': extended_attributes.get('ReflectEmpty'), | 153 'reflect_empty': extended_attributes.get('ReflectEmpty'), |
| 153 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), | 154 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), |
| 154 'reflect_missing': extended_attributes.get('ReflectMissing'), | 155 'reflect_missing': extended_attributes.get('ReflectMissing'), |
| 155 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly
'), | 156 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly
'), |
| 156 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a
ttribute), # [RuntimeEnabled] | 157 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a
ttribute), # [RuntimeEnabled] |
| 158 'runtime_enabled_function_only': v8_utilities.runtime_enabled_conditiona
l(attribute.extended_attributes), |
| 157 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), | 159 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), |
| 158 'world_suffixes': ['', 'ForMainWorld'] | 160 'world_suffixes': ['', 'ForMainWorld'] |
| 159 if 'PerWorldBindings' in extended_attributes | 161 if 'PerWorldBindings' in extended_attributes |
| 160 else [''], # [PerWorldBindings] | 162 else [''], # [PerWorldBindings] |
| 161 } | 163 } |
| 162 | 164 |
| 163 if is_constructor_attribute(attribute): | 165 if is_constructor_attribute(attribute): |
| 164 update_constructor_attribute_context(interface, attribute, context) | 166 update_constructor_attribute_context(interface, attribute, context) |
| 165 if not has_custom_getter(attribute): | 167 if not has_custom_getter(attribute): |
| 166 getter_context(interface, attribute, context) | 168 getter_context(interface, attribute, context) |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 return attribute.idl_type.name.endswith('Constructor') | 506 return attribute.idl_type.name.endswith('Constructor') |
| 505 | 507 |
| 506 | 508 |
| 507 def update_constructor_attribute_context(interface, attribute, context): | 509 def update_constructor_attribute_context(interface, attribute, context): |
| 508 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 510 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| 509 # When the attribute name is the same as the interface name, do not generate | 511 # When the attribute name is the same as the interface name, do not generate |
| 510 # callback functions for each attribute and use | 512 # callback functions for each attribute and use |
| 511 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 513 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
| 512 # a callback function in order to hard-code the attribute name. | 514 # a callback function in order to hard-code the attribute name. |
| 513 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] | 515 context['needs_constructor_setter_callback'] = context['name'] != context['c
onstructor_type'] |
| OLD | NEW |