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

Unified Diff: third_party/inspector_protocol/CodeGenerator.py

Issue 2490473004: [DevTools] Roll third_party/inspector_protocol to e23134c5aa6131e5a3a3afbefce255becce3a3bd. (Closed)
Patch Set: ui_devtools Created 4 years, 1 month 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/inspector_protocol/CodeGenerator.py
diff --git a/third_party/inspector_protocol/CodeGenerator.py b/third_party/inspector_protocol/CodeGenerator.py
index 18073ddc29532e9a5afc09e942d5d91122b32a95..fd2413137892038a5ec67de3b13d3b68c310c05b 100644
--- a/third_party/inspector_protocol/CodeGenerator.py
+++ b/third_party/inspector_protocol/CodeGenerator.py
@@ -52,6 +52,7 @@ def read_config():
cmdline_parser.add_option("--output_base")
cmdline_parser.add_option("--jinja_dir")
cmdline_parser.add_option("--config")
+ cmdline_parser.add_option("--config_value", action="append", type="string")
arg_options, _ = cmdline_parser.parse_args()
jinja_dir = arg_options.jinja_dir
if not jinja_dir:
@@ -63,6 +64,9 @@ def read_config():
if not config_file:
raise Exception("Config file name must be specified")
config_base = os.path.dirname(config_file)
+ config_values = arg_options.config_value
+ if not config_values:
+ config_values = []
except Exception:
# Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
exc = sys.exc_info()[1]
@@ -90,6 +94,10 @@ def read_config():
".lib.export_macro": "",
".lib.export_header": False,
}
+ for key_value in config_values:
+ parts = key_value.split("=")
+ if len(parts) == 2:
+ defaults["." + parts[0]] = parts[1]
return (jinja_dir, config_file, init_defaults(config_partial, "", defaults))
except Exception:
# Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
@@ -287,7 +295,6 @@ def wrap_array_definition(type):
"raw_type": "protocol::Array<%s>" % type["raw_type"],
"raw_pass_type": "protocol::Array<%s>*" % type["raw_type"],
"raw_return_type": "protocol::Array<%s>*" % type["raw_type"],
- "create_type": "wrapUnique(new protocol::Array<%s>())" % type["raw_type"],
"out_type": "protocol::Array<%s>&" % type["raw_type"],
}

Powered by Google App Engine
This is Rietveld 408576698