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 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 re | 10 import re |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 ] | 685 ] |
686 | 686 |
687 _history_annotations = _all_but_ie9_annotations | 687 _history_annotations = _all_but_ie9_annotations |
688 | 688 |
689 _performance_annotations = [ | 689 _performance_annotations = [ |
690 "@SupportedBrowser(SupportedBrowser.CHROME)", | 690 "@SupportedBrowser(SupportedBrowser.CHROME)", |
691 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 691 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
692 "@SupportedBrowser(SupportedBrowser.IE)", | 692 "@SupportedBrowser(SupportedBrowser.IE)", |
693 ] | 693 ] |
694 | 694 |
| 695 _speech_recognition_annotations = [ |
| 696 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
| 697 "@Experimental()", |
| 698 ] |
| 699 |
695 # Annotations to be placed on generated members. | 700 # Annotations to be placed on generated members. |
696 # The table is indexed as: | 701 # The table is indexed as: |
697 # INTERFACE: annotations to be added to the interface declaration | 702 # INTERFACE: annotations to be added to the interface declaration |
698 # INTERFACE.MEMBER: annotation to be added to the member declaration | 703 # INTERFACE.MEMBER: annotation to be added to the member declaration |
699 dart_annotations = { | 704 dart_annotations = { |
700 'ArrayBuffer': _all_but_ie9_annotations, | 705 'ArrayBuffer': _all_but_ie9_annotations, |
701 'ArrayBufferView': _all_but_ie9_annotations, | 706 'ArrayBufferView': _all_but_ie9_annotations, |
702 'DOMApplicationCache': [ | 707 'DOMApplicationCache': [ |
703 "@SupportedBrowser(SupportedBrowser.CHROME)", | 708 "@SupportedBrowser(SupportedBrowser.CHROME)", |
704 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 709 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 "@SupportedBrowser(SupportedBrowser.FIREFOX)", | 768 "@SupportedBrowser(SupportedBrowser.FIREFOX)", |
764 "@SupportedBrowser(SupportedBrowser.SAFARI)", | 769 "@SupportedBrowser(SupportedBrowser.SAFARI)", |
765 "@Experimental()", | 770 "@Experimental()", |
766 ], | 771 ], |
767 'NotificationCenter': _webkit_experimental_annotations, | 772 'NotificationCenter': _webkit_experimental_annotations, |
768 'Performance': _performance_annotations, | 773 'Performance': _performance_annotations, |
769 'ShadowRoot': [ | 774 'ShadowRoot': [ |
770 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", | 775 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", |
771 "@Experimental()", | 776 "@Experimental()", |
772 ], | 777 ], |
| 778 'SpeechRecognition': _speech_recognition_annotations, |
| 779 'SpeechRecognitionAlternative': _speech_recognition_annotations, |
| 780 'SpeechRecognitionError': _speech_recognition_annotations, |
| 781 'SpeechRecognitionEvent': _speech_recognition_annotations, |
| 782 'SpeechRecognitionResult': _speech_recognition_annotations, |
773 'WebSocket': _all_but_ie9_annotations, | 783 'WebSocket': _all_but_ie9_annotations, |
774 'WorkerContext.indexedDB': _indexed_db_annotations, | 784 'WorkerContext.indexedDB': _indexed_db_annotations, |
775 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, | 785 'WorkerContext.webkitRequestFileSystem': _file_system_annotations, |
776 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, | 786 'WorkerContext.webkitRequestFileSystemSync': _file_system_annotations, |
777 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, | 787 'WorkerContext.webkitResolveLocalFileSystemSyncURL': _file_system_annotations, |
778 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, | 788 'WorkerContext.webkitResolveLocalFileSystemURL': _file_system_annotations, |
779 } | 789 } |
780 | 790 |
781 def FindCommonAnnotations(interface_name, member_name=None): | 791 def FindCommonAnnotations(interface_name, member_name=None): |
782 """ Finds annotations common between dart2js and dartium. | 792 """ Finds annotations common between dart2js and dartium. |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 self) | 1378 self) |
1369 | 1379 |
1370 if type_data.clazz == 'SVGTearOff': | 1380 if type_data.clazz == 'SVGTearOff': |
1371 dart_interface_name = self._renamer.RenameInterface( | 1381 dart_interface_name = self._renamer.RenameInterface( |
1372 self._database.GetInterface(type_name)) | 1382 self._database.GetInterface(type_name)) |
1373 return SVGTearOffIDLTypeInfo( | 1383 return SVGTearOffIDLTypeInfo( |
1374 type_name, type_data, dart_interface_name, self) | 1384 type_name, type_data, dart_interface_name, self) |
1375 | 1385 |
1376 class_name = '%sIDLTypeInfo' % type_data.clazz | 1386 class_name = '%sIDLTypeInfo' % type_data.clazz |
1377 return globals()[class_name](type_name, type_data) | 1387 return globals()[class_name](type_name, type_data) |
OLD | NEW |