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

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

Issue 150783005: Fixes for 1750 roll (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes for 1750 Created 6 years, 10 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 | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | 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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 def bindings_class(self): 659 def bindings_class(self):
660 return 'Dart%s' % self.idl_type() 660 return 'Dart%s' % self.idl_type()
661 661
662 def vector_to_dart_template_parameter(self): 662 def vector_to_dart_template_parameter(self):
663 return self.native_type() 663 return self.native_type()
664 664
665 def to_native_info(self, idl_node, interface_name): 665 def to_native_info(self, idl_node, interface_name):
666 cls = self.bindings_class() 666 cls = self.bindings_class()
667 667
668 if 'Callback' in idl_node.ext_attrs: 668 if 'Callback' in idl_node.ext_attrs:
669 return '%s', 'RefPtr<%s>' % self.native_type(), cls, 'create' 669 return '%s.release()', 'OwnPtr<%s>' % self.native_type(), cls, 'create'
670 670
671 if self.custom_to_native(): 671 if self.custom_to_native():
672 type = 'RefPtr<%s>' % self.native_type() 672 type = 'RefPtr<%s>' % self.native_type()
673 argument_expression_template = '%s.get()' 673 argument_expression_template = '%s.get()'
674 else: 674 else:
675 type = '%s*' % self.native_type() 675 type = '%s*' % self.native_type()
676 if isinstance(self, SVGTearOffIDLTypeInfo) and not interface_name.endswith ('List'): 676 if isinstance(self, SVGTearOffIDLTypeInfo) and not interface_name.endswith ('List'):
677 argument_expression_template = '%s->propertyReference()' 677 argument_expression_template = '%s->propertyReference()'
678 else: 678 else:
679 argument_expression_template = '%s' 679 argument_expression_template = '%s'
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 if type_data.clazz == 'BasicTypedList': 1269 if type_data.clazz == 'BasicTypedList':
1270 if type_name == 'ArrayBuffer': 1270 if type_name == 'ArrayBuffer':
1271 dart_interface_name = 'ByteBuffer' 1271 dart_interface_name = 'ByteBuffer'
1272 else: 1272 else:
1273 dart_interface_name = self._renamer.RenameInterfaceId(type_name) 1273 dart_interface_name = self._renamer.RenameInterfaceId(type_name)
1274 return BasicTypedListIDLTypeInfo( 1274 return BasicTypedListIDLTypeInfo(
1275 type_name, type_data, dart_interface_name, self) 1275 type_name, type_data, dart_interface_name, self)
1276 1276
1277 class_name = '%sIDLTypeInfo' % type_data.clazz 1277 class_name = '%sIDLTypeInfo' % type_data.clazz
1278 return globals()[class_name](type_name, type_data) 1278 return globals()[class_name](type_name, type_data)
OLDNEW
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698