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

Unified Diff: mojo/public/tools/bindings/mojom_bindings_generator.py

Issue 2965803003: Mojo JS bindings: add support to generate "dual-mode" code. (Closed)
Patch Set: . Created 3 years, 5 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 | « mojo/public/tools/bindings/mojom.gni ('k') | mojo/public/tools/bindings/pylib/mojom/generate/generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/mojom_bindings_generator.py
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.py b/mojo/public/tools/bindings/mojom_bindings_generator.py
index c8ffc6e168cbc9780dd6cbb81f2a82227fe556c6..a7f62337695dcdc07d93d482efed2ec8171a452f 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator.py
@@ -204,7 +204,7 @@ class MojomProcessor(object):
variant=args.variant, bytecode_path=args.bytecode_path,
for_blink=args.for_blink,
use_once_callback=args.use_once_callback,
- use_new_js_bindings=args.use_new_js_bindings,
+ js_bindings_mode=args.js_bindings_mode,
export_attribute=args.export_attribute,
export_header=args.export_header,
generate_non_variant_code=args.generate_non_variant_code)
@@ -336,9 +336,12 @@ def main():
"--use_once_callback", action="store_true",
help="Use base::OnceCallback instead of base::RepeatingCallback.")
generate_parser.add_argument(
- "--use_new_js_bindings", action="store_true",
- help="Use the new module loading approach and the core API exposed by "
- "Web IDL. This option only affects the JavaScript bindings.")
+ "--js_bindings_mode", choices=["new", "both", "old"], default="new",
+ help="This option only affects the JavaScript bindings. The value could "
+ "be: \"new\" - generate only the new-style JS bindings, which use the "
+ "new module loading approach and the core api exposed by Web IDL; "
+ "\"both\" - generate both the old- and new-style bindings; \"old\" - "
+ "generate only the old-style bindings.")
generate_parser.add_argument(
"--export_attribute", default="",
help="Optional attribute to specify on class declaration to export it "
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | mojo/public/tools/bindings/pylib/mojom/generate/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698