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

Unified Diff: lib/html/scripts/systemnative.py

Issue 10905265: Support sequence<T> as native bindings arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/systemnative.py
diff --git a/lib/html/scripts/systemnative.py b/lib/html/scripts/systemnative.py
index 28005474e9c5d6b54fc6a04c388876dbf4806f05..14189bab17a2eef240d6a0928861f895e01e3fe6 100644
--- a/lib/html/scripts/systemnative.py
+++ b/lib/html/scripts/systemnative.py
@@ -825,17 +825,25 @@ class NativeImplementationGenerator(systembase.BaseGenerator):
# Emit arguments.
start_index = 1 if needs_receiver else 0
for i, argument in enumerate(arguments):
+ type_info = self._TypeInfo(argument.type.id)
argument_expression_template, type, cls, function = \
- self._TypeInfo(argument.type.id).to_native_info(argument, self._interface.id)
+ type_info.to_native_info(argument, self._interface.id)
if ((IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument)) or
(argument.ext_attrs.get('Optional') == 'DefaultIsNullString')):
function += 'WithNullCheck'
argument_name = DartDomNameOfAttribute(argument)
+ if type_info.pass_native_by_ref():
+ invocation_template =\
+ ' $TYPE $ARGUMENT_NAME;\n'\
podivilov 2012/09/14 08:06:06 nit: unnecessary trailing \
Anton Muhin 2012/09/14 12:32:58 No, it's necessary. Another option would be to pu
+ ' $CLS::$FUNCTION($ARGUMENT_NAME, Dart_GetNativeArgument(args, $INDEX), exception);\n'
podivilov 2012/09/14 08:06:06 nit: Dart_GetNativeArgument should come first.
Anton Muhin 2012/09/14 12:32:58 Done.
+ else:
+ invocation_template =\
+ ' $TYPE $ARGUMENT_NAME = $CLS::$FUNCTION(Dart_GetNativeArgument(args, $INDEX), exception);\n'
body_emitter.Emit(
- '\n'
- ' $TYPE $ARGUMENT_NAME = $CLS::$FUNCTION(Dart_GetNativeArgument(args, $INDEX), exception);\n'
+ '\n' +
+ invocation_template +
' if (exception)\n'
' goto fail;\n',
TYPE=type,
« no previous file with comments | « lib/html/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698