| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 # _generate_container_code() whenever a new union file is generated. | 293 # _generate_container_code() whenever a new union file is generated. |
| 294 self.typedefs = {} | 294 self.typedefs = {} |
| 295 for name, typedef in self.info_provider.typedefs.iteritems(): | 295 for name, typedef in self.info_provider.typedefs.iteritems(): |
| 296 self.typedefs[name] = typedef.idl_type | 296 self.typedefs[name] = typedef.idl_type |
| 297 | 297 |
| 298 def _generate_container_code(self, union_type): | 298 def _generate_container_code(self, union_type): |
| 299 union_type = union_type.resolve_typedefs(self.typedefs) | 299 union_type = union_type.resolve_typedefs(self.typedefs) |
| 300 header_template = self.jinja_env.get_template('union_container.h.tmpl') | 300 header_template = self.jinja_env.get_template('union_container.h.tmpl') |
| 301 cpp_template = self.jinja_env.get_template('union_container.cpp.tmpl') | 301 cpp_template = self.jinja_env.get_template('union_container.cpp.tmpl') |
| 302 template_context = v8_union.container_context( | 302 template_context = v8_union.container_context( |
| 303 union_type, self.info_provider.interfaces_info) | 303 union_type, self.info_provider) |
| 304 template_context['header_includes'].append( | 304 template_context['header_includes'].append( |
| 305 self.info_provider.include_path_for_export) | 305 self.info_provider.include_path_for_export) |
| 306 template_context['header_includes'] = normalize_and_sort_includes( | 306 template_context['header_includes'] = normalize_and_sort_includes( |
| 307 template_context['header_includes']) | 307 template_context['header_includes']) |
| 308 template_context['code_generator'] = self.generator_name | 308 template_context['code_generator'] = self.generator_name |
| 309 template_context['exported'] = self.info_provider.specifier_for_export | 309 template_context['exported'] = self.info_provider.specifier_for_export |
| 310 name = shorten_union_name(union_type) | 310 name = shorten_union_name(union_type) |
| 311 template_context['this_include_header_name'] = name | 311 template_context['this_include_header_name'] = name |
| 312 header_text = render_template(header_template, template_context) | 312 header_text = render_template(header_template, template_context) |
| 313 cpp_text = render_template(cpp_template, template_context) | 313 cpp_text = render_template(cpp_template, template_context) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 outputs = set() | 381 outputs = set() |
| 382 for callback_function_dict in callback_functions.itervalues(): | 382 for callback_function_dict in callback_functions.itervalues(): |
| 383 if callback_function_dict['component_dir'] != self.target_component: | 383 if callback_function_dict['component_dir'] != self.target_component: |
| 384 continue | 384 continue |
| 385 callback_function = callback_function_dict['callback_function'] | 385 callback_function = callback_function_dict['callback_function'] |
| 386 if 'Custom' in callback_function.extended_attributes: | 386 if 'Custom' in callback_function.extended_attributes: |
| 387 continue | 387 continue |
| 388 path = callback_function_dict['full_path'] | 388 path = callback_function_dict['full_path'] |
| 389 outputs.update(self.generate_code_internal(callback_function, path)) | 389 outputs.update(self.generate_code_internal(callback_function, path)) |
| 390 return outputs | 390 return outputs |
| OLD | NEW |