Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: third_party/WebKit/Source/bindings/scripts/code_generator_v8.py

Issue 2569923003: Refer back to Jinja templates from the C++ code generated from IDL files. (Closed)
Patch Set: Also cover templates used from code_generator_web_module.py Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
index 93ef6055d9ed0870ed02c46c78886692ec9c4b0d..aa65fe4c46373dd79d5bbf17c48e2385f3f9b964 100644
--- a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
@@ -48,7 +48,7 @@ Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
import os
import posixpath
-from code_generator import CodeGeneratorBase, normalize_and_sort_includes
+from code_generator import CodeGeneratorBase, render_template, normalize_and_sort_includes
from idl_definitions import Visitor
from idl_types import IdlType
import v8_callback_function
@@ -302,8 +302,8 @@ class CodeGeneratorUnionType(CodeGeneratorBase):
template_context['exported'] = self.info_provider.specifier_for_export
name = shorten_union_name(union_type)
template_context['this_include_header_name'] = name
- header_text = header_template.render(template_context)
- cpp_text = cpp_template.render(template_context)
+ header_text = render_template(header_template, template_context)
+ cpp_text = render_template(cpp_template, template_context)
header_path = posixpath.join(self.output_dir, '%s.h' % name)
cpp_path = posixpath.join(self.output_dir, '%s.cpp' % name)
return (
@@ -357,8 +357,8 @@ class CodeGeneratorCallbackFunction(CodeGeneratorBase):
template_context['header_includes'] = normalize_and_sort_includes(
template_context['header_includes'])
template_context['code_generator'] = MODULE_PYNAME
- header_text = header_template.render(template_context)
- cpp_text = cpp_template.render(template_context)
+ header_text = render_template(header_template, template_context)
+ cpp_text = render_template(cpp_template, template_context)
header_path = posixpath.join(self.output_dir, '%s.h' % callback_function.name)
cpp_path = posixpath.join(self.output_dir, '%s.cpp' % callback_function.name)
return (

Powered by Google App Engine
This is Rietveld 408576698