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

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

Issue 10704008: Make HtmlFrogSystem and NativeImplementationSystem the backends for HtmlInterfacesSystem and remove… (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/systemhtml.py
diff --git a/lib/dom/scripts/systemhtml.py b/lib/dom/scripts/systemhtml.py
index fa461922368d735f8e51e5e008ac1230d96d51c3..0a800530e4830e62036ed9714c26c3781025356e 100644
--- a/lib/dom/scripts/systemhtml.py
+++ b/lib/dom/scripts/systemhtml.py
@@ -767,14 +767,18 @@ class HtmlSystem(System):
class HtmlInterfacesSystem(HtmlSystem):
- def __init__(self, templates, database, emitters, output_dir):
+ def __init__(self, templates, database, emitters, output_dir, backend):
super(HtmlInterfacesSystem, self).__init__(
templates, database, emitters, output_dir)
+ self._backend = backend
self._dart_interface_file_paths = []
self._factory_provider_emitters = {}
def ProcessInterface(self, interface):
"""."""
+
+ self._backend.ProcessInterface(interface)
+
if interface.id in _merged_html_interfaces:
return
@@ -803,8 +807,7 @@ class HtmlInterfacesSystem(HtmlSystem):
self._ProcessCallback(interface, info, file_path)
def GenerateLibraries(self):
- pass
-
+ self._backend.GenerateLibraries(self._dart_interface_file_paths)
def _FilePathForDartInterface(self, interface_name):
"""Returns the file path of the Dart interface definition."""
@@ -1366,13 +1369,11 @@ class HtmlFrogSystem(HtmlSystem):
dart_code, self._shared)
generator.Generate()
- def GenerateLibraries(self):
+ def GenerateLibraries(self, interface_files):
self._GenerateLibFile(
'html_frog.darttemplate',
os.path.join(self._output_dir, 'html_frog.dart'),
- (self._interface_system._dart_interface_file_paths +
- self._interface_system._dart_callback_file_paths +
- self._dart_frog_file_paths))
+ interface_files + self._dart_frog_file_paths)
def Finish(self):
pass
@@ -1392,43 +1393,6 @@ class HtmlFrogSystem(HtmlSystem):
# -----------------------------------------------------------------------------
-class HtmlDartiumSystem(HtmlSystem):
-
- def __init__(self, templates, database, emitters, auxiliary_dir,
- dom_implementation_classes, output_dir):
- """Prepared for generating wrapping implementation.
-
- - Creates emitter for Dart code.
- """
- super(HtmlDartiumSystem, self).__init__(
- templates, database, emitters, output_dir)
- self._auxiliary_dir = auxiliary_dir
- self._dom_implementation_classes = dom_implementation_classes
-
- def ProcessInterface(self, interface):
- # Implementation classes are generated by NativeImplementationSystem.
- # FIXME: merge HtmlDartiumSystem into NativeImplementationSystem.
- pass
-
- def ProcessCallback(self, interface, info):
- pass
-
- def GenerateLibraries(self):
- # Library generated for implementation.
- auxiliary_dir = os.path.relpath(self._auxiliary_dir, self._output_dir)
-
- self._GenerateLibFile(
- 'html_dartium.darttemplate',
- os.path.join(self._output_dir, 'html_dartium.dart'),
- (self._interface_system._dart_interface_file_paths +
- self._interface_system._dart_callback_file_paths +
- self._dom_implementation_classes),
- AUXILIARY_DIR=MassagePath(auxiliary_dir))
-
- def Finish(self):
- pass
-
-
def _ComputeInheritanceClosure(database):
def Collect(interface, seen, collected):
name = interface.id

Powered by Google App Engine
This is Rietveld 408576698