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

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

Issue 11040059: Add interface_name and implementation_name to IDLTypeInfo class and use them instead of dart_type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
Index: lib/html/scripts/generator.py
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index 99f2190270186e02cc09daeacd17bd5e806cce4e..574430f93dafb3acef998bd3702a9e0d306f9f34 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -615,6 +615,12 @@ class IDLTypeInfo(object):
def narrow_dart_type(self):
return self.dart_type()
+ def interface_name(self):
+ raise NotImplementedError()
+
+ def implementation_name(self):
+ raise NotImplementedError()
+
def native_type(self):
return self._data.native_type or self._idl_type
@@ -715,6 +721,15 @@ class InterfaceIDLTypeInfo(IDLTypeInfo):
return self.idl_type()
return ImplementationClassName(self._dart_interface_name)
Anton Muhin 2012/10/05 15:15:31 why not implementation_name here? And overall, it
podivilov 2012/10/05 16:02:51 Done.
Anton Muhin 2012/10/05 16:04:16 I do understand that, but presence of both is real
podivilov1 2012/10/05 17:31:43 Renamed
+ def interface_name(self):
+ return self._dart_interface_name
+
+ def implementation_name(self):
+ # TODO(podivilov): introduce ListLikeIDLTypeInfo and remove this hack.
+ if self._data.suppress_public_interface:
+ return ImplementationClassName(self.idl_type())
+ return ImplementationClassName(self._dart_interface_name)
+
class CallbackIDLTypeInfo(IDLTypeInfo):
def __init__(self, idl_type, data):
@@ -729,6 +744,12 @@ class SequenceIDLTypeInfo(IDLTypeInfo):
def dart_type(self):
return 'List<%s>' % self._item_info.dart_type()
+ def interface_name(self):
+ return self.dart_type()
+
+ def implementation_name(self):
+ return self.dart_type()
+
def vector_to_dart_template_parameter(self):
raise Exception('sequences of sequences are not supported yet')

Powered by Google App Engine
This is Rietveld 408576698