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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 is_post_message = 'PostMessage' in extended_attributes | 111 is_post_message = 'PostMessage' in extended_attributes |
112 if is_post_message: | 112 if is_post_message: |
113 includes.add('bindings/core/v8/SerializedScriptValueFactory.h') | 113 includes.add('bindings/core/v8/SerializedScriptValueFactory.h') |
114 includes.add('core/dom/DOMArrayBuffer.h') | 114 includes.add('core/dom/DOMArrayBuffer.h') |
115 includes.add('core/dom/MessagePort.h') | 115 includes.add('core/dom/MessagePort.h') |
116 includes.add('core/frame/ImageBitmap.h') | 116 includes.add('core/frame/ImageBitmap.h') |
117 | 117 |
118 if 'LenientThis' in extended_attributes: | 118 if 'LenientThis' in extended_attributes: |
119 raise Exception('[LenientThis] is not supported for operations.') | 119 raise Exception('[LenientThis] is not supported for operations.') |
120 | 120 |
121 if 'APIExperimentEnabled' in extended_attributes: | 121 if 'OriginTrialEnabled' in extended_attributes: |
122 includes.add('core/inspector/ConsoleMessage.h') | 122 includes.add('core/inspector/ConsoleMessage.h') |
123 includes.add('core/origin_trials/OriginTrials.h') | 123 includes.add('core/origin_trials/OriginTrials.h') |
124 | 124 |
125 argument_contexts = [ | 125 argument_contexts = [ |
126 argument_context(interface, method, argument, index, is_visible=is_visib
le) | 126 argument_context(interface, method, argument, index, is_visible=is_visib
le) |
127 for index, argument in enumerate(arguments)] | 127 for index, argument in enumerate(arguments)] |
128 | 128 |
129 return { | 129 return { |
130 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] | 130 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] |
131 'api_experiment_enabled': v8_utilities.api_experiment_enabled_function(m
ethod), # [APIExperimentEnabled] | |
132 'api_experiment_enabled_per_interface': v8_utilities.api_experiment_enab
led_function(interface), # [APIExperimentEnabled] | |
133 'arguments': argument_contexts, | 131 'arguments': argument_contexts, |
134 'argument_declarations_for_private_script': | 132 'argument_declarations_for_private_script': |
135 argument_declarations_for_private_script(interface, method), | 133 argument_declarations_for_private_script(interface, method), |
136 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type) | 134 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type) |
137 if idl_type.is_explicit_nullable else idl_type.cpp_type), | 135 if idl_type.is_explicit_nullable else idl_type.cpp_type), |
138 'cpp_value': this_cpp_value, | 136 'cpp_value': this_cpp_value, |
139 'cpp_type_initializer': idl_type.cpp_type_initializer, | 137 'cpp_type_initializer': idl_type.cpp_type_initializer, |
140 'custom_registration_extended_attributes': | 138 'custom_registration_extended_attributes': |
141 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection( | 139 CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES.intersection( |
142 extended_attributes.iterkeys()), | 140 extended_attributes.iterkeys()), |
143 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs] | 141 'deprecate_as': v8_utilities.deprecate_as(method), # [DeprecateAs] |
144 'exposed_test': v8_utilities.exposed(method, interface), # [Exposed] | 142 'exposed_test': v8_utilities.exposed(method, interface), # [Exposed] |
145 # TODO(yukishiino): Retire has_custom_registration flag. Should be | 143 # TODO(yukishiino): Retire has_custom_registration flag. Should be |
146 # replaced with V8DOMConfiguration::PropertyLocationConfiguration. | 144 # replaced with V8DOMConfiguration::PropertyLocationConfiguration. |
147 'has_custom_registration': | 145 'has_custom_registration': |
148 v8_utilities.has_extended_attribute( | 146 v8_utilities.has_extended_attribute( |
149 method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES), | 147 method, CUSTOM_REGISTRATION_EXTENDED_ATTRIBUTES), |
150 'has_exception_state': | 148 'has_exception_state': |
151 is_raises_exception or | 149 is_raises_exception or |
152 is_check_security_for_receiver or | 150 is_check_security_for_receiver or |
153 any(argument for argument in arguments | 151 any(argument for argument in arguments |
154 if (argument.idl_type.name == 'SerializedScriptValue' or | 152 if (argument.idl_type.name == 'SerializedScriptValue' or |
155 argument_conversion_needs_exception_state(method, argument))
), | 153 argument_conversion_needs_exception_state(method, argument))
), |
156 'has_optional_argument_without_default_value': | 154 'has_optional_argument_without_default_value': |
157 any(True for argument_context in argument_contexts | 155 any(True for argument_context in argument_contexts |
158 if argument_context['is_optional_without_default_value']), | 156 if argument_context['is_optional_without_default_value']), |
159 'idl_type': idl_type.base_type, | 157 'idl_type': idl_type.base_type, |
160 'is_api_experiment_enabled': v8_utilities.api_experiment_enabled_functio
n(method) or v8_utilities.api_experiment_enabled_function(interface), # [APIExp
erimentEnabled] | 158 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(me
thod) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialE
nabled] |
161 'is_call_with_execution_context': has_extended_attribute_value(method, '
CallWith', 'ExecutionContext'), | 159 'is_call_with_execution_context': has_extended_attribute_value(method, '
CallWith', 'ExecutionContext'), |
162 'is_call_with_script_arguments': is_call_with_script_arguments, | 160 'is_call_with_script_arguments': is_call_with_script_arguments, |
163 'is_call_with_script_state': is_call_with_script_state, | 161 'is_call_with_script_state': is_call_with_script_state, |
164 'is_call_with_this_value': is_call_with_this_value, | 162 'is_call_with_this_value': is_call_with_this_value, |
165 'is_check_security_for_receiver': is_check_security_for_receiver, | 163 'is_check_security_for_receiver': is_check_security_for_receiver, |
166 'is_check_security_for_return_value': is_check_security_for_return_value
, | 164 'is_check_security_for_return_value': is_check_security_for_return_value
, |
167 'is_custom': 'Custom' in extended_attributes and | 165 'is_custom': 'Custom' in extended_attributes and |
168 not (is_custom_call_prologue or is_custom_call_epilogue), | 166 not (is_custom_call_prologue or is_custom_call_epilogue), |
169 'is_custom_call_prologue': is_custom_call_prologue, | 167 'is_custom_call_prologue': is_custom_call_prologue, |
170 'is_custom_call_epilogue': is_custom_call_epilogue, | 168 'is_custom_call_epilogue': is_custom_call_epilogue, |
(...skipping 16 matching lines...) Expand all Loading... |
187 'number_of_required_arguments': len([ | 185 'number_of_required_arguments': len([ |
188 argument for argument in arguments | 186 argument for argument in arguments |
189 if not (argument.is_optional or argument.is_variadic)]), | 187 if not (argument.is_optional or argument.is_variadic)]), |
190 'number_of_required_or_variadic_arguments': len([ | 188 'number_of_required_or_variadic_arguments': len([ |
191 argument for argument in arguments | 189 argument for argument in arguments |
192 if not argument.is_optional]), | 190 if not argument.is_optional]), |
193 'on_instance': v8_utilities.on_instance(interface, method), | 191 'on_instance': v8_utilities.on_instance(interface, method), |
194 'on_interface': v8_utilities.on_interface(interface, method), | 192 'on_interface': v8_utilities.on_interface(interface, method), |
195 'on_prototype': v8_utilities.on_prototype(interface, method), | 193 'on_prototype': v8_utilities.on_prototype(interface, method), |
196 'only_exposed_to_private_script': is_only_exposed_to_private_script, | 194 'only_exposed_to_private_script': is_only_exposed_to_private_script, |
| 195 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(metho
d), # [OriginTrialEnabled] |
| 196 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_
function(interface), # [OriginTrialEnabled] |
197 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( | 197 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( |
198 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', bailout_return_value='false'), | 198 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', bailout_return_value='false'), |
199 'property_attributes': property_attributes(interface, method), | 199 'property_attributes': property_attributes(interface, method), |
200 'returns_promise': method.returns_promise, | 200 'returns_promise': method.returns_promise, |
201 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] | 201 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] |
202 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), | 202 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), |
203 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, | 203 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, |
204 'use_local_result': use_local_result(method), | 204 'use_local_result': use_local_result(method), |
205 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), | 205 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), |
206 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), | 206 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 return method.idl_type and method.idl_type.name == 'Promise' | 479 return method.idl_type and method.idl_type.name == 'Promise' |
480 | 480 |
481 IdlOperation.returns_promise = property(method_returns_promise) | 481 IdlOperation.returns_promise = property(method_returns_promise) |
482 | 482 |
483 | 483 |
484 def argument_conversion_needs_exception_state(method, argument): | 484 def argument_conversion_needs_exception_state(method, argument): |
485 idl_type = argument.idl_type | 485 idl_type = argument.idl_type |
486 return (idl_type.v8_conversion_needs_exception_state or | 486 return (idl_type.v8_conversion_needs_exception_state or |
487 argument.is_variadic or | 487 argument.is_variadic or |
488 (method.returns_promise and idl_type.is_string_type)) | 488 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |