| 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,
|
|
|