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

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

Issue 10703194: Extract interfaces and members renaming logic to a new HtmlRenamer class. (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
« no previous file with comments | « no previous file | lib/dom/scripts/dartgenerator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/dartdomgenerator.py
diff --git a/lib/dom/scripts/dartdomgenerator.py b/lib/dom/scripts/dartdomgenerator.py
index 8d768c05cfea1276f9ccd8d4e5568f9ee21f93e6..72e8b7ca1cc22a059f676a4cd25e6c5a9a0d7b18 100755
--- a/lib/dom/scripts/dartdomgenerator.py
+++ b/lib/dom/scripts/dartdomgenerator.py
@@ -15,9 +15,10 @@ import shutil
import subprocess
import sys
from generator import TypeRegistry
+from htmlrenamer import HtmlRenamer
from systembase import GeneratorOptions
from systemfrog import FrogSystem
-from systemhtml import HtmlInterfacesSystem, HtmlFrogSystem, HtmlSystemShared
+from systemhtml import HtmlInterfacesSystem, HtmlFrogSystem
from systeminterface import InterfacesSystem
from systemnative import NativeImplementationSystem
from templateloader import TemplateLoader
@@ -62,11 +63,12 @@ def Generate(system_names, database_dir, use_database_cache, dom_output_dir,
generator.RenameTypes(webkit_database, _webkit_renames, True)
generator.FixEventTargets(webkit_database)
- def CreateGeneratorOptions(template_paths, conditions, type_registry,
- output_dir):
+ def CreateGeneratorOptions(template_paths, conditions, type_registry, output_dir,
+ renamer=None):
+ template_loader = TemplateLoader(template_dir, template_paths, conditions)
return GeneratorOptions(
- TemplateLoader(template_dir, template_paths, conditions),
- webkit_database, emitters, type_registry, output_dir)
+ template_loader, webkit_database, emitters, type_registry, renamer,
+ output_dir)
def Generate(system):
generator.Generate(webkit_database, system,
@@ -77,29 +79,27 @@ 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)
+ renamer = HtmlRenamer(webkit_database)
+ type_registry = TypeRegistry(webkit_database, renamer)
if system_name == 'htmlfrog':
options = CreateGeneratorOptions(
['html/frog', 'html/impl', 'html', ''],
{'DARTIUM': False, 'FROG': True},
- type_registry,
- html_output_dir)
+ type_registry, html_output_dir, renamer)
backend = HtmlFrogSystem(options)
else:
options = CreateGeneratorOptions(
['dom/native', 'html/dartium', 'html/impl', ''],
{'DARTIUM': True, 'FROG': False},
- type_registry,
- html_output_dir)
+ type_registry, html_output_dir, renamer)
backend = NativeImplementationSystem(options, auxiliary_dir)
options = CreateGeneratorOptions(
- ['html/interface', 'html/impl', 'html', ''], {}, type_registry,
- html_output_dir)
+ ['html/interface', 'html/impl', 'html', ''], {},
+ type_registry, html_output_dir, renamer)
html_system = HtmlInterfacesSystem(options, backend)
Generate(html_system)
else:
- type_registry = TypeRegistry({})
+ type_registry = TypeRegistry(webkit_database)
options = CreateGeneratorOptions(
['dom/interface', 'dom', ''], {}, type_registry, dom_output_dir)
interface_system = InterfacesSystem(options)
« no previous file with comments | « no previous file | lib/dom/scripts/dartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698