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

Side by Side Diff: Source/bindings/scripts/compute_interfaces_info.py

Issue 270573005: Move modules-dependent IDL statements out of core by supporting 'implements' in RHS interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (C) 2013 Google Inc. All rights reserved. 3 # Copyright (C) 2013 Google Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 Design doc: http://www.chromium.org/developers/design-documents/idl-build 76 Design doc: http://www.chromium.org/developers/design-documents/idl-build
77 """ 77 """
78 78
79 from collections import defaultdict 79 from collections import defaultdict
80 import optparse 80 import optparse
81 import os 81 import os
82 import posixpath 82 import posixpath
83 import sys 83 import sys
84 84
85 from utilities import get_file_contents, write_pickle_file, get_interface_extend ed_attributes_from_idl, is_callback_interface_from_idl, get_partial_interface_na me_from_idl, get_implemented_interfaces_from_idl, get_parent_interface, get_put_ forward_interfaces_from_idl 85 from utilities import get_file_contents, write_pickle_file, get_interface_extend ed_attributes_from_idl, is_callback_interface_from_idl, get_partial_interface_na me_from_idl, get_implemented_interfaces_from_idl, get_source_interfaces_from_idl , get_parent_interface, get_put_forward_interfaces_from_idl
86 86
87 module_path = os.path.dirname(__file__) 87 module_path = os.path.dirname(__file__)
88 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir)) 88 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
89 89
90 INHERITED_EXTENDED_ATTRIBUTES = set([ 90 INHERITED_EXTENDED_ATTRIBUTES = set([
91 'ActiveDOMObject', 91 'ActiveDOMObject',
92 'DependentLifetime', 92 'DependentLifetime',
93 'GarbageCollected', 93 'GarbageCollected',
94 'WillBeGarbageCollected', 94 'WillBeGarbageCollected',
95 ]) 95 ])
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 'is_callback_interface': is_callback_interface_from_idl(idl_file_content s), 184 'is_callback_interface': is_callback_interface_from_idl(idl_file_content s),
185 # Interfaces that are referenced (used as types) and that we introspect 185 # Interfaces that are referenced (used as types) and that we introspect
186 # during code generation (beyond interface-level data ([ImplementedAs], 186 # during code generation (beyond interface-level data ([ImplementedAs],
187 # is_callback_interface, ancestors, and inherited extended attributes): 187 # is_callback_interface, ancestors, and inherited extended attributes):
188 # deep dependencies. 188 # deep dependencies.
189 # These cause rebuilds of referrers, due to the dependency, so these 189 # These cause rebuilds of referrers, due to the dependency, so these
190 # should be minimized; currently only targets of [PutForwards]. 190 # should be minimized; currently only targets of [PutForwards].
191 'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_co ntents), 191 'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_co ntents),
192 } 192 }
193 193
194 source_implements_interfaces = get_source_interfaces_from_idl(idl_file_conte nts, interface_name)
Inactive 2014/05/07 20:08:07 Please add a comment to explain why we need to do
195 for source_interface_name in source_implements_interfaces:
196 interface_info = interfaces_info[source_interface_name]
197 interface_info['implements_interfaces'].append(interface_name)
198
194 # Record inheritance information 199 # Record inheritance information
195 inherited_extended_attributes_by_interface[interface_name] = dict( 200 inherited_extended_attributes_by_interface[interface_name] = dict(
196 (key, value) 201 (key, value)
197 for key, value in extended_attributes.iteritems() 202 for key, value in extended_attributes.iteritems()
198 if key in INHERITED_EXTENDED_ATTRIBUTES) 203 if key in INHERITED_EXTENDED_ATTRIBUTES)
199 parent = get_parent_interface(idl_file_contents) 204 parent = get_parent_interface(idl_file_contents)
200 if parent: 205 if parent:
201 parent_interfaces[interface_name] = parent 206 parent_interfaces[interface_name] = parent
202 207
203 208
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 idl_files.extend(args) 302 idl_files.extend(args)
298 303
299 compute_interfaces_info(idl_files) 304 compute_interfaces_info(idl_files)
300 write_pickle_file(options.interfaces_info_file, 305 write_pickle_file(options.interfaces_info_file,
301 interfaces_info, 306 interfaces_info,
302 options.write_file_only_if_changed) 307 options.write_file_only_if_changed)
303 308
304 309
305 if __name__ == '__main__': 310 if __name__ == '__main__':
306 sys.exit(main()) 311 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/utilities.py » ('j') | Source/bindings/scripts/utilities.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698