OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 29 matching lines...) Expand all Loading... |
40 from utilities import idl_filename_to_component, is_valid_component_dependency,
merge_dict_recursively | 40 from utilities import idl_filename_to_component, is_valid_component_dependency,
merge_dict_recursively |
41 | 41 |
42 # The following extended attributes can be applied to a dependency interface, | 42 # The following extended attributes can be applied to a dependency interface, |
43 # and are then applied to the individual members when merging. | 43 # and are then applied to the individual members when merging. |
44 # Note that this moves the extended attribute from the interface to the member, | 44 # Note that this moves the extended attribute from the interface to the member, |
45 # which changes the semantics and yields different code than the same extended | 45 # which changes the semantics and yields different code than the same extended |
46 # attribute on the main interface. | 46 # attribute on the main interface. |
47 DEPENDENCY_EXTENDED_ATTRIBUTES = frozenset([ | 47 DEPENDENCY_EXTENDED_ATTRIBUTES = frozenset([ |
48 'Conditional', | 48 'Conditional', |
49 'RuntimeEnabled', | 49 'RuntimeEnabled', |
50 'TypeChecking', | |
51 ]) | 50 ]) |
52 | 51 |
53 | 52 |
54 class InterfaceDependencyResolver(object): | 53 class InterfaceDependencyResolver(object): |
55 def __init__(self, interfaces_info, reader): | 54 def __init__(self, interfaces_info, reader): |
56 """Initialize dependency resolver. | 55 """Initialize dependency resolver. |
57 | 56 |
58 Args: | 57 Args: |
59 interfaces_info: | 58 interfaces_info: |
60 dict of interfaces information, from compute_dependencies.py | 59 dict of interfaces information, from compute_dependencies.py |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 # This loop may process the same interface many times, so it's | 338 # This loop may process the same interface many times, so it's |
340 # possible that we're adding the same attributes twice or more. | 339 # possible that we're adding the same attributes twice or more. |
341 # So check if there is a duplicate. | 340 # So check if there is a duplicate. |
342 for attr in inherited_unforgeable_attributes: | 341 for attr in inherited_unforgeable_attributes: |
343 if attr not in interface.attributes: | 342 if attr not in interface.attributes: |
344 interface.attributes.append(attr) | 343 interface.attributes.append(attr) |
345 referenced_interfaces.extend(interface_info.get('referenced_interfac
es', [])) | 344 referenced_interfaces.extend(interface_info.get('referenced_interfac
es', [])) |
346 interface_info['referenced_interfaces'] = sorted(set(referenced_inte
rfaces)) | 345 interface_info['referenced_interfaces'] = sorted(set(referenced_inte
rfaces)) |
347 merge_dict_recursively(interface_info, | 346 merge_dict_recursively(interface_info, |
348 {'cpp_includes': {component: cpp_includes}}) | 347 {'cpp_includes': {component: cpp_includes}}) |
OLD | NEW |