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

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

Issue 10161023: Fix Windows build. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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: lib/dom/scripts/systemnative.py
diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py
index 495a362ccc4f36d3d5263d9688ad02e36013cadd..a1de7b5b35683a6d4e8a94ee4de3b18c90c479f2 100644
--- a/lib/dom/scripts/systemnative.py
+++ b/lib/dom/scripts/systemnative.py
@@ -89,6 +89,9 @@ class NativeImplementationSystem(System):
' virtual $TYPE handleEvent($PARAMETERS);\n',
TYPE=native_return_type, PARAMETERS=', '.join(parameters))
+ arguments_declaration = 'Dart_Handle arguments[] = { %s }' % ', '.join(arguments)
+ if not len(arguments):
+ arguments_declaration = 'Dart_Handle* arguments = 0'
cpp_impl_handlers_emitter.Emit(
'\n'
'$TYPE $CLASS_NAME::handleEvent($PARAMETERS)\n'
@@ -97,7 +100,7 @@ class NativeImplementationSystem(System):
' return$ERROR_RETURN;\n'
' DartIsolate::Scope scope(m_callback.isolate());\n'
' DartApiScope apiScope;\n'
- ' Dart_Handle arguments[] = { $ARGUMENTS };\n'
+ ' $ARGUMENTS_DECLARATION;\n'
' $(RETURN_PREFIX)m_callback.handleEvent($ARGUMENT_COUNT, arguments);\n'
'}\n',
TYPE=native_return_type,
@@ -105,7 +108,7 @@ class NativeImplementationSystem(System):
PARAMETERS=', '.join(parameters),
ERROR_RETURN=error_return,
RETURN_PREFIX=return_prefix,
- ARGUMENTS=', '.join(arguments),
+ ARGUMENTS_DECLARATION=arguments_declaration,
ARGUMENT_COUNT=len(arguments))
cpp_header_path = self._FilePathForCppHeader(self._interface.id)
« 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