OLD | NEW |
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 else: | 280 else: |
281 dependencies_other_component_full_paths.append(full_path) | 281 dependencies_other_component_full_paths.append(full_path) |
282 | 282 |
283 for include_path in partial_interfaces_include_paths: | 283 for include_path in partial_interfaces_include_paths: |
284 partial_interface_component = idl_filename_to_component(include_path
) | 284 partial_interface_component = idl_filename_to_component(include_path
) |
285 if component == partial_interface_component: | 285 if component == partial_interface_component: |
286 dependencies_include_paths.append(include_path) | 286 dependencies_include_paths.append(include_path) |
287 else: | 287 else: |
288 dependencies_other_component_include_paths.append(include_path) | 288 dependencies_other_component_include_paths.append(include_path) |
289 | 289 |
290 if interface_info['has_union_types']: | 290 for union_type in interface_info.get('union_types', []): |
| 291 if union_type.is_nullable: |
| 292 union_type = union_type.inner_type |
291 dependencies_include_paths.append( | 293 dependencies_include_paths.append( |
292 'bindings/%s/v8/UnionTypes%s.h' % (component, component.capitali
ze())) | 294 'bindings/%s/v8/%s.h' % (component, union_type.name)) |
293 | 295 |
294 interface_info.update({ | 296 interface_info.update({ |
295 'dependencies_full_paths': dependencies_full_paths, | 297 'dependencies_full_paths': dependencies_full_paths, |
296 'dependencies_include_paths': dependencies_include_paths, | 298 'dependencies_include_paths': dependencies_include_paths, |
297 'dependencies_other_component_full_paths': | 299 'dependencies_other_component_full_paths': |
298 dependencies_other_component_full_paths, | 300 dependencies_other_component_full_paths, |
299 'dependencies_other_component_include_paths': | 301 'dependencies_other_component_include_paths': |
300 dependencies_other_component_include_paths, | 302 dependencies_other_component_include_paths, |
301 }) | 303 }) |
302 | 304 |
303 # Clean up temporary private information | 305 # Clean up temporary private information |
304 for interface_info in interfaces_info.itervalues(): | 306 for interface_info in interfaces_info.itervalues(): |
305 del interface_info['extended_attributes'] | 307 del interface_info['extended_attributes'] |
306 del interface_info['has_union_types'] | 308 del interface_info['union_types'] |
307 del interface_info['is_legacy_treat_as_partial_interface'] | 309 del interface_info['is_legacy_treat_as_partial_interface'] |
308 | 310 |
309 # Compute global_type_info to interfaces_info so that idl_compiler does | 311 # Compute global_type_info to interfaces_info so that idl_compiler does |
310 # not need to always calculate the info in __init__. | 312 # not need to always calculate the info in __init__. |
311 compute_global_type_info() | 313 compute_global_type_info() |
312 | 314 |
313 | 315 |
314 ################################################################################ | 316 ################################################################################ |
315 | 317 |
316 def main(): | 318 def main(): |
317 options, args = parse_options() | 319 options, args = parse_options() |
318 # args = Input1, Input2, ..., Output | 320 # args = Input1, Input2, ..., Output |
319 interfaces_info_filename = args.pop() | 321 interfaces_info_filename = args.pop() |
320 info_individuals = read_pickle_files(args) | 322 info_individuals = read_pickle_files(args) |
321 | 323 |
322 compute_interfaces_info_overall(info_individuals) | 324 compute_interfaces_info_overall(info_individuals) |
323 write_pickle_file(interfaces_info_filename, | 325 write_pickle_file(interfaces_info_filename, |
324 interfaces_info, | 326 interfaces_info, |
325 options.write_file_only_if_changed) | 327 options.write_file_only_if_changed) |
326 | 328 |
327 | 329 |
328 if __name__ == '__main__': | 330 if __name__ == '__main__': |
329 sys.exit(main()) | 331 sys.exit(main()) |
OLD | NEW |