Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/v8_methods.py

Issue 1940253002: Disallow certain blocking DOM calls during microtask execution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 'is_variadic': arguments and arguments[-1].is_variadic, 172 'is_variadic': arguments and arguments[-1].is_variadic,
173 'measure_as': v8_utilities.measure_as(method, interface), # [MeasureAs] 173 'measure_as': v8_utilities.measure_as(method, interface), # [MeasureAs]
174 'name': name, 174 'name': name,
175 'number_of_arguments': len(arguments), 175 'number_of_arguments': len(arguments),
176 'number_of_required_arguments': len([ 176 'number_of_required_arguments': len([
177 argument for argument in arguments 177 argument for argument in arguments
178 if not (argument.is_optional or argument.is_variadic)]), 178 if not (argument.is_optional or argument.is_variadic)]),
179 'number_of_required_or_variadic_arguments': len([ 179 'number_of_required_or_variadic_arguments': len([
180 argument for argument in arguments 180 argument for argument in arguments
181 if not argument.is_optional]), 181 if not argument.is_optional]),
182 'not_during_microtasks': 'NotDuringMicrotasks' in extended_attributes,
182 'on_instance': v8_utilities.on_instance(interface, method), 183 'on_instance': v8_utilities.on_instance(interface, method),
183 'on_interface': v8_utilities.on_interface(interface, method), 184 'on_interface': v8_utilities.on_interface(interface, method),
184 'on_prototype': v8_utilities.on_prototype(interface, method), 185 'on_prototype': v8_utilities.on_prototype(interface, method),
185 'only_exposed_to_private_script': is_only_exposed_to_private_script, 186 'only_exposed_to_private_script': is_only_exposed_to_private_script,
186 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct ion_name(method, interface), # [OriginTrialEnabled] 187 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct ion_name(method, interface), # [OriginTrialEnabled]
187 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value( 188 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value(
188 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is olate()', bailout_return_value='false'), 189 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is olate()', bailout_return_value='false'),
189 'property_attributes': property_attributes(interface, method), 190 'property_attributes': property_attributes(interface, method),
190 'returns_promise': method.returns_promise, 191 'returns_promise': method.returns_promise,
191 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled] 192 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(m ethod), # [RuntimeEnabled]
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 return method.idl_type and method.idl_type.name == 'Promise' 458 return method.idl_type and method.idl_type.name == 'Promise'
458 459
459 IdlOperation.returns_promise = property(method_returns_promise) 460 IdlOperation.returns_promise = property(method_returns_promise)
460 461
461 462
462 def argument_conversion_needs_exception_state(method, argument): 463 def argument_conversion_needs_exception_state(method, argument):
463 idl_type = argument.idl_type 464 idl_type = argument.idl_type
464 return (idl_type.v8_conversion_needs_exception_state or 465 return (idl_type.v8_conversion_needs_exception_state or
465 argument.is_variadic or 466 argument.is_variadic or
466 (method.returns_promise and idl_type.is_string_type)) 467 (method.returns_promise and idl_type.is_string_type))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698