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

Side by Side Diff: third_party/WebKit/Source/bindings/scripts/compute_interfaces_info_overall.py

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 from collections import defaultdict 84 from collections import defaultdict
85 import cPickle as pickle 85 import cPickle as pickle
86 import optparse 86 import optparse
87 import sys 87 import sys
88 88
89 from utilities import idl_filename_to_component, read_pickle_files, write_pickle _file, merge_dict_recursively 89 from utilities import idl_filename_to_component, read_pickle_files, write_pickle _file, merge_dict_recursively
90 90
91 INHERITED_EXTENDED_ATTRIBUTES = set([ 91 INHERITED_EXTENDED_ATTRIBUTES = set([
92 'ActiveScriptWrappable', 92 'ActiveScriptWrappable',
93 'DependentLifetime', 93 'DependentLifetime',
94 'GarbageCollected',
95 ]) 94 ])
96 95
97 # Main variable (filled in and exported) 96 # Main variable (filled in and exported)
98 interfaces_info = {} 97 interfaces_info = {}
99 98
100 # Auxiliary variables (not visible to future build steps) 99 # Auxiliary variables (not visible to future build steps)
101 partial_interface_files = defaultdict(lambda: { 100 partial_interface_files = defaultdict(lambda: {
102 'full_paths': [], 101 'full_paths': [],
103 'include_paths': [], 102 'include_paths': [],
104 }) 103 })
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if interface_info['ancestors']: 176 if interface_info['ancestors']:
178 ancestors[interface_name] = interface_info['ancestors'] 177 ancestors[interface_name] = interface_info['ancestors']
179 if interface_info['is_callback_interface']: 178 if interface_info['is_callback_interface']:
180 callback_interfaces.add(interface_name) 179 callback_interfaces.add(interface_name)
181 if interface_info['is_dictionary']: 180 if interface_info['is_dictionary']:
182 dictionaries[interface_name] = interface_info['is_dictionary'] 181 dictionaries[interface_name] = interface_info['is_dictionary']
183 if interface_info['implemented_as']: 182 if interface_info['implemented_as']:
184 implemented_as_interfaces[interface_name] = interface_info['implemen ted_as'] 183 implemented_as_interfaces[interface_name] = interface_info['implemen ted_as']
185 184
186 inherited_extended_attributes = interface_info['inherited_extended_attri butes'] 185 inherited_extended_attributes = interface_info['inherited_extended_attri butes']
187 if 'GarbageCollected' in inherited_extended_attributes: 186 garbage_collected_interfaces.add(interface_name)
188 garbage_collected_interfaces.add(interface_name)
189 187
190 interfaces_info['ancestors'] = ancestors 188 interfaces_info['ancestors'] = ancestors
191 interfaces_info['callback_interfaces'] = callback_interfaces 189 interfaces_info['callback_interfaces'] = callback_interfaces
192 interfaces_info['dictionaries'] = dictionaries 190 interfaces_info['dictionaries'] = dictionaries
193 interfaces_info['implemented_as_interfaces'] = implemented_as_interfaces 191 interfaces_info['implemented_as_interfaces'] = implemented_as_interfaces
194 interfaces_info['garbage_collected_interfaces'] = garbage_collected_interfac es 192 interfaces_info['garbage_collected_interfaces'] = garbage_collected_interfac es
195 interfaces_info['component_dirs'] = component_dirs 193 interfaces_info['component_dirs'] = component_dirs
196 194
197 195
198 def compute_interfaces_info_overall(info_individuals): 196 def compute_interfaces_info_overall(info_individuals):
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 info_individuals = read_pickle_files(args) 320 info_individuals = read_pickle_files(args)
323 321
324 compute_interfaces_info_overall(info_individuals) 322 compute_interfaces_info_overall(info_individuals)
325 write_pickle_file(interfaces_info_filename, 323 write_pickle_file(interfaces_info_filename,
326 interfaces_info, 324 interfaces_info,
327 options.write_file_only_if_changed) 325 options.write_file_only_if_changed)
328 326
329 327
330 if __name__ == '__main__': 328 if __name__ == '__main__':
331 sys.exit(main()) 329 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698