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

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

Issue 23819035: Give generatored bindings classes a field remembering an index into a cache of handles on the corre… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 7 years, 3 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 | tools/dom/templates/html/dartium/cpp_header.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/dartdomgenerator.py
diff --git a/tools/dom/scripts/dartdomgenerator.py b/tools/dom/scripts/dartdomgenerator.py
index 2ba67aae96c2ad0d01f020326e7a7bec9358f9d5..787af487d1cfbdf7da559e3c58cfdf36d4f576ed 100755
--- a/tools/dom/scripts/dartdomgenerator.py
+++ b/tools/dom/scripts/dartdomgenerator.py
@@ -138,6 +138,36 @@ def GenerateFromDatabase(common_database, dart2js_output_dir,
cpp_library_emitter.EmitResolver(
template_loader.Load('cpp_resolver.template'), dartium_output_dir)
+ path = os.path.join(cpp_output_dir, 'DartWebkitClassIds.h')
+ e = emitters.FileEmitter(path)
+ e.Emit("""
+// WARNING: Do not edit - generated code.
+// See dart/tools/dom/scripts/dartdomgenerator.py
+
+#ifndef DartWebkitClassIds_h
+#define DartWebkitClassIds_h
+
+namespace WebCore {
+
+enum {
+ _HistoryCrossFrameClassId = 0,
+ _LocationCrossFrameClassId,
+ _DOMWindowCrossFrameClassId,
+ _NPObjectClassId,
+ // New types that are not auto-generated should be added here.
+""")
+ for interface in webkit_database.GetInterfaces():
+ interface_name = interface.id
+ e.Emit(' %sClassId,\n' % interface_name)
+ e.Emit("""
+ NumWebkitClassIds
+};
+
+} // namespace WebCore
+
+#endif // DartWebkitClassIds_h
+""")
+
_logger.info('Flush...')
emitters.Flush()
« no previous file with comments | « no previous file | tools/dom/templates/html/dartium/cpp_header.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698