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

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

Issue 113743003: Add more functions to the list of leaf functions which do not need an (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/generator.py
===================================================================
--- tools/dom/scripts/generator.py (revision 31522)
+++ tools/dom/scripts/generator.py (working copy)
@@ -725,9 +725,12 @@
def to_dart_conversion(self, value, interface_name=None, attributes=None):
return 'Dart%s::toDart(%s)' % (self._idl_type, value)
- def return_to_dart_conversion(self, value,
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup,
interface_name=None, attributes=None):
- return 'Dart%s::returnToDart(args, %s)' % (self._idl_type, value)
+ auto_dart_scope='true' if auto_dart_scope_setup else 'false'
+ return 'Dart%s::returnToDart(args, %s, %s)' % (self._idl_type,
+ value,
+ auto_dart_scope)
def custom_to_dart(self):
return self._data.custom_to_dart
@@ -855,7 +858,7 @@
return 'DartDOMWrapper::vectorToDart(%s)' % value
return 'DartDOMWrapper::vectorToDart<%s>(%s)' % (self._item_info.bindings_class(), value)
- def return_to_dart_conversion(self, value,
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup=True,
interface_name=None, attributes=None):
return 'Dart_SetReturnValue(args, %s)' % self.to_dart_conversion(
value,
@@ -922,7 +925,7 @@
function_name += 'WithNullCheck'
return '%s(%s)' % (function_name, value)
- def return_to_dart_conversion(self, value,
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup=True,
interface_name=None, attributes=None):
return 'Dart_SetReturnValue(args, %s)' % self.to_dart_conversion(
value,
@@ -977,12 +980,15 @@
def to_dart_conversion(self, value, interface_name, attributes):
return 'Dart%s::toDart(%s)' % (self._idl_type, self.to_conversion_cast(value, interface_name, attributes))
- def return_to_dart_conversion(self, value, interface_name, attr):
- return 'Dart%s::returnToDart(args, %s)' % (self._idl_type,
- self.to_conversion_cast(
- value,
- interface_name,
- attr))
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup,
+ interface_name, attr):
+ auto_dart_scope='true' if auto_dart_scope_setup else 'false'
+ return 'Dart%s::returnToDart(args, %s, %s)' % (self._idl_type,
+ self.to_conversion_cast(
+ value,
+ interface_name,
+ attr),
+ auto_dart_scope)
def argument_expression(self, name, interface_name):
return name if interface_name.endswith('List') else '%s->propertyReference()' % name
@@ -999,7 +1005,8 @@
def to_dart_conversion(self, value, interface_name, attributes):
return 'DartUtilities::arrayBufferViewToDart(%s)' % value
- def return_to_dart_conversion(self, value, interface_name, attributes):
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup,
+ interface_name, attributes):
return 'Dart_SetReturnValue(args, %s)' % self.to_dart_conversion(
value,
interface_name,
@@ -1022,7 +1029,8 @@
function_name = function_name[0].lower() + function_name[1:]
return '%s(%s)' % (function_name, value)
- def return_to_dart_conversion(self, value, interface_name, attributes):
+ def return_to_dart_conversion(self, value, auto_dart_scope_setup,
+ interface_name, attributes):
return 'Dart_SetReturnValue(args, %s)' % self.to_dart_conversion(
value,
interface_name,
« no previous file with comments | « no previous file | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698