15from idlnode
import IDLType, resolveTypedef
17_logger = logging.getLogger(
'fremontcutbuilder')
24 'ENABLE_CUSTOM_SCHEME_HANDLER',
25 'ENABLE_MEDIA_CAPTURE',
26 'ENABLE_ORIENTATION_EVENTS',
27 'ENABLE_WEBVTT_REGIONS',
31 'ENABLE_CALENDAR_PICKER',
32 'ENABLE_ENCRYPTED_MEDIA_V2',
33 'ENABLE_INPUT_SPEECH',
34 'ENABLE_LEGACY_NOTIFICATIONS',
35 'ENABLE_NAVIGATOR_CONTENT_UTILS',
36 'ENABLE_NOTIFICATIONS',
47 for interface, db_Opts
in all_interfaces:
49 def IsIdentified(idl_node):
50 node_name = idl_node.id
if idl_node.id
else 'parent'
55 if (resolvedType != idl_type):
56 idl_type.id = resolvedType.id
57 idl_type.nullable = resolvedType.nullable
61 interface.constants = list(filter(IsIdentified, interface.constants))
62 interface.attributes = list(filter(IsIdentified, interface.attributes))
63 interface.operations = list(filter(IsIdentified, interface.operations))
64 interface.parents = list(filter(IsIdentified, interface.parents))
70 logging_level=logging.WARNING,
72 """This code reconstructs the FremontCut IDL database from W3C,
73 WebKit and Dart IDL files.
"""
74 current_dir = os.path.dirname(__file__)
75 logging.config.fileConfig(os.path.join(current_dir, "logging.conf"))
77 _logger.setLevel(logging_level)
89 webkit_revision =
'63'
93 webkit_defines = [
'LANGUAGE_DART',
'LANGUAGE_JAVASCRIPT']
95 if feature_defines
is None:
96 feature_defines = FEATURE_DEFINES
100 idl_defines=webkit_defines + feature_defines,
102 source_attributes={
'revision': webkit_revision},
103 logging_level=logging_level)
106 builder.import_idl_files(idl_files, webkit_options,
False)
111 rename_operation_arguments_on_merge=
True,
112 logging_level=logging_level)
114 utilities.KNOWN_COMPONENTS = frozenset([
'core',
'modules',
'dart'])
116 builder.import_idl_files(
117 [os.path.join(current_dir,
'..',
'idl',
'dart',
'dart.idl')],
120 start_time = time.time()
126 builder.merge_imported_interfaces()
128 builder.fetch_constructor_data(webkit_options)
129 builder.fix_displacements(
'WebKit')
132 builder.normalize_annotations([
'WebKit',
'Dart'])
135 builder.map_dictionaries()
140 builder.examine_database()
142 conditionals_met =
set(
143 'ENABLE_' + conditional
for conditional
in builder.conditionals_met)
144 known_conditionals =
set(FEATURE_DEFINES + FEATURE_DISABLED)
146 unused_conditionals = known_conditionals - conditionals_met
147 if unused_conditionals:
148 _logger.warning(
'There are some unused conditionals %s' %
149 sorted(unused_conditionals))
150 _logger.warning(
'Please update fremontcutbuilder.py')
152 unknown_conditionals = conditionals_met - known_conditionals
153 if unknown_conditionals:
154 _logger.warning(
'There are some unknown conditionals %s' %
155 sorted(unknown_conditionals))
156 _logger.warning(
'Please update fremontcutbuilder.py')
158 print(
'Merging interfaces %s seconds' %
round(time.time() - start_time, 2))
163def main(parallel=False, logging_level=logging.WARNING, examine_idls=False):
164 current_dir = os.path.dirname(__file__)
169 webcore_dir = os.path.join(current_dir,
'..',
'..',
'..',
'third_party',
172 if not os.path.exists(webcore_dir):
174 webcore_dir = os.path.join(current_dir,
'..',
'..',
'..',
'..',
175 'third_party',
'WebKit',
'Source')
177 if not os.path.exists(webcore_dir):
178 raise RuntimeError(
'directory not found: %s' % webcore_dir)
192 'InspectorFrontendHostFileSystem.idl',
194 'WebKitGamepadList.idl',
197 for (dir_name, dirs, files)
in os.walk(webcore_dir):
198 if os.path.basename(dir_name)
in DIRS_TO_IGNORE:
202 file_name = os.path.join(dir_name, name)
203 (interface, ext) = os.path.splitext(file_name)
204 if ext ==
'.idl' and not (name
in FILES_TO_IGNORE):
205 idl_files.append(file_name)
207 database_dir = os.path.join(current_dir,
'..',
'database')
212 logging_level=logging_level,
213 examine_idls=examine_idls)
216if __name__ ==
'__main__':
static void round(SkPoint *p)
def set_builder(created_builder)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
def print(*args, **kwargs)
def build_database(idl_files, database_dir, feature_defines=None, logging_level=logging.WARNING, examine_idls=False)
def ResolveAllTypedefs(all_interfaces)
def main(parallel=False, logging_level=logging.WARNING, examine_idls=False)