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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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/core/v8/V8ErrorHandler.h') | 90 includes.add('bindings/core/v8/V8ErrorHandler.h') |
91 | 91 |
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 if 'APIExperimentEnabled' in extended_attributes: | 97 if 'OriginTrialEnabled' in extended_attributes: |
98 includes.add('core/inspector/ConsoleMessage.h') | 98 includes.add('core/inspector/ConsoleMessage.h') |
99 includes.add('core/origin_trials/OriginTrials.h') | 99 includes.add('core/origin_trials/OriginTrials.h') |
100 | 100 |
101 context = { | 101 context = { |
102 'access_control_list': access_control_list(interface, attribute), | 102 'access_control_list': access_control_list(interface, attribute), |
103 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_ world_list(attribute, 'Getter'), # [ActivityLogging] | 103 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_ world_list(attribute, 'Getter'), # [ActivityLogging] |
104 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_ world_list(attribute, 'Setter'), # [ActivityLogging] | 104 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_ world_list(attribute, 'Setter'), # [ActivityLogging] |
105 'activity_logging_world_check': v8_utilities.activity_logging_world_chec k(attribute), # [ActivityLogging] | 105 'activity_logging_world_check': v8_utilities.activity_logging_world_chec k(attribute), # [ActivityLogging] |
106 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(a ttribute), # [APIExperimentEnabled] | 106 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(attri bute), # [OriginTrialEnabled] |
haraken
2016/02/11 05:46:56
Alphabetical order please. (The same comment for o
iclelland
2016/02/11 15:21:57
Thanks - I missed that. I have moved these ones in
| |
107 'api_experiment_enabled_per_interface': v8_utilities.api_experiment_enab led_function(interface), # [APIExperimentEnabled] | 107 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_ function(interface), # [OriginTrialEnabled] |
108 'api_experiment_name': extended_attributes.get('APIExperimentEnabled'), # [APIExperimentEnabled] | 108 'origin_trial_name': extended_attributes.get('OriginTrialEnabled'), # [ OriginTrialEnabled] |
109 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), | 109 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True), |
110 'cached_attribute_validation_method': cached_attribute_validation_method , | 110 'cached_attribute_validation_method': cached_attribute_validation_method , |
111 'constructor_type': constructor_type, | 111 'constructor_type': constructor_type, |
112 'cpp_name': cpp_name(attribute), | 112 'cpp_name': cpp_name(attribute), |
113 'cpp_type': idl_type.cpp_type, | 113 'cpp_type': idl_type.cpp_type, |
114 'cpp_type_initializer': idl_type.cpp_type_initializer, | 114 'cpp_type_initializer': idl_type.cpp_type_initializer, |
115 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] | 115 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] |
116 'enum_type': idl_type.enum_type, | 116 'enum_type': idl_type.enum_type, |
117 'enum_values': idl_type.enum_values, | 117 'enum_values': idl_type.enum_values, |
118 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] | 118 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] |
119 'has_custom_getter': has_custom_getter(attribute), | 119 'has_custom_getter': has_custom_getter(attribute), |
120 'has_custom_setter': has_custom_setter(attribute), | 120 'has_custom_setter': has_custom_setter(attribute), |
121 'has_setter': has_setter(attribute), | 121 'has_setter': has_setter(attribute), |
122 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType | 122 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType |
123 'is_api_experiment_enabled': v8_utilities.api_experiment_enabled_functio n(attribute) or v8_utilities.api_experiment_enabled_function(interface), # [API ExperimentEnabled] | 123 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(at tribute) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTri alEnabled] |
124 'is_call_with_execution_context': has_extended_attribute_value(attribute , 'CallWith', 'ExecutionContext'), | 124 'is_call_with_execution_context': has_extended_attribute_value(attribute , 'CallWith', 'ExecutionContext'), |
125 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca llWith', 'ScriptState'), | 125 'is_call_with_script_state': has_extended_attribute_value(attribute, 'Ca llWith', 'ScriptState'), |
126 'is_check_security_for_receiver': is_check_security_for_receiver, | 126 'is_check_security_for_receiver': is_check_security_for_receiver, |
127 'is_check_security_for_return_value': is_check_security_for_return_value , | 127 'is_check_security_for_return_value': is_check_security_for_return_value , |
128 'is_custom_element_callbacks': is_custom_element_callbacks, | 128 'is_custom_element_callbacks': is_custom_element_callbacks, |
129 # TODO(yukishiino): Make all DOM attributes accessor-type properties. | 129 # TODO(yukishiino): Make all DOM attributes accessor-type properties. |
130 'is_data_type_property': constructor_type or interface.name == 'Window' or interface.name == 'Location', | 130 'is_data_type_property': constructor_type or interface.name == 'Window' or interface.name == 'Location', |
131 'is_getter_raises_exception': # [RaisesException] | 131 'is_getter_raises_exception': # [RaisesException] |
132 'RaisesException' in extended_attributes and | 132 'RaisesException' in extended_attributes and |
133 extended_attributes['RaisesException'] in (None, 'Getter'), | 133 extended_attributes['RaisesException'] in (None, 'Getter'), |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 # FIXME: replace this with a [ConstructorAttribute] extended attribute | 505 # FIXME: replace this with a [ConstructorAttribute] extended attribute |
506 lambda self: strip_suffix(self.base_type, 'Constructor')) | 506 lambda self: strip_suffix(self.base_type, 'Constructor')) |
507 | 507 |
508 | 508 |
509 def is_constructor_attribute(attribute): | 509 def is_constructor_attribute(attribute): |
510 # FIXME: replace this with [ConstructorAttribute] extended attribute | 510 # FIXME: replace this with [ConstructorAttribute] extended attribute |
511 return attribute.idl_type.name.endswith('Constructor') | 511 return attribute.idl_type.name.endswith('Constructor') |
512 | 512 |
513 | 513 |
514 def update_constructor_attribute_context(interface, attribute, context): | 514 def update_constructor_attribute_context(interface, attribute, context): |
515 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] or context['api_experiment_name'] | 515 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] or context['origin_trial_name'] |
516 # When the attribute name is the same as the interface name, do not generate | 516 # When the attribute name is the same as the interface name, do not generate |
517 # callback functions for each attribute and use | 517 # callback functions for each attribute and use |
518 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate | 518 # {{cpp_class}}ConstructorAttributeSetterCallback. Otherwise, generate |
519 # a callback function in order to hard-code the attribute name. | 519 # a callback function in order to hard-code the attribute name. |
520 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] | 520 context['needs_constructor_setter_callback'] = context['name'] != context['c onstructor_type'] |
OLD | NEW |