| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 the main IdlInterface, as these are only referenced (their members are | 75 the main IdlInterface, as these are only referenced (their members are |
| 76 introspected, but not implemented in this interface). | 76 introspected, but not implemented in this interface). |
| 77 | 77 |
| 78 Inherited extended attributes are also added to the main IdlInterface. | 78 Inherited extended attributes are also added to the main IdlInterface. |
| 79 | 79 |
| 80 Modifies definitions in place by adding parsed dependencies. | 80 Modifies definitions in place by adding parsed dependencies. |
| 81 | 81 |
| 82 Args: | 82 Args: |
| 83 definitions: IdlDefinitions object, modified in place | 83 definitions: IdlDefinitions object, modified in place |
| 84 """ | 84 """ |
| 85 if not definitions.interfaces: |
| 86 # This definitions should have a dictionary. Nothing to do for it. |
| 87 return |
| 85 target_interface = next(definitions.interfaces.itervalues()) | 88 target_interface = next(definitions.interfaces.itervalues()) |
| 86 interface_name = target_interface.name | 89 interface_name = target_interface.name |
| 87 interface_info = self.interfaces_info[interface_name] | 90 interface_info = self.interfaces_info[interface_name] |
| 88 | 91 |
| 89 if 'inherited_extended_attributes' in interface_info: | 92 if 'inherited_extended_attributes' in interface_info: |
| 90 target_interface.extended_attributes.update( | 93 target_interface.extended_attributes.update( |
| 91 interface_info['inherited_extended_attributes']) | 94 interface_info['inherited_extended_attributes']) |
| 92 | 95 |
| 93 merge_interface_dependencies(definitions, | 96 merge_interface_dependencies(definitions, |
| 94 target_interface, | 97 target_interface, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 merged_extended_attributes['PartialInterfaceImplementedAs'] = ( | 173 merged_extended_attributes['PartialInterfaceImplementedAs'] = ( |
| 171 dependency_interface.extended_attributes.get( | 174 dependency_interface.extended_attributes.get( |
| 172 'ImplementedAs', dependency_interface_basename)) | 175 'ImplementedAs', dependency_interface_basename)) |
| 173 | 176 |
| 174 for attribute in dependency_interface.attributes: | 177 for attribute in dependency_interface.attributes: |
| 175 attribute.extended_attributes.update(merged_extended_attributes) | 178 attribute.extended_attributes.update(merged_extended_attributes) |
| 176 for constant in dependency_interface.constants: | 179 for constant in dependency_interface.constants: |
| 177 constant.extended_attributes.update(merged_extended_attributes) | 180 constant.extended_attributes.update(merged_extended_attributes) |
| 178 for operation in dependency_interface.operations: | 181 for operation in dependency_interface.operations: |
| 179 operation.extended_attributes.update(merged_extended_attributes) | 182 operation.extended_attributes.update(merged_extended_attributes) |
| OLD | NEW |