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

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

Issue 810563007: IDL: Add missing type-check for callback function arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 'has_default': 'Default' in extended_attributes or set_default_value, 217 'has_default': 'Default' in extended_attributes or set_default_value,
218 'has_type_checking_interface': type_checking_interface, 218 'has_type_checking_interface': type_checking_interface,
219 'has_type_checking_unrestricted': 219 'has_type_checking_unrestricted':
220 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict ed') or 220 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestrict ed') or
221 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted' )) and 221 has_extended_attribute_value(method, 'TypeChecking', 'Unrestricted' )) and
222 idl_type.name in ('Float', 'Double'), 222 idl_type.name in ('Float', 'Double'),
223 # Dictionary is special-cased, but arrays and sequences shouldn't be 223 # Dictionary is special-cased, but arrays and sequences shouldn't be
224 'idl_type': idl_type.base_type, 224 'idl_type': idl_type.base_type,
225 'idl_type_object': idl_type, 225 'idl_type_object': idl_type,
226 'index': index, 226 'index': index,
227 'is_callback_function': idl_type.is_callback_function,
227 'is_callback_interface': idl_type.is_callback_interface, 228 'is_callback_interface': idl_type.is_callback_interface,
228 # FIXME: Remove generic 'Dictionary' special-casing 229 # FIXME: Remove generic 'Dictionary' special-casing
229 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary', 230 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary',
230 'is_nullable': idl_type.is_nullable, 231 'is_nullable': idl_type.is_nullable,
231 'is_optional': argument.is_optional, 232 'is_optional': argument.is_optional,
232 'is_variadic': argument.is_variadic, 233 'is_variadic': argument.is_variadic,
233 'is_variadic_wrapper_type': is_variadic_wrapper_type, 234 'is_variadic_wrapper_type': is_variadic_wrapper_type,
234 'is_wrapper_type': idl_type.is_wrapper_type, 235 'is_wrapper_type': idl_type.is_wrapper_type,
235 'name': argument.name, 236 'name': argument.name,
236 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 237 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 438
438 IdlOperation.returns_promise = property(method_returns_promise) 439 IdlOperation.returns_promise = property(method_returns_promise)
439 440
440 441
441 def argument_conversion_needs_exception_state(method, argument): 442 def argument_conversion_needs_exception_state(method, argument):
442 idl_type = argument.idl_type 443 idl_type = argument.idl_type
443 return (idl_type.v8_conversion_needs_exception_state or 444 return (idl_type.v8_conversion_needs_exception_state or
444 argument.is_variadic or 445 argument.is_variadic or
445 (method.returns_promise and (idl_type.is_string_type or 446 (method.returns_promise and (idl_type.is_string_type or
446 idl_type.is_enum))) 447 idl_type.is_enum)))
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698