| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 for interface_name, interface_info in interfaces_info.iteritems() | 99 for interface_name, interface_info in interfaces_info.iteritems() |
| 100 if interface_info['implemented_as'])) | 100 if interface_info['implemented_as'])) |
| 101 IdlType.set_garbage_collected_types(set( | 101 IdlType.set_garbage_collected_types(set( |
| 102 interface_name | 102 interface_name |
| 103 for interface_name, interface_info in interfaces_info.iteritems() | 103 for interface_name, interface_info in interfaces_info.iteritems() |
| 104 if 'GarbageCollected' in interface_info['inherited_extended_attribut
es'])) | 104 if 'GarbageCollected' in interface_info['inherited_extended_attribut
es'])) |
| 105 IdlType.set_will_be_garbage_collected_types(set( | 105 IdlType.set_will_be_garbage_collected_types(set( |
| 106 interface_name | 106 interface_name |
| 107 for interface_name, interface_info in interfaces_info.iteritems() | 107 for interface_name, interface_info in interfaces_info.iteritems() |
| 108 if 'WillBeGarbageCollected' in interface_info['inherited_extended_at
tributes'])) | 108 if 'WillBeGarbageCollected' in interface_info['inherited_extended_at
tributes'])) |
| 109 v8_types.set_component_dirs(dict( |
| 110 (interface_name, interface_info['component_dir']) |
| 111 for interface_name, interface_info in interfaces_info.iteritems())) |
| 109 | 112 |
| 110 def generate_code(self, definitions, interface_name): | 113 def generate_code(self, definitions, interface_name): |
| 111 """Returns .h/.cpp code as (header_text, cpp_text).""" | 114 """Returns .h/.cpp code as (header_text, cpp_text).""" |
| 112 try: | 115 try: |
| 113 interface = definitions.interfaces[interface_name] | 116 interface = definitions.interfaces[interface_name] |
| 114 except KeyError: | 117 except KeyError: |
| 115 raise Exception('%s not in IDL definitions' % interface_name) | 118 raise Exception('%s not in IDL definitions' % interface_name) |
| 116 | 119 |
| 117 # Store other interfaces for introspection | 120 # Store other interfaces for introspection |
| 118 interfaces.update(definitions.interfaces) | 121 interfaces.update(definitions.interfaces) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 212 |
| 210 # Create a dummy file as output for the build system, | 213 # Create a dummy file as output for the build system, |
| 211 # since filenames of individual cache files are unpredictable and opaque | 214 # since filenames of individual cache files are unpredictable and opaque |
| 212 # (they are hashes of the template path, which varies based on environment) | 215 # (they are hashes of the template path, which varies based on environment) |
| 213 with open(dummy_filename, 'w') as dummy_file: | 216 with open(dummy_filename, 'w') as dummy_file: |
| 214 pass # |open| creates or touches the file | 217 pass # |open| creates or touches the file |
| 215 | 218 |
| 216 | 219 |
| 217 if __name__ == '__main__': | 220 if __name__ == '__main__': |
| 218 sys.exit(main(sys.argv)) | 221 sys.exit(main(sys.argv)) |
| OLD | NEW |