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

Unified Diff: sdk/lib/html/scripts/htmlrenamer.py

Issue 11434079: Adding dart:indexed_db. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks. Created 8 years 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
Index: sdk/lib/html/scripts/htmlrenamer.py
diff --git a/sdk/lib/html/scripts/htmlrenamer.py b/sdk/lib/html/scripts/htmlrenamer.py
index 9c43084c8a516ff39cbfbb2a5deb6e99eb3b9fb6..9f71ee74d5829bb20ed4881c6339df7b5c738cf3 100644
--- a/sdk/lib/html/scripts/htmlrenamer.py
+++ b/sdk/lib/html/scripts/htmlrenamer.py
@@ -11,6 +11,7 @@ html_interface_renames = {
'DOMWindow': 'LocalWindow',
'History': 'LocalHistory',
'HTMLDocument' : 'HtmlDocument',
+ 'IDBFactory': 'IdbFactory', # Manual to avoid name conflicts.
'Location': 'LocalLocation',
'SVGDocument': 'SvgDocument', # Manual to avoid name conflicts.
'SVGElement': 'SvgElement', # Manual to avoid name conflicts.
@@ -305,8 +306,10 @@ _removed_html_members = set([
"LocalWindow.get:length",
"LocalWindow.focus",
"LocalWindow.prompt",
+ "LocalWindow.webkitIndexedDB",
"LocalWindow.webkitCancelRequestAnimationFrame",
"WheelEvent.wheelDelta",
+ "WorkerContext.webkitIndexedDB",
])
class HtmlRenamer(object):
@@ -367,6 +370,10 @@ class HtmlRenamer(object):
"""
if idl_type_name.startswith('SVG'):
return 'svg'
+
+ if idl_type_name.startswith('IDB'):
+ return 'indexed_db'
+
if 'Audio' in idl_type_name:
return 'web_audio'
@@ -382,12 +389,15 @@ class HtmlRenamer(object):
def DartifyTypeName(self, type_name):
"""Converts a DOM name to a Dart-friendly class name. """
library_name = self._GetLibraryName(type_name)
- # Only renaming SVG for now.
- if library_name != 'svg':
+ # Rename everything except html.
+ if library_name == 'html':
return type_name
- # Strip off the SVG prefix.
+ # Strip off any SVG prefix.
name = re.sub(r'^SVG', '', type_name)
+ # Strip off any IDB prefix.
+ name = re.sub(r'^IDB', '', name)
+
return self._CamelCaseName(name)
def _DartifyMemberName(self, member_name):

Powered by Google App Engine
This is Rietveld 408576698