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

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

Issue 10698108: Stop passing HtmlSystemShared around and move html renaming to IDLTypeInfo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 9f37a70656041a5582115a43b3444a8ef27998d0..cf824ff18adce325220fe4b98210583c987b4722 100644
--- a/lib/dom/scripts/systemfrog.py
+++ b/lib/dom/scripts/systemfrog.py
@@ -155,31 +155,28 @@ class FrogInterfaceGenerator(BaseGenerator):
def _ShouldNarrowToImplementationType(self, type_name):
# TODO(sra): Move into the 'system' and cache the result.
- if type_name == 'EventListener':
- # Callbacks are typedef functions so don't have a class.
+ do_not_narrow = ['DOMStringList', 'DOMStringMap', 'EventListener',
+ 'IDBAny', 'IDBKey', 'MediaQueryListListener']
+ if type_name in do_not_narrow:
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 False
- elif type_name == 'MediaQueryListListener':
- # Somewhat like a callback. See Issue 3338.
- return False
- else:
- return True
+ return True
return False
def _NarrowToImplementationType(self, type_name):
if self._ShouldNarrowToImplementationType(type_name):
- return self._ImplClassName(type_name)
- return type_name
+ return self._ImplClassName(DartType(type_name))
+ return DartType(type_name)
def _NarrowInputType(self, type_name):
- return self._NarrowToImplementationType(DartType(type_name))
+ return self._NarrowToImplementationType(type_name)
def _NarrowOutputType(self, type_name):
- return self._NarrowToImplementationType(DartType(type_name))
+ return self._NarrowToImplementationType(type_name)
def AddConstant(self, constant):
# Since we are currently generating native classes without interfaces,

Powered by Google App Engine
This is Rietveld 408576698