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

Unified Diff: client/dom/scripts/dartgenerator.py

Issue 9264057: Refresh dart:dom libraries from WebKit (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: CR changes Created 8 years, 11 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 | « client/dom/idl/dart/dart.idl ('k') | client/dom/scripts/fremontcutbuilder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/scripts/dartgenerator.py
diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py
index 0a8184d4cacfab2ba85606a4f436a565665394fd..c582fa27066de3c4668dd12bae82283fc5c25133 100755
--- a/client/dom/scripts/dartgenerator.py
+++ b/client/dom/scripts/dartgenerator.py
@@ -42,9 +42,10 @@ _idl_to_dart_type_conversions = {
'void': 'void',
'Array': 'List',
'sequence': 'List',
- # TODO(vsm): We need to support other types. We could weaken to
- # Object, or inject SSV into the appropriate types.
- 'SerializedScriptValue': 'String',
+ # TODO(sra): Come up with some meaningful name so that where this appears in
+ # the documentation, the user is made aware that only a limited subset of
+ # serializable types are actually permitted.
+ 'SerializedScriptValue': 'Dynamic',
# TODO(vsm): Automatically recognize types defined in src.
'TimeoutHandler': 'TimeoutHandler',
'RequestAnimationFrameCallback': 'RequestAnimationFrameCallback',
@@ -95,6 +96,7 @@ _interface_factories = {
'Uint8Array': '_TypedArrayFactoryProvider',
'Uint16Array': '_TypedArrayFactoryProvider',
'Uint32Array': '_TypedArrayFactoryProvider',
+ 'Uint8ClampedArray': '_TypedArrayFactoryProvider',
}
#
@@ -750,6 +752,8 @@ def MaybeTypedArrayElementType(interface):
for parent in interface.parents:
if parent.type.id == 'ArrayBufferView':
return MaybeListElementType(interface)
+ if parent.type.id == 'Uint8Array':
+ return 'int'
return None
@@ -2010,13 +2014,13 @@ class FrogInterfaceGenerator(object):
def AddTypedArrayConstructors(self, element_type):
self._members_emitter.Emit(
'\n'
- ' factory $CTOR(int length) => _construct(length);\n'
+ ' factory $CTOR(int length) => _construct_$CTOR(length);\n'
'\n'
- ' factory $CTOR.fromList(List<$TYPE> list) => _construct(list);\n'
+ ' factory $CTOR.fromList(List<$TYPE> list) => _construct_$CTOR(list);\n'
'\n'
- ' factory $CTOR.fromBuffer(ArrayBuffer buffer) => _construct(buffer);\n'
+ ' factory $CTOR.fromBuffer(ArrayBuffer buffer) => _construct_$CTOR(buffer);\n'
'\n'
- ' static _construct(arg) native \'return new $CTOR(arg);\';\n',
+ ' static _construct_$CTOR(arg) native \'return new $CTOR(arg);\';\n',
CTOR=self._interface.id,
TYPE=element_type)
« no previous file with comments | « client/dom/idl/dart/dart.idl ('k') | client/dom/scripts/fremontcutbuilder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698