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

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

Issue 16308002: Fixes for Blink roll to r151189 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, 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 import database 6 import database
7 import databasebuilder 7 import databasebuilder
8 import idlparser 8 import idlparser
9 import logging.config 9 import logging.config
10 import os.path 10 import os.path
11 import sys 11 import sys
12 12
13 _logger = logging.getLogger('fremontcutbuilder') 13 _logger = logging.getLogger('fremontcutbuilder')
14 14
15 # See: 15 # See:
16 # http://src.chromium.org/viewvc/multivm/trunk/webkit/Source/core/features.gypi 16 # http://src.chromium.org/viewvc/multivm/trunk/webkit/Source/core/features.gypi
17 # for ENABLE_* flags defined in Chromium / Blink. 17 # for ENABLE_* flags defined in Chromium / Blink.
18 # We list all ENABLE flags used in IDL in one of these two lists. 18 # We list all ENABLE flags used in IDL in one of these two lists.
19 FEATURE_DISABLED = [ 19 FEATURE_DISABLED = [
20 'ENABLE_BATTERY_STATUS', 20 'ENABLE_BATTERY_STATUS',
21 'ENABLE_CSS_DEVICE_ADAPTATION', 21 'ENABLE_CSS_DEVICE_ADAPTATION',
22 'ENABLE_CUSTOM_SCHEME_HANDLER', 22 'ENABLE_CUSTOM_SCHEME_HANDLER',
23 'ENABLE_ENCRYPTED_MEDIA_V2',
24 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. 23 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android.
25 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android. 24 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android.
26 'ENABLE_WEBVTT_REGIONS', 25 'ENABLE_WEBVTT_REGIONS',
27 'ENABLE_XHR_TIMEOUT', 26 'ENABLE_XHR_TIMEOUT',
28 ] 27 ]
29 28
30 FEATURE_DEFINES = [ 29 FEATURE_DEFINES = [
31 'ENABLE_CALENDAR_PICKER', # Not on Android 30 'ENABLE_CALENDAR_PICKER', # Not on Android
32 'ENABLE_DATALIST_ELEMENT', # Not on Android 31 'ENABLE_ENCRYPTED_MEDIA_V2',
Anton Muhin 2013/06/03 09:02:19 why it moved here? Do we have those defines somew
vsm 2013/06/03 14:59:50 Yes, this one is still in the IDL. On 2013/06/03
33 'ENABLE_ENCRYPTED_MEDIA',
34 'ENABLE_INPUT_SPEECH', # Not on Android 32 'ENABLE_INPUT_SPEECH', # Not on Android
35 'ENABLE_LEGACY_NOTIFICATIONS', # Not on Android 33 'ENABLE_LEGACY_NOTIFICATIONS', # Not on Android
36 'ENABLE_NAVIGATOR_CONTENT_UTILS', # Not on Android 34 'ENABLE_NAVIGATOR_CONTENT_UTILS', # Not on Android
37 'ENABLE_NOTIFICATIONS', # Not on Android 35 'ENABLE_NOTIFICATIONS', # Not on Android
38 'ENABLE_PAGE_POPUP', # Not on Android
39 'ENABLE_SVG', 36 'ENABLE_SVG',
40 'ENABLE_SVG_FONTS', 37 'ENABLE_SVG_FONTS',
41 'ENABLE_WEB_AUDIO', # Not on Android 38 'ENABLE_WEB_AUDIO', # Not on Android
42 'ENABLE_WEBGL', 39 'ENABLE_WEBGL',
43 ] 40 ]
44 41
45 def build_database(idl_files, database_dir, feature_defines=None, parallel=False ): 42 def build_database(idl_files, database_dir, feature_defines=None, parallel=False ):
46 """This code reconstructs the FremontCut IDL database from W3C, 43 """This code reconstructs the FremontCut IDL database from W3C,
47 WebKit and Dart IDL files.""" 44 WebKit and Dart IDL files."""
48 current_dir = os.path.dirname(__file__) 45 current_dir = os.path.dirname(__file__)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 95
99 conditionals_met = set( 96 conditionals_met = set(
100 'ENABLE_' + conditional for conditional in builder.conditionals_met) 97 'ENABLE_' + conditional for conditional in builder.conditionals_met)
101 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED) 98 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED)
102 99
103 unused_conditionals = known_conditionals - conditionals_met 100 unused_conditionals = known_conditionals - conditionals_met
104 if unused_conditionals: 101 if unused_conditionals:
105 _logger.warning('There are some unused conditionals %s' % 102 _logger.warning('There are some unused conditionals %s' %
106 sorted(unused_conditionals)) 103 sorted(unused_conditionals))
107 _logger.warning('Please update fremontcutbuilder.py') 104 _logger.warning('Please update fremontcutbuilder.py')
105 raise 'Halt'
108 106
109 unknown_conditionals = conditionals_met - known_conditionals 107 unknown_conditionals = conditionals_met - known_conditionals
110 if unknown_conditionals: 108 if unknown_conditionals:
111 _logger.warning('There are some unknown conditionals %s' % 109 _logger.warning('There are some unknown conditionals %s' %
112 sorted(unknown_conditionals)) 110 sorted(unknown_conditionals))
113 _logger.warning('Please update fremontcutbuilder.py') 111 _logger.warning('Please update fremontcutbuilder.py')
112 raise 'Halt'
Anton Muhin 2013/06/03 09:02:19 oversight or by intent?
vsm 2013/06/03 14:59:50 Sorry, temporary add to verify that there where no
114 113
115 db.Save() 114 db.Save()
116 return db 115 return db
117 116
118 def main(parallel=False): 117 def main(parallel=False):
119 current_dir = os.path.dirname(__file__) 118 current_dir = os.path.dirname(__file__)
120 119
121 idl_files = [] 120 idl_files = []
122 121
123 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party', 122 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party',
(...skipping 17 matching lines...) Expand all
141 if ext == '.idl': 140 if ext == '.idl':
142 idl_files.append(file_name) 141 idl_files.append(file_name)
143 142
144 os.path.walk(webcore_dir, visitor, webcore_dir) 143 os.path.walk(webcore_dir, visitor, webcore_dir)
145 144
146 database_dir = os.path.join(current_dir, '..', 'database') 145 database_dir = os.path.join(current_dir, '..', 'database')
147 return build_database(idl_files, database_dir, parallel=parallel) 146 return build_database(idl_files, database_dir, parallel=parallel)
148 147
149 if __name__ == '__main__': 148 if __name__ == '__main__':
150 sys.exit(main()) 149 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698