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

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

Issue 1047993002: bindings: Add validation for enum Sequence or Array (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 raw_type=True, 214 raw_type=True,
215 used_as_variadic_argument=argument.is _variadic) 215 used_as_variadic_argument=argument.is _variadic)
216 return { 216 return {
217 'cpp_type': ( 217 'cpp_type': (
218 v8_types.cpp_template_type('Nullable', this_cpp_type) 218 v8_types.cpp_template_type('Nullable', this_cpp_type)
219 if idl_type.is_explicit_nullable and not argument.is_variadic 219 if idl_type.is_explicit_nullable and not argument.is_variadic
220 else this_cpp_type), 220 else this_cpp_type),
221 'cpp_value': this_cpp_value, 221 'cpp_value': this_cpp_value,
222 # FIXME: check that the default value's type is compatible with the argu ment's 222 # FIXME: check that the default value's type is compatible with the argu ment's
223 'set_default_value': set_default_value, 223 'set_default_value': set_default_value,
224 'enum_validation_expression': idl_type.enum_validation_expression, 224 'enum_values': idl_type.enum_values,
225 'handle': '%sHandle' % argument.name, 225 'handle': '%sHandle' % argument.name,
226 # FIXME: remove once [Default] removed and just use argument.default_val ue 226 # FIXME: remove once [Default] removed and just use argument.default_val ue
227 'has_default': 'Default' in extended_attributes or set_default_value, 227 'has_default': 'Default' in extended_attributes or set_default_value,
228 'has_type_checking_interface': has_type_checking_interface, 228 'has_type_checking_interface': has_type_checking_interface,
229 # Dictionary is special-cased, but arrays and sequences shouldn't be 229 # Dictionary is special-cased, but arrays and sequences shouldn't be
230 'idl_type': idl_type.base_type, 230 'idl_type': idl_type.base_type,
231 'idl_type_object': idl_type, 231 'idl_type_object': idl_type,
232 'index': index, 232 'index': index,
233 'is_callback_function': idl_type.is_callback_function, 233 'is_callback_function': idl_type.is_callback_function,
234 'is_callback_interface': idl_type.is_callback_interface, 234 'is_callback_interface': idl_type.is_callback_interface,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 450
451 IdlOperation.returns_promise = property(method_returns_promise) 451 IdlOperation.returns_promise = property(method_returns_promise)
452 452
453 453
454 def argument_conversion_needs_exception_state(method, argument): 454 def argument_conversion_needs_exception_state(method, argument):
455 idl_type = argument.idl_type 455 idl_type = argument.idl_type
456 return (idl_type.v8_conversion_needs_exception_state or 456 return (idl_type.v8_conversion_needs_exception_state or
457 argument.is_variadic or 457 argument.is_variadic or
458 (method.returns_promise and (idl_type.is_string_type or 458 (method.returns_promise and (idl_type.is_string_type or
459 idl_type.is_enum))) 459 idl_type.is_enum)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698