| OLD | NEW |
| 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 FEATURE_DISABLED = [ | 13 FEATURE_DISABLED = [ |
| 14 'ENABLE_BATTERY_STATUS', | 14 'ENABLE_BATTERY_STATUS', |
| 15 'ENABLE_CSS3_CONDITIONAL_RULES', | 15 'ENABLE_CSS3_CONDITIONAL_RULES', |
| 16 'ENABLE_CSS_DEVICE_ADAPTATION', | 16 'ENABLE_CSS_DEVICE_ADAPTATION', |
| 17 'ENABLE_CUSTOM_SCHEME_HANDLER', | 17 'ENABLE_CUSTOM_SCHEME_HANDLER', |
| 18 'ENABLE_ENCRYPTED_MEDIA_V2', | 18 'ENABLE_ENCRYPTED_MEDIA_V2', |
| 19 'ENABLE_INSPECTOR', # Internal DevTools API. | |
| 20 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. | 19 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. |
| 21 'ENABLE_MICRODATA', | 20 'ENABLE_MICRODATA', |
| 22 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android. | 21 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android. |
| 23 'ENABLE_PROXIMITY_EVENTS', | 22 'ENABLE_PROXIMITY_EVENTS', |
| 24 'ENABLE_SPEECH_SYNTHESIS', | 23 'ENABLE_SPEECH_SYNTHESIS', |
| 25 'ENABLE_WEBVTT_REGIONS', | 24 'ENABLE_WEBVTT_REGIONS', |
| 26 'ENABLE_XHR_TIMEOUT', | 25 'ENABLE_XHR_TIMEOUT', |
| 27 ] | 26 ] |
| 28 | 27 |
| 29 FEATURE_DEFINES = [ | 28 FEATURE_DEFINES = [ |
| 30 'ENABLE_BLOB', | 29 'ENABLE_BLOB', |
| 31 'ENABLE_CALENDAR_PICKER', | 30 'ENABLE_CALENDAR_PICKER', |
| 32 'ENABLE_CANVAS_PATH', | |
| 33 'ENABLE_CANVAS_PROXY', | 31 'ENABLE_CANVAS_PROXY', |
| 34 'ENABLE_CSS_FILTERS', | 32 'ENABLE_CSS_FILTERS', |
| 35 'ENABLE_CSS_REGIONS', | 33 'ENABLE_CSS_REGIONS', |
| 36 'ENABLE_CSS_SHADERS', | |
| 37 'ENABLE_CUSTOM_ELEMENTS', | 34 'ENABLE_CUSTOM_ELEMENTS', |
| 38 'ENABLE_DATALIST_ELEMENT', | 35 'ENABLE_DATALIST_ELEMENT', |
| 39 'ENABLE_DETAILS_ELEMENT', | 36 'ENABLE_DETAILS_ELEMENT', |
| 40 'ENABLE_DEVICE_ORIENTATION', | |
| 41 'ENABLE_DIALOG_ELEMENT', | 37 'ENABLE_DIALOG_ELEMENT', |
| 42 'ENABLE_DIRECTORY_UPLOAD', | 38 'ENABLE_DIRECTORY_UPLOAD', |
| 43 'ENABLE_DOWNLOAD_ATTRIBUTE', | |
| 44 'ENABLE_ENCRYPTED_MEDIA', | 39 'ENABLE_ENCRYPTED_MEDIA', |
| 45 'ENABLE_FILE_SYSTEM', | |
| 46 'ENABLE_FILTERS', | |
| 47 'ENABLE_FONT_LOAD_EVENTS', | 40 'ENABLE_FONT_LOAD_EVENTS', |
| 48 'ENABLE_GAMEPAD', | 41 'ENABLE_GAMEPAD', |
| 49 'ENABLE_GEOLOCATION', | |
| 50 'ENABLE_INPUT_SPEECH', | 42 'ENABLE_INPUT_SPEECH', |
| 51 'ENABLE_JAVASCRIPT_DEBUGGER', | |
| 52 'ENABLE_LEGACY_NOTIFICATIONS', | 43 'ENABLE_LEGACY_NOTIFICATIONS', |
| 53 'ENABLE_MEDIA_STATISTICS', | |
| 54 'ENABLE_MEDIA_STREAM', | 44 'ENABLE_MEDIA_STREAM', |
| 55 'ENABLE_METER_ELEMENT', | |
| 56 'ENABLE_NAVIGATOR_CONTENT_UTILS', | 45 'ENABLE_NAVIGATOR_CONTENT_UTILS', |
| 57 'ENABLE_NOTIFICATIONS', | 46 'ENABLE_NOTIFICATIONS', |
| 58 'ENABLE_PAGE_POPUP', | 47 'ENABLE_PAGE_POPUP', |
| 59 'ENABLE_PERFORMANCE_TIMELINE', | |
| 60 'ENABLE_POINTER_LOCK', | |
| 61 'ENABLE_PROGRESS_ELEMENT', | |
| 62 'ENABLE_QUOTA', | |
| 63 'ENABLE_REQUEST_ANIMATION_FRAME', | |
| 64 'ENABLE_REQUEST_AUTOCOMPLETE', | |
| 65 'ENABLE_RESOURCE_TIMING', | |
| 66 'ENABLE_SCRIPTED_SPEECH', | 48 'ENABLE_SCRIPTED_SPEECH', |
| 67 'ENABLE_SHADOW_DOM', | |
| 68 'ENABLE_SHARED_WORKERS', | 49 'ENABLE_SHARED_WORKERS', |
| 69 'ENABLE_SQL_DATABASE', | |
| 70 'ENABLE_STYLE_SCOPED', | |
| 71 'ENABLE_SVG', | 50 'ENABLE_SVG', |
| 72 'ENABLE_SVG_FONTS', | 51 'ENABLE_SVG_FONTS', |
| 73 'ENABLE_TOUCH_EVENTS', | 52 'ENABLE_TOUCH_EVENTS', |
| 74 'ENABLE_USER_TIMING', | |
| 75 'ENABLE_VIDEO', | 53 'ENABLE_VIDEO', |
| 76 'ENABLE_VIDEO_TRACK', | 54 'ENABLE_VIDEO_TRACK', |
| 77 'ENABLE_WEB_AUDIO', | 55 'ENABLE_WEB_AUDIO', |
| 78 'ENABLE_WEBGL', | 56 'ENABLE_WEBGL', |
| 79 'ENABLE_WEB_SOCKETS', | |
| 80 'ENABLE_WEB_TIMING', | |
| 81 'ENABLE_WORKERS', | |
| 82 'ENABLE_XSLT', | 57 'ENABLE_XSLT', |
| 83 ] | 58 ] |
| 84 | 59 |
| 85 def build_database(idl_files, database_dir, parallel=False): | 60 def build_database(idl_files, database_dir, parallel=False): |
| 86 """This code reconstructs the FremontCut IDL database from W3C, | 61 """This code reconstructs the FremontCut IDL database from W3C, |
| 87 WebKit and Dart IDL files.""" | 62 WebKit and Dart IDL files.""" |
| 88 current_dir = os.path.dirname(__file__) | 63 current_dir = os.path.dirname(__file__) |
| 89 logging.config.fileConfig(os.path.join(current_dir, "logging.conf")) | 64 logging.config.fileConfig(os.path.join(current_dir, "logging.conf")) |
| 90 | 65 |
| 91 db = database.Database(database_dir) | 66 db = database.Database(database_dir) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if unknown_conditionals: | 121 if unknown_conditionals: |
| 147 raise Exception('There are some unknown conditionals %s' % | 122 raise Exception('There are some unknown conditionals %s' % |
| 148 sorted(unknown_conditionals)) | 123 sorted(unknown_conditionals)) |
| 149 | 124 |
| 150 db.Save() | 125 db.Save() |
| 151 return db | 126 return db |
| 152 | 127 |
| 153 def main(parallel=False): | 128 def main(parallel=False): |
| 154 current_dir = os.path.dirname(__file__) | 129 current_dir = os.path.dirname(__file__) |
| 155 | 130 |
| 156 ignored_idls = [ | |
| 157 'AbstractView.idl', | |
| 158 ] | |
| 159 | |
| 160 idl_files = [] | 131 idl_files = [] |
| 161 | 132 |
| 162 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party', | 133 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party', |
| 163 'WebCore') | 134 'WebCore') |
| 164 if not os.path.exists(webcore_dir): | 135 if not os.path.exists(webcore_dir): |
| 165 raise RuntimeError('directory not found: %s' % webcore_dir) | 136 raise RuntimeError('directory not found: %s' % webcore_dir) |
| 166 | 137 |
| 167 DIRS_TO_IGNORE = [ | 138 DIRS_TO_IGNORE = [ |
| 168 'bindings', # Various test IDLs | 139 'bindings', # Various test IDLs |
| 169 'testing', # IDLs to expose testing APIs | 140 'testing', # IDLs to expose testing APIs |
| 170 'networkinfo', # Not yet used in Blink yet | 141 'networkinfo', # Not yet used in Blink yet |
| 171 'vibration', # Not yet used in Blink yet | 142 'vibration', # Not yet used in Blink yet |
| 172 ] | 143 ] |
| 173 | 144 |
| 174 def visitor(arg, dir_name, names): | 145 def visitor(arg, dir_name, names): |
| 175 if os.path.basename(dir_name) in DIRS_TO_IGNORE: | 146 if os.path.basename(dir_name) in DIRS_TO_IGNORE: |
| 176 names[:] = [] # Do not go underneath | 147 names[:] = [] # Do not go underneath |
| 177 for name in names: | 148 for name in names: |
| 178 file_name = os.path.join(dir_name, name) | 149 file_name = os.path.join(dir_name, name) |
| 179 (interface, ext) = os.path.splitext(file_name) | 150 (interface, ext) = os.path.splitext(file_name) |
| 180 if ext == '.idl' and name not in ignored_idls: | 151 if ext == '.idl': |
| 181 idl_files.append(file_name) | 152 idl_files.append(file_name) |
| 182 | 153 |
| 183 os.path.walk(webcore_dir, visitor, webcore_dir) | 154 os.path.walk(webcore_dir, visitor, webcore_dir) |
| 184 | 155 |
| 185 database_dir = os.path.join(current_dir, '..', 'database') | 156 database_dir = os.path.join(current_dir, '..', 'database') |
| 186 return build_database(idl_files, database_dir, parallel=parallel) | 157 return build_database(idl_files, database_dir, parallel=parallel) |
| 187 | 158 |
| 188 if __name__ == '__main__': | 159 if __name__ == '__main__': |
| 189 sys.exit(main()) | 160 sys.exit(main()) |
| OLD | NEW |