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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise
): | 364 def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise
): |
365 assert argument.is_variadic | 365 assert argument.is_variadic |
366 idl_type = argument.idl_type | 366 idl_type = argument.idl_type |
367 this_cpp_type = idl_type.cpp_type | 367 this_cpp_type = idl_type.cpp_type |
368 | 368 |
369 if method.returns_promise: | 369 if method.returns_promise: |
370 check_expression = 'exceptionState.hadException()' | 370 check_expression = 'exceptionState.hadException()' |
371 else: | 371 else: |
372 check_expression = 'exceptionState.throwIfNeeded()' | 372 check_expression = 'exceptionState.throwIfNeeded()' |
373 | 373 |
| 374 if idl_type.is_dictionary or idl_type.is_union_type: |
| 375 vector_type = 'HeapVector' |
| 376 else: |
| 377 vector_type = 'Vector' |
| 378 |
374 return { | 379 return { |
375 'assign_expression': 'toImplArguments<%s>(info, %s, exceptionState)' % (
this_cpp_type, index), | 380 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)'
% (vector_type, this_cpp_type, index), |
376 'check_expression': check_expression, | 381 'check_expression': check_expression, |
377 'cpp_type': this_cpp_type, | 382 'cpp_type': this_cpp_type, |
378 'cpp_name': argument.name, | 383 'cpp_name': argument.name, |
379 'declare_variable': False, | 384 'declare_variable': False, |
380 } | 385 } |
381 | 386 |
382 | 387 |
383 def v8_value_to_local_cpp_value(method, argument, index, return_promise=False, r
estricted_float=False): | 388 def v8_value_to_local_cpp_value(method, argument, index, return_promise=False, r
estricted_float=False): |
384 extended_attributes = argument.extended_attributes | 389 extended_attributes = argument.extended_attributes |
385 idl_type = argument.idl_type | 390 idl_type = argument.idl_type |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 return method.idl_type and method.idl_type.name == 'Promise' | 463 return method.idl_type and method.idl_type.name == 'Promise' |
459 | 464 |
460 IdlOperation.returns_promise = property(method_returns_promise) | 465 IdlOperation.returns_promise = property(method_returns_promise) |
461 | 466 |
462 | 467 |
463 def argument_conversion_needs_exception_state(method, argument): | 468 def argument_conversion_needs_exception_state(method, argument): |
464 idl_type = argument.idl_type | 469 idl_type = argument.idl_type |
465 return (idl_type.v8_conversion_needs_exception_state or | 470 return (idl_type.v8_conversion_needs_exception_state or |
466 argument.is_variadic or | 471 argument.is_variadic or |
467 (method.returns_promise and idl_type.is_string_type)) | 472 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |