Chromium Code Reviews| Index: lib/dom/scripts/systemnative.py |
| diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py |
| index 3f086f6257113bec7ae3a8d93c89e814f6fc35a0..f2c84cc5ce6eabc3e7773a755495513991ec66c2 100644 |
| --- a/lib/dom/scripts/systemnative.py |
| +++ b/lib/dom/scripts/systemnative.py |
| @@ -829,16 +829,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) |
| - self._cpp_impl_includes |= set(type_info.to_native_includes()) |
| argument_name = DartDomNameOfAttribute(argument) |
| - type_info.emit_to_native( |
| - body_emitter, |
| + argument_expression, type, cls, function = self._TypeInfo(argument.type.id).to_native_info( |
|
podivilov
2012/08/22 15:21:05
consider returning 'cls::function' to simplify to_
Anton Muhin
2012/08/22 16:38:51
I'd rather not duplicate this logic over here, let
|
| argument, |
| (IsOptional(argument) and not self._IsArgumentOptionalInWebCore(node, argument)) or (argument.ext_attrs.get('Optional') == 'DefaultIsNullString'), |
| argument_name, |
| - 'Dart_GetNativeArgument(args, %i)' % (start_index + i)) |
| - cpp_arguments.append(type_info.argument_expression(argument_name, self._interface.id)) |
| + self._interface.id) |
| + |
| + body_emitter.Emit( |
| + '\n' |
| + ' $TYPE $ARGUMENT_NAME = $CLS::$FUNCTION(Dart_GetNativeArgument(args, $NO), exception);\n' |
| + ' if (exception)\n' |
| + ' goto fail;\n', |
| + TYPE=type, |
| + ARGUMENT_NAME=argument_name, |
| + CLS=cls, |
| + FUNCTION=function, |
| + NO=start_index + i) |
|
podivilov
2012/08/22 15:21:05
nit: INDEX=...
Anton Muhin
2012/08/22 16:38:51
Done.
|
| + self._cpp_impl_includes.add('"%s.h"' % cls) |
| + cpp_arguments.append(argument_expression) |
| body_emitter.Emit('\n') |