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

Unified Diff: tools/dom/scripts/systemnative.py

Issue 21156011: Alter the native code generator to directly use (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698