Chromium Code Reviews| Index: tools/dom/scripts/systemnative.py |
| =================================================================== |
| --- tools/dom/scripts/systemnative.py (revision 25657) |
| +++ tools/dom/scripts/systemnative.py (working copy) |
| @@ -899,12 +899,18 @@ |
| value_expression = function_call |
| # Generate to Dart conversion of C++ value. |
| - to_dart_conversion = return_type_info.to_dart_conversion(value_expression, self._interface.id, ext_attrs) |
| + if return_type_info.native_type() == 'bool': |
| + set_return_value = 'Dart_SetBooleanReturnValue(args, %s)' % (value_expression) |
| + elif return_type_info.native_type() == 'int': |
| + set_return_value = 'Dart_SetIntegerReturnValue(args, %s)' % (value_expression) |
| + elif return_type_info.native_type() == 'double': |
| + set_return_value = 'Dart_SetDoubleReturnValue(args, %s)' % (value_expression) |
| + else: |
| + to_dart_conversion = return_type_info.to_dart_conversion(value_expression, self._interface.id, ext_attrs) |
| + set_return_value = 'Dart_SetReturnValue(args, %s)' % (to_dart_conversion) |
|
vsm
2013/07/31 14:59:19
Do we need to still test whether to_dart_conversio
siva
2013/07/31 18:51:59
All the toDart methods are expected to return Dart
|
| invocation_emitter.Emit( |
| - ' Dart_Handle returnValue = $TO_DART_CONVERSION;\n' |
| - ' if (returnValue)\n' |
| - ' Dart_SetReturnValue(args, returnValue);\n', |
| - TO_DART_CONVERSION=to_dart_conversion) |
| + ' $RETURN_VALUE;\n', |
| + RETURN_VALUE=set_return_value) |
| def _GenerateNativeBinding(self, idl_name, argument_count, dart_declaration, |
| native_suffix, is_custom, emit_metadata=True): |