| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 'interfaceName': None, | 45 'interfaceName': None, |
| 46 'noConstructor': None, | 46 'noConstructor': None, |
| 47 'runtimeEnabled': None, | 47 'runtimeEnabled': None, |
| 48 }) | 48 }) |
| 49 default_parameters = dict(MakeQualifiedNamesWriter.default_parameters, **{ | 49 default_parameters = dict(MakeQualifiedNamesWriter.default_parameters, **{ |
| 50 'fallbackInterfaceName': '', | 50 'fallbackInterfaceName': '', |
| 51 'fallbackJSInterfaceName': '', | 51 'fallbackJSInterfaceName': '', |
| 52 }) | 52 }) |
| 53 filters = MakeQualifiedNamesWriter.filters | 53 filters = MakeQualifiedNamesWriter.filters |
| 54 | 54 |
| 55 def __init__(self, in_file_paths, enabled_conditions): | 55 def __init__(self, in_file_paths): |
| 56 super(MakeElementFactoryWriter, self).__init__(in_file_paths, enabled_co
nditions) | 56 super(MakeElementFactoryWriter, self).__init__(in_file_paths) |
| 57 | 57 |
| 58 # FIXME: When we start using these element factories, we'll want to | 58 # FIXME: When we start using these element factories, we'll want to |
| 59 # remove the "new" prefix and also have our base class generate | 59 # remove the "new" prefix and also have our base class generate |
| 60 # *Names.h and *Names.cpp. | 60 # *Names.h and *Names.cpp. |
| 61 self._outputs.update({ | 61 self._outputs.update({ |
| 62 (self.namespace + 'ElementFactory.h'): self.generate_factory_header, | 62 (self.namespace + 'ElementFactory.h'): self.generate_factory_header, |
| 63 (self.namespace + 'ElementFactory.cpp'): self.generate_factory_imple
mentation, | 63 (self.namespace + 'ElementFactory.cpp'): self.generate_factory_imple
mentation, |
| 64 ('V8' + self.namespace + 'ElementWrapperFactory.h'): self.generate_w
rapper_factory_header, | 64 ('V8' + self.namespace + 'ElementWrapperFactory.h'): self.generate_w
rapper_factory_header, |
| 65 ('V8' + self.namespace + 'ElementWrapperFactory.cpp'): self.generate
_wrapper_factory_implementation, | 65 ('V8' + self.namespace + 'ElementWrapperFactory.cpp'): self.generate
_wrapper_factory_implementation, |
| 66 }) | 66 }) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 if tag['JSInterfaceName']: | 111 if tag['JSInterfaceName']: |
| 112 return tag['JSInterfaceName'] | 112 return tag['JSInterfaceName'] |
| 113 return self._interface(tag) | 113 return self._interface(tag) |
| 114 | 114 |
| 115 def _has_js_interface(self, tag): | 115 def _has_js_interface(self, tag): |
| 116 return not tag['noConstructor'] and self._js_interface(tag) != ('%sEleme
nt' % self.namespace) | 116 return not tag['noConstructor'] and self._js_interface(tag) != ('%sEleme
nt' % self.namespace) |
| 117 | 117 |
| 118 | 118 |
| 119 if __name__ == "__main__": | 119 if __name__ == "__main__": |
| 120 in_generator.Maker(MakeElementFactoryWriter).main(sys.argv) | 120 in_generator.Maker(MakeElementFactoryWriter).main(sys.argv) |
| OLD | NEW |