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

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

Issue 210663003: Use |isolate| local variable in bindings, clean up comments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update extension Created 6 years, 9 months 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
« no previous file with comments | « no previous file | Source/bindings/templates/callback_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.py
diff --git a/Source/bindings/scripts/code_generator_v8.py b/Source/bindings/scripts/code_generator_v8.py
index 7aaec00248d5a16366e35eae40d76484252a97dc..e04d7742cf6b8452283f6fa6e1a8b3ecd207313d 100644
--- a/Source/bindings/scripts/code_generator_v8.py
+++ b/Source/bindings/scripts/code_generator_v8.py
@@ -56,11 +56,13 @@ import sys
# If paths differ between pre-caching and individual file compilation, the cache
# is regenerated, which causes a race condition and breaks concurrent build,
# since some compile processes will try to read the partially written cache.
-module_path = os.path.dirname(os.path.realpath(__file__))
+module_path, module_filename = os.path.split(os.path.realpath(__file__))
third_party_dir = os.path.normpath(os.path.join(
module_path, os.pardir, os.pardir, os.pardir, os.pardir))
templates_dir = os.path.normpath(os.path.join(
module_path, os.pardir, 'templates'))
+# Make sure extension is .py, not .pyc or .pyo, so doesn't depend on caching
+module_pyname = os.path.splitext(module_filename)[0] + '.py'
# jinja2 is in chromium's third_party directory.
# Insert at 1 so at front to override system libraries, and
@@ -130,6 +132,7 @@ class CodeGeneratorV8(object):
# Generate contents (input parameters for Jinja)
template_contents = generate_contents(interface)
+ template_contents['code_generator'] = module_pyname
# Add includes for interface itself and any dependencies
interface_info = self.interfaces_info[interface_name]
« no previous file with comments | « no previous file | Source/bindings/templates/callback_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698