| 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 'RuntimeEnabled' in extended_attributes: | |
| 122 includes.add('platform/RuntimeEnabledFeatures.h') | |
| 123 | |
| 124 if 'OriginTrialEnabled' in extended_attributes: | |
| 125 includes.add('core/inspector/ConsoleMessage.h') | |
| 126 includes.add('core/origin_trials/OriginTrials.h') | |
| 127 | |
| 128 argument_contexts = [ | 121 argument_contexts = [ |
| 129 argument_context(interface, method, argument, index, is_visible=is_visib
le) | 122 argument_context(interface, method, argument, index, is_visible=is_visib
le) |
| 130 for index, argument in enumerate(arguments)] | 123 for index, argument in enumerate(arguments)] |
| 131 | 124 |
| 132 return { | 125 return { |
| 133 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] | 126 'activity_logging_world_list': v8_utilities.activity_logging_world_list(
method), # [ActivityLogging] |
| 134 'arguments': argument_contexts, | 127 'arguments': argument_contexts, |
| 135 'argument_declarations_for_private_script': | 128 'argument_declarations_for_private_script': |
| 136 argument_declarations_for_private_script(interface, method), | 129 argument_declarations_for_private_script(interface, method), |
| 137 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type) | 130 'cpp_type': (v8_types.cpp_template_type('Nullable', idl_type.cpp_type) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 151 'has_exception_state': | 144 'has_exception_state': |
| 152 is_raises_exception or | 145 is_raises_exception or |
| 153 is_check_security_for_receiver or | 146 is_check_security_for_receiver or |
| 154 any(argument for argument in arguments | 147 any(argument for argument in arguments |
| 155 if (argument.idl_type.name == 'SerializedScriptValue' or | 148 if (argument.idl_type.name == 'SerializedScriptValue' or |
| 156 argument_conversion_needs_exception_state(method, argument))
), | 149 argument_conversion_needs_exception_state(method, argument))
), |
| 157 'has_optional_argument_without_default_value': | 150 'has_optional_argument_without_default_value': |
| 158 any(True for argument_context in argument_contexts | 151 any(True for argument_context in argument_contexts |
| 159 if argument_context['is_optional_without_default_value']), | 152 if argument_context['is_optional_without_default_value']), |
| 160 'idl_type': idl_type.base_type, | 153 'idl_type': idl_type.base_type, |
| 161 'is_origin_trial_enabled': v8_utilities.origin_trial_enabled_function(me
thod) or v8_utilities.origin_trial_enabled_function(interface), # [OriginTrialE
nabled] | |
| 162 'is_call_with_execution_context': has_extended_attribute_value(method, '
CallWith', 'ExecutionContext'), | 154 'is_call_with_execution_context': has_extended_attribute_value(method, '
CallWith', 'ExecutionContext'), |
| 163 'is_call_with_script_arguments': is_call_with_script_arguments, | 155 'is_call_with_script_arguments': is_call_with_script_arguments, |
| 164 'is_call_with_script_state': is_call_with_script_state, | 156 'is_call_with_script_state': is_call_with_script_state, |
| 165 'is_call_with_this_value': is_call_with_this_value, | 157 'is_call_with_this_value': is_call_with_this_value, |
| 166 'is_check_security_for_receiver': is_check_security_for_receiver, | 158 'is_check_security_for_receiver': is_check_security_for_receiver, |
| 167 'is_check_security_for_return_value': is_check_security_for_return_value
, | 159 'is_check_security_for_return_value': is_check_security_for_return_value
, |
| 168 'is_custom': 'Custom' in extended_attributes and | 160 'is_custom': 'Custom' in extended_attributes and |
| 169 not (is_custom_call_prologue or is_custom_call_epilogue), | 161 not (is_custom_call_prologue or is_custom_call_epilogue), |
| 170 'is_custom_call_prologue': is_custom_call_prologue, | 162 'is_custom_call_prologue': is_custom_call_prologue, |
| 171 'is_custom_call_epilogue': is_custom_call_epilogue, | 163 'is_custom_call_epilogue': is_custom_call_epilogue, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 188 'number_of_required_arguments': len([ | 180 'number_of_required_arguments': len([ |
| 189 argument for argument in arguments | 181 argument for argument in arguments |
| 190 if not (argument.is_optional or argument.is_variadic)]), | 182 if not (argument.is_optional or argument.is_variadic)]), |
| 191 'number_of_required_or_variadic_arguments': len([ | 183 'number_of_required_or_variadic_arguments': len([ |
| 192 argument for argument in arguments | 184 argument for argument in arguments |
| 193 if not argument.is_optional]), | 185 if not argument.is_optional]), |
| 194 'on_instance': v8_utilities.on_instance(interface, method), | 186 'on_instance': v8_utilities.on_instance(interface, method), |
| 195 'on_interface': v8_utilities.on_interface(interface, method), | 187 'on_interface': v8_utilities.on_interface(interface, method), |
| 196 'on_prototype': v8_utilities.on_prototype(interface, method), | 188 'on_prototype': v8_utilities.on_prototype(interface, method), |
| 197 'only_exposed_to_private_script': is_only_exposed_to_private_script, | 189 'only_exposed_to_private_script': is_only_exposed_to_private_script, |
| 198 'origin_trial_enabled': v8_utilities.origin_trial_enabled_function(metho
d), # [OriginTrialEnabled] | 190 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct
ion_name(method, interface), # [OriginTrialEnabled] |
| 199 'origin_trial_enabled_per_interface': v8_utilities.origin_trial_enabled_
function(interface), # [OriginTrialEnabled] | |
| 200 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( | 191 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local
_cpp_value( |
| 201 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', bailout_return_value='false'), | 192 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is
olate()', bailout_return_value='false'), |
| 202 'property_attributes': property_attributes(interface, method), | 193 'property_attributes': property_attributes(interface, method), |
| 203 'returns_promise': method.returns_promise, | 194 'returns_promise': method.returns_promise, |
| 204 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] | 195 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m
ethod), # [RuntimeEnabled] |
| 205 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), | 196 'should_be_exposed_to_script': not (is_implemented_in_private_script and
is_only_exposed_to_private_script), |
| 206 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, | 197 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res
ult, |
| 207 'use_local_result': use_local_result(method), | 198 'use_local_result': use_local_result(method), |
| 208 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), | 199 'v8_set_return_value': v8_set_return_value(interface.name, method, this_
cpp_value), |
| 209 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name
, method, this_cpp_value, for_main_world=True), | 200 '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... |
| 482 return method.idl_type and method.idl_type.name == 'Promise' | 473 return method.idl_type and method.idl_type.name == 'Promise' |
| 483 | 474 |
| 484 IdlOperation.returns_promise = property(method_returns_promise) | 475 IdlOperation.returns_promise = property(method_returns_promise) |
| 485 | 476 |
| 486 | 477 |
| 487 def argument_conversion_needs_exception_state(method, argument): | 478 def argument_conversion_needs_exception_state(method, argument): |
| 488 idl_type = argument.idl_type | 479 idl_type = argument.idl_type |
| 489 return (idl_type.v8_conversion_needs_exception_state or | 480 return (idl_type.v8_conversion_needs_exception_state or |
| 490 argument.is_variadic or | 481 argument.is_variadic or |
| 491 (method.returns_promise and idl_type.is_string_type)) | 482 (method.returns_promise and idl_type.is_string_type)) |
| OLD | NEW |