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

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

Issue 10542036: Use original WebKit IDL database for dart:html generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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/dom/scripts/systemfrog.py
diff --git a/lib/dom/scripts/systemfrog.py b/lib/dom/scripts/systemfrog.py
index 04ff7779c67c03342b12b7171ac49cb31989713f..83a7935b19d0b2fa3aee46caa0126a1c2111b997 100644
--- a/lib/dom/scripts/systemfrog.py
+++ b/lib/dom/scripts/systemfrog.py
@@ -162,21 +162,26 @@ class FrogInterfaceGenerator(BaseGenerator):
NAMEDCONSTRUCTOR=constructor_info.name or interface_name,
ARGUMENTS=constructor_info.ParametersAsArgumentList())
- def _NarrowToImplementationType(self, type_name):
+ def _ShouldNarrowToImplementationType(self, type_name):
Anton Muhin 2012/06/07 11:43:47 maybe pass a renamer here instead of doing if and
podivilov 2012/06/08 18:03:25 It might be a good idea, but there too many call s
# TODO(sra): Move into the 'system' and cache the result.
if type_name == 'EventListener':
# Callbacks are typedef functions so don't have a class.
- return type_name
+ return False
if self._system._database.HasInterface(type_name):
interface = self._system._database.GetInterface(type_name)
if RecognizeCallback(interface):
# Callbacks are typedef functions so don't have a class.
- return type_name
+ return False
elif type_name == 'MediaQueryListListener':
# Somewhat like a callback. See Issue 3338.
- return type_name
+ return False
else:
- return self._ImplClassName(type_name)
+ return True
+ return False
+
+ def _NarrowToImplementationType(self, type_name):
+ if self._ShouldNarrowToImplementationType(type_name):
+ return self._ImplClassName(type_name)
return type_name
def _NarrowInputType(self, type_name):

Powered by Google App Engine
This is Rietveld 408576698