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

Unified Diff: mojo/devtools/common/devtoolslib/shell_config.py

Issue 1419333005: Add `mojo_run --free-ports` to run servers on system-allocated ports. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address Ben's comments. Created 5 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
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_arguments.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/shell_config.py
diff --git a/mojo/devtools/common/devtoolslib/shell_config.py b/mojo/devtools/common/devtoolslib/shell_config.py
index b3faa05ba773e99d7b6fa16aa267d77632c40a3c..79a14c2ed72453ada6fb5a53e5d665976bebd289 100644
--- a/mojo/devtools/common/devtoolslib/shell_config.py
+++ b/mojo/devtools/common/devtoolslib/shell_config.py
@@ -29,6 +29,7 @@ class ShellConfig(object):
self.map_url_list = []
self.map_origin_list = []
self.dev_servers = []
+ self.free_ports = False
self.content_handlers = dict()
self.verbose = None
@@ -69,6 +70,10 @@ def add_shell_arguments(parser):
parser.add_argument('--map-origin', action='append',
help='Define a mapping for a url origin in the format '
'<origin>=<url-or-local-file-path>')
+ parser.add_argument('--free-ports', action='store_true',
+ help='Use system-allocated ports when spawning local '
+ 'servers. This defeats caching and thus hurts '
+ 'performance.')
parser.add_argument('-v', '--verbose', action="store_true",
help="Increase output verbosity")
@@ -80,7 +85,9 @@ def add_shell_arguments(parser):
'additional logcat tags to display.')
android_group.add_argument('--free-host-ports', action='store_true',
help='Use system-allocated ports on the host when '
- 'spawning local servers.')
+ 'spawning local servers. This still forwards to '
+ 'fixed ports on the device, so that caching '
+ 'works.')
desktop_group = parser.add_argument_group('Desktop-only',
'These arguments apply only when running on desktop.')
@@ -153,6 +160,7 @@ def get_shell_config(script_args):
shell_config.origin = script_args.origin
shell_config.map_url_list = script_args.map_url
shell_config.map_origin_list = script_args.map_origin
+ shell_config.free_ports = script_args.free_ports
shell_config.verbose = script_args.verbose
# Android-only.
« no previous file with comments | « mojo/devtools/common/devtoolslib/shell_arguments.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698