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

Side by Side Diff: tools/dom/scripts/generator.py

Issue 14985010: Map lists back to typed arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/web_gl/dartium/web_gl_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for systems to generate 6 """This module provides shared functionality for systems to generate
7 Dart APIs from the IDL database.""" 7 Dart APIs from the IDL database."""
8 8
9 import copy 9 import copy
10 import json 10 import json
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 self.custom_to_dart = custom_to_dart 892 self.custom_to_dart = custom_to_dart
893 self.custom_to_native = custom_to_native 893 self.custom_to_native = custom_to_native
894 self.conversion_includes = conversion_includes 894 self.conversion_includes = conversion_includes
895 self.webcore_getter_name = webcore_getter_name 895 self.webcore_getter_name = webcore_getter_name
896 self.webcore_setter_name = webcore_setter_name 896 self.webcore_setter_name = webcore_setter_name
897 self.item_type = item_type 897 self.item_type = item_type
898 self.suppress_interface = suppress_interface 898 self.suppress_interface = suppress_interface
899 899
900 900
901 def TypedListTypeData(item_type): 901 def TypedListTypeData(item_type):
902 return TypeData( 902 return TypeData(clazz='TypedList', item_type=item_type)
903 clazz='TypedList',
904 dart_type='List<%s>' % item_type, # TODO(antonm): proper typed_data interf aces.
905 item_type=item_type)
906 903
907 904
908 _idl_type_registry = monitored.Dict('generator._idl_type_registry', { 905 _idl_type_registry = monitored.Dict('generator._idl_type_registry', {
909 'boolean': TypeData(clazz='Primitive', dart_type='bool', native_type='bool', 906 'boolean': TypeData(clazz='Primitive', dart_type='bool', native_type='bool',
910 webcore_getter_name='hasAttribute', 907 webcore_getter_name='hasAttribute',
911 webcore_setter_name='setBooleanAttribute'), 908 webcore_setter_name='setBooleanAttribute'),
912 'short': TypeData(clazz='Primitive', dart_type='int', native_type='int'), 909 'short': TypeData(clazz='Primitive', dart_type='int', native_type='int'),
913 'unsigned short': TypeData(clazz='Primitive', dart_type='int', 910 'unsigned short': TypeData(clazz='Primitive', dart_type='int',
914 native_type='int'), 911 native_type='int'),
915 'int': TypeData(clazz='Primitive', dart_type='int'), 912 'int': TypeData(clazz='Primitive', dart_type='int'),
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 type_name, type_data, dart_interface_name, self) 1103 type_name, type_data, dart_interface_name, self)
1107 1104
1108 if type_data.clazz == 'BasicTypedList': 1105 if type_data.clazz == 'BasicTypedList':
1109 dart_interface_name = self._renamer.RenameInterface( 1106 dart_interface_name = self._renamer.RenameInterface(
1110 self._database.GetInterface(type_name)) 1107 self._database.GetInterface(type_name))
1111 return BasicTypedListIDLTypeInfo( 1108 return BasicTypedListIDLTypeInfo(
1112 type_name, type_data, dart_interface_name, self) 1109 type_name, type_data, dart_interface_name, self)
1113 1110
1114 class_name = '%sIDLTypeInfo' % type_data.clazz 1111 class_name = '%sIDLTypeInfo' % type_data.clazz
1115 return globals()[class_name](type_name, type_data) 1112 return globals()[class_name](type_name, type_data)
OLDNEW
« no previous file with comments | « sdk/lib/web_gl/dartium/web_gl_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698