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

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

Issue 723013003: IDL: Improve overload resolution for methods with variadic arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: the fix Created 6 years, 1 month 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 | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 idl_type.name in ('Float', 'Double'), 228 idl_type.name in ('Float', 'Double'),
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_interface': idl_type.is_callback_interface, 233 'is_callback_interface': idl_type.is_callback_interface,
234 # FIXME: Remove generic 'Dictionary' special-casing 234 # FIXME: Remove generic 'Dictionary' special-casing
235 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary', 235 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary',
236 'is_nullable': idl_type.is_nullable, 236 'is_nullable': idl_type.is_nullable,
237 'is_optional': argument.is_optional, 237 'is_optional': argument.is_optional,
238 'is_variadic': argument.is_variadic,
238 'is_variadic_wrapper_type': is_variadic_wrapper_type, 239 'is_variadic_wrapper_type': is_variadic_wrapper_type,
239 'is_wrapper_type': idl_type.is_wrapper_type, 240 'is_wrapper_type': idl_type.is_wrapper_type,
240 'name': argument.name, 241 'name': argument.name,
241 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 242 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
242 argument.name, isolate='scriptState->isolate()', 243 argument.name, isolate='scriptState->isolate()',
243 creation_context='scriptState->context()->Global()'), 244 creation_context='scriptState->context()->Global()'),
244 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value), 245 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value),
245 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True), 246 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True),
246 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind ex, type_checked, return_promise=method.returns_promise), 247 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind ex, type_checked, return_promise=method.returns_promise),
247 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc _type), 248 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc _type),
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 441
441 IdlOperation.returns_promise = property(method_returns_promise) 442 IdlOperation.returns_promise = property(method_returns_promise)
442 443
443 444
444 def argument_conversion_needs_exception_state(method, argument): 445 def argument_conversion_needs_exception_state(method, argument):
445 idl_type = argument.idl_type 446 idl_type = argument.idl_type
446 return (idl_type.v8_conversion_needs_exception_state or 447 return (idl_type.v8_conversion_needs_exception_state or
447 argument.is_variadic or 448 argument.is_variadic or
448 (method.returns_promise and (idl_type.is_string_type or 449 (method.returns_promise and (idl_type.is_string_type or
449 idl_type.is_enum))) 450 idl_type.is_enum)))
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698