Chromium Code Reviews| 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', { |
|
rmacnak
2013/10/02 21:22:48
htmlrenamer._library_ids
siva
2013/10/02 23:28:27
Done.
|
| + '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_names: |
| + 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. """ |