Index: lib/dom/scripts/dartdomgenerator.py |
diff --git a/lib/dom/scripts/dartdomgenerator.py b/lib/dom/scripts/dartdomgenerator.py |
index 7cb56de115feedc5deee892c8bf3630f2a9bba7e..ecfc13b63937ac6647428411c444b1453c054158 100755 |
--- a/lib/dom/scripts/dartdomgenerator.py |
+++ b/lib/dom/scripts/dartdomgenerator.py |
@@ -17,7 +17,7 @@ import sys |
from generator import TypeRegistry |
from systembase import GeneratorContext |
from systemfrog import FrogSystem |
-from systemhtml import HtmlInterfacesSystem, HtmlFrogSystem |
+from systemhtml import HtmlInterfacesSystem, HtmlFrogSystem, HtmlSystemShared |
from systeminterface import InterfacesSystem |
from systemnative import NativeImplementationSystem |
from templateloader import TemplateLoader |
@@ -62,10 +62,11 @@ def Generate(system_names, database_dir, use_database_cache, dom_output_dir, |
generator.RenameTypes(webkit_database, _webkit_renames, True) |
generator.FixEventTargets(webkit_database) |
- def CreateGeneratorContext(template_paths, conditions, output_dir): |
+ def CreateGeneratorContext(template_paths, conditions, type_registry, |
+ output_dir): |
return GeneratorContext( |
TemplateLoader(template_dir, template_paths, conditions), |
- webkit_database, emitters, TypeRegistry(), output_dir) |
+ webkit_database, emitters, type_registry, output_dir) |
def Generate(system): |
generator.Generate(webkit_database, system, |
@@ -76,34 +77,40 @@ def Generate(system_names, database_dir, use_database_cache, dom_output_dir, |
for system_name in system_names: |
if system_name in ['htmlfrog', 'htmldartium']: |
+ renames = HtmlSystemShared.MakeHtmlRenames(webkit_database) |
+ type_registry = TypeRegistry(renames) |
if system_name == 'htmlfrog': |
context = CreateGeneratorContext( |
['html/frog', 'html/impl', 'html', ''], |
{'DARTIUM': False, 'FROG': True}, |
+ type_registry, |
html_output_dir) |
backend = HtmlFrogSystem(context) |
else: |
context = CreateGeneratorContext( |
['dom/native', 'html/dartium', 'html/impl', ''], |
{'DARTIUM': True, 'FROG': False}, |
+ type_registry, |
html_output_dir) |
backend = NativeImplementationSystem(context, auxiliary_dir) |
context = CreateGeneratorContext( |
- ['html/interface', 'html/impl', 'html', ''], {}, html_output_dir) |
+ ['html/interface', 'html/impl', 'html', ''], {}, type_registry, |
+ html_output_dir) |
html_system = HtmlInterfacesSystem(context, backend) |
Generate(html_system) |
else: |
+ type_registry = TypeRegistry({}) |
context = CreateGeneratorContext( |
- ['dom/interface', 'dom', ''], {}, dom_output_dir) |
+ ['dom/interface', 'dom', ''], {}, type_registry, dom_output_dir) |
interface_system = InterfacesSystem(context) |
if system_name == 'dummy': |
context = CreateGeneratorContext( |
- ['dom/dummy', 'dom', ''], {}, dom_output_dir) |
+ ['dom/dummy', 'dom', ''], {}, type_registry, dom_output_dir) |
implementation_system = dartgenerator.DummyImplementationSystem( |
context) |
elif system_name == 'frog': |
context = CreateGeneratorContext( |
- ['dom/frog', 'dom', ''], {}, dom_output_dir) |
+ ['dom/frog', 'dom', ''], {}, type_registry, dom_output_dir) |
implementation_system = FrogSystem(context) |
else: |
raise Exception('Unsupported system_name %s' % system_name) |