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

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

Issue 10122011: Do not use overloaded toDartValue for primitive types. (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
« lib/dom/scripts/generator.py ('K') | « lib/dom/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/dom/scripts/systemnative.py
diff --git a/lib/dom/scripts/systemnative.py b/lib/dom/scripts/systemnative.py
index 1bb37dababd0662acf49a120d7935b6d55c6a9ac..13445af9b29852a8feaf122623dab99ee6aed73a 100644
--- a/lib/dom/scripts/systemnative.py
+++ b/lib/dom/scripts/systemnative.py
@@ -70,9 +70,11 @@ class NativeImplementationSystem(System):
if operation.type.id == 'void':
return_type = 'void'
return_prefix = ''
+ error_return = ''
else:
return_type = 'bool'
return_prefix = 'return '
+ error_return = ' false'
parameters = []
arguments = []
@@ -80,7 +82,7 @@ class NativeImplementationSystem(System):
argument_type_info = GetIDLTypeInfo(argument.type.id)
parameters.append('%s %s' % (argument_type_info.parameter_type(),
argument.id))
- arguments.append(argument.id)
+ arguments.append(argument_type_info.to_dart_conversion(argument.id))
cpp_impl_includes |= set(argument_type_info.conversion_includes())
cpp_header_handlers_emitter.Emit(
@@ -92,11 +94,16 @@ class NativeImplementationSystem(System):
'\n'
'$TYPE $CLASS_NAME::handleEvent($PARAMETERS)\n'
'{\n'
+ ' if (!m_callback.isolate()->isAlive())\n'
+ ' return$ERROR_RETURN;\n'
+ ' DartIsolate::Scope scope(m_callback.isolate());\n'
+ ' DartApiScope apiScope;\n'
' $(RETURN_PREFIX)m_callback.handleEvent($ARGUMENTS);\n'
'}\n',
TYPE=return_type,
CLASS_NAME=class_name,
PARAMETERS=', '.join(parameters),
+ ERROR_RETURN=error_return,
RETURN_PREFIX=return_prefix,
ARGUMENTS=', '.join(arguments))
« lib/dom/scripts/generator.py ('K') | « lib/dom/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698