OLD | NEW |
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 the system to generate | 6 """This module provides shared functionality for the system to generate |
7 dart:html APIs from the IDL database.""" | 7 dart:html APIs from the IDL database.""" |
8 | 8 |
9 import emitter | 9 import emitter |
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ | 10 from generator import AnalyzeOperation, ConstantOutputOrder, \ |
(...skipping 19 matching lines...) Expand all Loading... |
30 'History': 'HistoryBase', | 30 'History': 'HistoryBase', |
31 } | 31 } |
32 | 32 |
33 _custom_factories = [ | 33 _custom_factories = [ |
34 'Notification', | 34 'Notification', |
35 'EventSource', | 35 'EventSource', |
36 ] | 36 ] |
37 | 37 |
38 class HtmlDartGenerator(object): | 38 class HtmlDartGenerator(object): |
39 def __init__(self, interface, options, dart_use_blink): | 39 def __init__(self, interface, options, dart_use_blink): |
40 # This goes away after the Chrome 35 roll (or whenever we commit to the | |
41 # dart:blink refactor) | |
42 self._dart_use_blink = dart_use_blink | 40 self._dart_use_blink = dart_use_blink |
43 self._database = options.database | 41 self._database = options.database |
44 self._interface = interface | 42 self._interface = interface |
45 self._type_registry = options.type_registry | 43 self._type_registry = options.type_registry |
46 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) | 44 self._interface_type_info = self._type_registry.TypeInfo(self._interface.id) |
47 self._renamer = options.renamer | 45 self._renamer = options.renamer |
48 self._metadata = options.metadata | 46 self._metadata = options.metadata |
49 self._library_name = self._renamer.GetLibraryName(self._interface) | 47 self._library_name = self._renamer.GetLibraryName(self._interface) |
50 | 48 |
51 def EmitSupportCheck(self): | 49 def EmitSupportCheck(self): |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 return self._type_registry.TypeInfo(type_name).narrow_dart_type() | 737 return self._type_registry.TypeInfo(type_name).narrow_dart_type() |
740 | 738 |
741 def _NarrowInputType(self, type_name): | 739 def _NarrowInputType(self, type_name): |
742 return self._NarrowToImplementationType(type_name) | 740 return self._NarrowToImplementationType(type_name) |
743 | 741 |
744 def _DartType(self, type_name): | 742 def _DartType(self, type_name): |
745 return self._type_registry.DartType(type_name) | 743 return self._type_registry.DartType(type_name) |
746 | 744 |
747 def _TypeInfo(self, type_name): | 745 def _TypeInfo(self, type_name): |
748 return self._type_registry.TypeInfo(type_name) | 746 return self._type_registry.TypeInfo(type_name) |
OLD | NEW |