Add support for generating JS protos

Adds support for generating JS protos so that
the Kaleidoscope UI can deserialize the protos
from the Google API.

The generated code needs the protobuf JS library
which depends on parts of the closure library so
we add that to third_party.

BUG=1087037

Change-Id: Iee388e02f0ffcc0d1108a7f816da9f88c01fa58b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218554
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Leonard Grey <lgrey@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#777486}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1791b0b1e19153c5165f3d1afc04aeaa0e8f8726
diff --git a/protoc_wrapper.py b/protoc_wrapper.py
index 4bb3f06..e750880 100755
--- a/protoc_wrapper.py
+++ b/protoc_wrapper.py
@@ -78,6 +78,8 @@
                       help="Output directory for standard C++ generator.")
   parser.add_argument("--py-out-dir",
                       help="Output directory for standard Python generator.")
+  parser.add_argument("--js-out-dir",
+                      help="Output directory for standard JS generator.")
   parser.add_argument("--plugin-out-dir",
                       help="Output directory for custom generator plugin.")
 
@@ -110,6 +112,12 @@
   if options.py_out_dir:
     protoc_cmd += ["--python_out", options.py_out_dir]
 
+  if options.js_out_dir:
+    protoc_cmd += [
+        "--js_out",
+        "one_output_file_per_input_file,binary:" + options.js_out_dir
+    ]
+
   if options.cc_out_dir:
     cc_out_dir = options.cc_out_dir
     cc_options_list = []