Chromium Code Reviews| Index: client/dom/scripts/dartgenerator.py |
| diff --git a/client/dom/scripts/dartgenerator.py b/client/dom/scripts/dartgenerator.py |
| index 0a8184d4cacfab2ba85606a4f436a565665394fd..cfb04a53dcf831834b3f268629b065b5d13403f5 100755 |
| --- a/client/dom/scripts/dartgenerator.py |
| +++ b/client/dom/scripts/dartgenerator.py |
| @@ -44,7 +44,7 @@ _idl_to_dart_type_conversions = { |
| 'sequence': 'List', |
| # TODO(vsm): We need to support other types. We could weaken to |
| # Object, or inject SSV into the appropriate types. |
| - 'SerializedScriptValue': 'String', |
| + 'SerializedScriptValue': 'Dynamic/*SerializedScriptValue*/', |
|
vsm
2012/01/31 02:41:40
Not sure it's useful to put this in the comment if
|
| # TODO(vsm): Automatically recognize types defined in src. |
| 'TimeoutHandler': 'TimeoutHandler', |
| 'RequestAnimationFrameCallback': 'RequestAnimationFrameCallback', |
| @@ -95,6 +95,7 @@ _interface_factories = { |
| 'Uint8Array': '_TypedArrayFactoryProvider', |
| 'Uint16Array': '_TypedArrayFactoryProvider', |
| 'Uint32Array': '_TypedArrayFactoryProvider', |
| + 'Uint8ClampedArray': '_TypedArrayFactoryProvider', |
| } |
| # |
| @@ -750,6 +751,9 @@ def MaybeTypedArrayElementType(interface): |
| for parent in interface.parents: |
| if parent.type.id == 'ArrayBufferView': |
| return MaybeListElementType(interface) |
| + if parent.type.id == 'Uint8Array': |
| + return 'int' |
| + #return MaybeListElementType(interface) |
|
vsm
2012/01/31 02:41:40
Delete comment.
|
| 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) |