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

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: Rename ImplementationClassName to ImplementationClassNameForInterfaceName. 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
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/scripts/generator.py
diff --git a/lib/html/scripts/generator.py b/lib/html/scripts/generator.py
index 99f2190270186e02cc09daeacd17bd5e806cce4e..e59f677d77317392ff2353df1417c32d1dac7ca2 100644
--- a/lib/html/scripts/generator.py
+++ b/lib/html/scripts/generator.py
@@ -506,7 +506,7 @@ def TypeName(type_ids, interface):
# Dynamically type this field for now.
return 'Dynamic'
-def ImplementationClassName(interface_name):
+def ImplementationClassNameForInterfaceName(interface_name):
return '_%sImpl' % interface_name
# ------------------------------------------------------------------------------
@@ -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
@@ -706,14 +712,23 @@ class InterfaceIDLTypeInfo(IDLTypeInfo):
def narrow_dart_type(self):
# TODO(podivilov): introduce ListLikeIDLTypeInfo and remove this hack.
if self._data.suppress_public_interface:
- return ImplementationClassName(self.idl_type())
+ return ImplementationClassNameForInterfaceName(self.idl_type())
# TODO(podivilov): only primitive and collection types should override
# dart_type.
if self._data.dart_type != None:
return self.dart_type()
if IsPureInterface(self.idl_type()):
return self.idl_type()
- return ImplementationClassName(self._dart_interface_name)
+ return self.implementation_name()
+
+ 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 ImplementationClassNameForInterfaceName(self.idl_type())
+ return ImplementationClassNameForInterfaceName(self._dart_interface_name)
class CallbackIDLTypeInfo(IDLTypeInfo):
@@ -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')
« no previous file with comments | « lib/html/dartium/html_dartium.dart ('k') | lib/html/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698