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

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

Issue 25626002: Generate a library ID instead of a library name, so that the ID can be used (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « tools/dom/scripts/dartdomgenerator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/htmlrenamer.py
===================================================================
--- tools/dom/scripts/htmlrenamer.py (revision 28179)
+++ tools/dom/scripts/htmlrenamer.py (working copy)
@@ -755,6 +755,13 @@
'Window': 'html',
})
+_library_ids = monitored.Dict('htmlrenamer._library_names', {
+ 'ANGLEInstancedArrays': 'WebGl',
+ 'Database': 'WebSql',
+ 'Navigator': 'Html',
+ 'Window': 'Html',
+})
+
class HtmlRenamer(object):
def __init__(self, database):
self._database = database
@@ -873,6 +880,36 @@
return 'html'
+ def GetLibraryId(self, interface):
+ # Some types have attributes merged in from many other interfaces.
+ if interface.id in _library_ids:
+ return _library_ids[interface.id]
+
+ # TODO(ager, blois): The conditional has been removed from indexed db,
+ # so we can no longer determine the library based on the conditionals.
+ if interface.id.startswith("IDB"):
+ return 'IndexedDb'
+ if interface.id.startswith("SQL"):
+ return 'WebSql'
+ if interface.id.startswith("SVG"):
+ return 'Svg'
+ if interface.id.startswith("WebGL") or interface.id.startswith("OES") \
+ or interface.id.startswith("EXT"):
+ return 'WebGl'
+
+ if 'Conditional' in interface.ext_attrs:
+ if 'WEB_AUDIO' in interface.ext_attrs['Conditional']:
+ return 'WebAudio'
+ if 'INDEXED_DATABASE' in interface.ext_attrs['Conditional']:
+ return 'IndexedDb'
+ if 'SQL_DATABASE' in interface.ext_attrs['Conditional']:
+ return 'WebSql'
+
+ if interface.id in typed_array_renames:
+ return 'TypedData'
+
+ return 'Html'
+
def DartifyTypeName(self, type_name):
"""Converts a DOM name to a Dart-friendly class name. """
« no previous file with comments | « tools/dom/scripts/dartdomgenerator.py ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698