Commit 774d3860 authored by cmasone's avatar cmasone Committed by Commit bot

Allow passing listening socket path on command line

When enabling externally-running applications, allow the
user to specify a path for the listening socket. This makes
development easier while still allowing for a default
to be used in production.

BUG=None
TEST=run mojo_shell with --enable-external-applications=path/to/socket, without the flag, and with the flag but passing no value.

Review URL: https://codereview.chromium.org/599733007

Cr-Commit-Position: refs/heads/master@{#297247}
parent 37f21b8e
...@@ -185,8 +185,14 @@ void Context::Init() { ...@@ -185,8 +185,14 @@ void Context::Init() {
if (command_line->HasSwitch(switches::kEnableExternalApplications)) { if (command_line->HasSwitch(switches::kEnableExternalApplications)) {
listener_ = ExternalApplicationListener::Create( listener_ = ExternalApplicationListener::Create(
task_runners_->shell_runner(), task_runners_->io_runner()); task_runners_->shell_runner(), task_runners_->io_runner());
base::FilePath socket_path =
command_line->GetSwitchValuePath(switches::kEnableExternalApplications);
if (socket_path.empty())
socket_path = ExternalApplicationListener::ConstructDefaultSocketPath();
listener_->ListenInBackground( listener_->ListenInBackground(
ExternalApplicationListener::ConstructDefaultSocketPath(), socket_path,
base::Bind(&ApplicationManager::RegisterExternalApplication, base::Bind(&ApplicationManager::RegisterExternalApplication,
base::Unretained(&application_manager_))); base::Unretained(&application_manager_)));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment