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

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

Issue 11874003: Adding supported checks and flags to window.performance. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback. Created 7 years, 11 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
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 re 10 import re
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 630
631 _all_but_ie9_annotations = [ 631 _all_but_ie9_annotations = [
632 "@SupportedBrowser(SupportedBrowser.CHROME)", 632 "@SupportedBrowser(SupportedBrowser.CHROME)",
633 "@SupportedBrowser(SupportedBrowser.FIREFOX)", 633 "@SupportedBrowser(SupportedBrowser.FIREFOX)",
634 "@SupportedBrowser(SupportedBrowser.IE, '10')", 634 "@SupportedBrowser(SupportedBrowser.IE, '10')",
635 "@SupportedBrowser(SupportedBrowser.SAFARI)", 635 "@SupportedBrowser(SupportedBrowser.SAFARI)",
636 ] 636 ]
637 637
638 _history_annotations = _all_but_ie9_annotations 638 _history_annotations = _all_but_ie9_annotations
639 639
640 _performance_annotations = [
641 "@SupportedBrowser(SupportedBrowser.CHROME)",
642 "@SupportedBrowser(SupportedBrowser.FIREFOX)",
643 "@SupportedBrowser(SupportedBrowser.IE)",
644 ]
645
640 # Annotations to be placed on generated members. 646 # Annotations to be placed on generated members.
641 # The table is indexed as: 647 # The table is indexed as:
642 # INTERFACE: annotations to be added to the interface declaration 648 # INTERFACE: annotations to be added to the interface declaration
643 # INTERFACE.MEMBER: annotation to be added to the member declaration 649 # INTERFACE.MEMBER: annotation to be added to the member declaration
644 dart_annotations = { 650 dart_annotations = {
645 'ArrayBuffer': _all_but_ie9_annotations, 651 'ArrayBuffer': _all_but_ie9_annotations,
646 'ArrayBufferView': _all_but_ie9_annotations, 652 'ArrayBufferView': _all_but_ie9_annotations,
647 'DOMWindow.indexedDB': _indexed_db_annotations, 653 'DOMWindow.indexedDB': _indexed_db_annotations,
654 'DOMWindow.performance': _performance_annotations,
648 'Element.webkitCreateShadowRoot': [ 655 'Element.webkitCreateShadowRoot': [
649 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", 656 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
650 "@Experimental()", 657 "@Experimental()",
651 ], 658 ],
652 'History.pushState': _history_annotations, 659 'History.pushState': _history_annotations,
653 'History.replaceState': _history_annotations, 660 'History.replaceState': _history_annotations,
654 'HTMLContentElement': [ 661 'HTMLContentElement': [
655 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", 662 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
656 "@Experimental()", 663 "@Experimental()",
657 ], 664 ],
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", 698 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
692 "@Experimental()", 699 "@Experimental()",
693 ], 700 ],
694 'HTMLTrackElement': [ 701 'HTMLTrackElement': [
695 "@SupportedBrowser(SupportedBrowser.CHROME)", 702 "@SupportedBrowser(SupportedBrowser.CHROME)",
696 "@SupportedBrowser(SupportedBrowser.IE, '10')", 703 "@SupportedBrowser(SupportedBrowser.IE, '10')",
697 "@SupportedBrowser(SupportedBrowser.SAFARI)", 704 "@SupportedBrowser(SupportedBrowser.SAFARI)",
698 ], 705 ],
699 'IDBFactory': _indexed_db_annotations, 706 'IDBFactory': _indexed_db_annotations,
700 'IDBDatabase': _indexed_db_annotations, 707 'IDBDatabase': _indexed_db_annotations,
708 'Performance': _performance_annotations,
701 'ShadowRoot': [ 709 'ShadowRoot': [
702 "@SupportedBrowser(SupportedBrowser.CHROME, '25')", 710 "@SupportedBrowser(SupportedBrowser.CHROME, '25')",
703 "@Experimental()", 711 "@Experimental()",
704 ], 712 ],
705 'WebSocket': _all_but_ie9_annotations, 713 'WebSocket': _all_but_ie9_annotations,
706 'WorkerContext.indexedDB': _indexed_db_annotations, 714 'WorkerContext.indexedDB': _indexed_db_annotations,
707 } 715 }
708 716
709 def FindCommonAnnotations(interface_name, member_name=None): 717 def FindCommonAnnotations(interface_name, member_name=None):
710 """ Finds annotations common between dart2js and dartium. 718 """ Finds annotations common between dart2js and dartium.
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 self) 1284 self)
1277 1285
1278 if type_data.clazz == 'SVGTearOff': 1286 if type_data.clazz == 'SVGTearOff':
1279 dart_interface_name = self._renamer.RenameInterface( 1287 dart_interface_name = self._renamer.RenameInterface(
1280 self._database.GetInterface(type_name)) 1288 self._database.GetInterface(type_name))
1281 return SVGTearOffIDLTypeInfo( 1289 return SVGTearOffIDLTypeInfo(
1282 type_name, type_data, dart_interface_name, self) 1290 type_name, type_data, dart_interface_name, self)
1283 1291
1284 class_name = '%sIDLTypeInfo' % type_data.clazz 1292 class_name = '%sIDLTypeInfo' % type_data.clazz
1285 return globals()[class_name](type_name, type_data) 1293 return globals()[class_name](type_name, type_data)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698