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

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

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 interface_info['unforgeable_attributes'] = {} 211 interface_info['unforgeable_attributes'] = {}
212 interface_info['unforgeable_attributes'][component] = unforgeable_at tributes 212 interface_info['unforgeable_attributes'][component] = unforgeable_at tributes
213 return interface_info 213 return interface_info
214 214
215 definitions = self.reader.read_idl_file(idl_filename) 215 definitions = self.reader.read_idl_file(idl_filename)
216 216
217 this_union_types = collect_union_types_from_definitions(definitions) 217 this_union_types = collect_union_types_from_definitions(definitions)
218 self.union_types.update(this_union_types) 218 self.union_types.update(this_union_types)
219 self.typedefs.update(definitions.typedefs) 219 self.typedefs.update(definitions.typedefs)
220 for callback_function_name, callback_function in definitions.callback_fu nctions.iteritems(): 220 for callback_function_name, callback_function in definitions.callback_fu nctions.iteritems():
221 if 'ExperimentalCallbackFunction' in callback_function.extended_attr ibutes: 221 if 'ExperimentalCallbackFunction' in callback_function.extended_attr ibutes:
bashi 2016/09/13 00:35:05 Please add a comment to describe what 'component_d
lkawai 2016/09/16 05:05:49 Done.
222 self.callback_functions[callback_function_name] = callback_funct ion 222 self.callback_functions[callback_function_name] = {
223 'callback_function': callback_function,
224 'component_dir': idl_filename_to_component(idl_filename),
225 }
223 # Check enum duplication. 226 # Check enum duplication.
224 for enum_name in definitions.enumerations.keys(): 227 for enum_name in definitions.enumerations.keys():
225 for defined_enum in self.enumerations: 228 for defined_enum in self.enumerations:
226 if defined_enum.name == enum_name: 229 if defined_enum.name == enum_name:
227 raise Exception('Enumeration %s has multiple definitions' % enum_name) 230 raise Exception('Enumeration %s has multiple definitions' % enum_name)
228 self.enumerations.update(definitions.enumerations.values()) 231 self.enumerations.update(definitions.enumerations.values())
229 232
230 if definitions.interfaces: 233 if definitions.interfaces:
231 definition = next(definitions.interfaces.itervalues()) 234 definition = next(definitions.interfaces.itervalues())
232 interface_info = { 235 interface_info = {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 358
356 write_pickle_file(options.interfaces_info_file, 359 write_pickle_file(options.interfaces_info_file,
357 info_collector.get_info_as_dict(), 360 info_collector.get_info_as_dict(),
358 options.write_file_only_if_changed) 361 options.write_file_only_if_changed)
359 write_pickle_file(options.component_info_file, 362 write_pickle_file(options.component_info_file,
360 info_collector.get_component_info_as_dict(), 363 info_collector.get_component_info_as_dict(),
361 options.write_file_only_if_changed) 364 options.write_file_only_if_changed)
362 365
363 if __name__ == '__main__': 366 if __name__ == '__main__':
364 sys.exit(main()) 367 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698