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

Unified Diff: Source/build/scripts/make_private_script_source.py

Issue 360703003: Implement Blink-in-JS for DOM methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/make_private_script_source.py
diff --git a/Source/build/scripts/make_private_script_source.py b/Source/build/scripts/make_private_script_source.py
index 38749edd5febefa01cc533ced1a438e6e5c31575..2537f7a85e73cfd647d016754c2c381b17b1c383 100644
--- a/Source/build/scripts/make_private_script_source.py
+++ b/Source/build/scripts/make_private_script_source.py
@@ -6,7 +6,7 @@
FIXME: We don't want to add more build scripts. Rewrite this script in grit. crbug.com/388121
Usage:
-python make_private_script.py DESTINATION_FILE SOURCE_FILES
+python make_private_script_source.py DESTINATION_FILE SOURCE_FILES
"""
import os
@@ -16,6 +16,8 @@ import sys
def main():
output_filename = sys.argv[1]
input_filenames = sys.argv[2:]
+ source_name, ext = os.path.splitext(os.path.basename(output_filename))
+
contents = []
for input_filename in input_filenames:
class_name, ext = os.path.splitext(os.path.basename(input_filename))
@@ -24,15 +26,15 @@ def main():
hex_values = ['0x{0:02x}'.format(ord(char)) for char in input_text]
contents.append('const unsigned char kSourceOf%s[] = {\n %s\n};\n' % (
class_name, ', '.join(hex_values)))
+ contents.append('struct %s {' % source_name)
contents.append("""
-struct PrivateScriptSources {
const char* name;
const unsigned char* source;
size_t size;
};
""")
- contents.append('struct PrivateScriptSources kPrivateScriptSources[] = {\n')
+ contents.append('struct %s k%s[] = {\n' % (source_name, source_name))
for input_filename in input_filenames:
class_name, ext = os.path.splitext(os.path.basename(input_filename))
contents.append(' { "%s", kSourceOf%s, sizeof(kSourceOf%s) },\n' % (class_name, class_name, class_name))
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698