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

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

Issue 10206017: Do not use overloaded toDartValue for bindings classes. (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 | « lib/dom/idl/dart/dart.idl ('k') | lib/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/generator.py
diff --git a/lib/dom/scripts/generator.py b/lib/dom/scripts/generator.py
index 275bae51e362ecbd00f5ea98b33133f2651dacdf..9aa53b9d705ed8ac21164aa8ce16e4970bc0a7e3 100644
--- a/lib/dom/scripts/generator.py
+++ b/lib/dom/scripts/generator.py
@@ -476,10 +476,10 @@ class IDLTypeInfo(object):
]
if self._idl_type in WTF_INCLUDES:
- return ['<wtf/%s.h>' % self._idl_type]
+ return ['<wtf/%s.h>' % self.native_type()]
if not self._idl_type.startswith('SVG'):
- return ['"%s.h"' % self._idl_type]
+ return ['"%s.h"' % self.native_type()]
if self._idl_type in ['SVGNumber', 'SVGPoint']:
return []
@@ -496,7 +496,7 @@ class IDLTypeInfo(object):
return ['"Dart%s.h"' % include for include in self._conversion_includes]
def to_dart_conversion(self, value, interface_name=None, attributes=None):
- return 'toDartValue(%s)' % value
+ return 'Dart%s::toDart(%s)' % (self._idl_type, value)
def custom_to_dart(self):
return self._custom_to_dart
@@ -510,6 +510,9 @@ class SequenceIDLTypeInfo(IDLTypeInfo):
def dart_type(self):
return 'List<%s>' % self._item_info.dart_type()
+ def to_dart_conversion(self, value, interface_name=None, attributes=None):
+ return 'DartDOMWrapper::vectorToDart<Dart%s>(%s)' % (self._item_info.native_type(), value)
+
def conversion_includes(self):
return self._item_info.conversion_includes()
@@ -590,7 +593,7 @@ class SVGTearOffIDLTypeInfo(IDLTypeInfo):
else:
conversion_cast = 'static_cast<%s*>(%s)'
conversion_cast = conversion_cast % (self.native_type(), value)
- return 'toDartValue(%s)' % conversion_cast
+ return 'Dart%s::toDart(%s)' % (self._idl_type, conversion_cast)
_idl_type_registry = {
'boolean': PrimitiveIDLTypeInfo('boolean', dart_type='bool', native_type='bool',
@@ -639,7 +642,7 @@ _idl_type_registry = {
'void': PrimitiveIDLTypeInfo('void', dart_type='void'),
'CSSRule': IDLTypeInfo('CSSRule', conversion_includes=['CSSImportRule']),
- 'DOMException': IDLTypeInfo('DOMCoreException', dart_type='DOMException'),
+ 'DOMException': IDLTypeInfo('DOMException', native_type='DOMCoreException'),
'DOMStringMap': IDLTypeInfo('DOMStringMap', dart_type='Map<String, String>'),
'DOMWindow': IDLTypeInfo('DOMWindow', custom_to_dart=True),
'Element': IDLTypeInfo('Element', custom_to_dart=True),
« no previous file with comments | « lib/dom/idl/dart/dart.idl ('k') | lib/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698