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

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

Issue 10696035: Extract common logic for element factory constructors 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
« no previous file with comments | « no previous file | 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/systemhtml.py
diff --git a/lib/dom/scripts/systemhtml.py b/lib/dom/scripts/systemhtml.py
index fce54d1e981adbab855810c9c0417c7f6043502a..9761f0529a1b3080cfd890894ae00574c07b744d 100644
--- a/lib/dom/scripts/systemhtml.py
+++ b/lib/dom/scripts/systemhtml.py
@@ -887,6 +887,14 @@ class HtmlDartInterfaceGenerator(BaseGenerator):
PARAMS=constructor_info.ParametersInterfaceDeclaration(
self._shared.DartType));
+ if infos:
+ EmitHtmlElementFactoryConstructors(
+ self._system._backend._EmitterForFactoryProviderBody(
+ infos[0].factory_provider_name),
+ infos,
+ self._html_interface_name,
+ self._backend.ImplementationClassName())
+
element_type = MaybeTypedArrayElementTypeInHierarchy(
self._interface, self._system._database)
if element_type:
@@ -1035,6 +1043,9 @@ class HtmlFrogClassGenerator(FrogInterfaceGenerator):
return not (IsPureInterface(self._interface.id) or
self._interface.id in _merged_html_interfaces)
+ def ImplementationClassName(self):
+ return self._ImplClassName(self._html_interface_name)
+
def FilePathForDartImplementation(self):
return os.path.join(self._system._output_dir, 'html', 'frog',
'%s.dart' % self._html_interface_name)
@@ -1099,10 +1110,6 @@ class HtmlFrogClassGenerator(FrogInterfaceGenerator):
if constructor_info:
self._EmitFactoryProvider(constructor_info)
- infos = HtmlElementConstructorInfos(self._html_interface_name)
- if infos:
- self._EmitHtmlElementFactoryConstructors(infos)
-
emit_events, events = self._shared.GetEventAttributes(self._interface)
if not emit_events:
return
@@ -1133,13 +1140,6 @@ class HtmlFrogClassGenerator(FrogInterfaceGenerator):
NAMED_CONSTRUCTOR=constructor_info.name or self._html_interface_name,
ARGUMENTS=constructor_info.ParametersAsArgumentList())
- def _EmitHtmlElementFactoryConstructors(self, infos):
- EmitHtmlElementFactoryConstructors(
- self._system._EmitterForFactoryProviderBody(
- infos[0].factory_provider_name),
- infos,
- self._html_interface_name, self._class_name)
-
def AddIndexer(self, element_type):
"""Adds all the methods required to complete implementation of List."""
# We would like to simply inherit the implementation of everything except
« no previous file with comments | « no previous file | lib/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698