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

Unified Diff: mojo/runner/child_process_host.cc

Issue 1419293003: Allow mojo_runner to connect to arbitrary executables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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
Index: mojo/runner/child_process_host.cc
diff --git a/mojo/runner/child_process_host.cc b/mojo/runner/child_process_host.cc
index d6f0c3d2bdcc7fe1d287d98d1ff4740a25f49bbb..3e60686c4f4899e4c5b68be8ac4598c716018b0c 100644
--- a/mojo/runner/child_process_host.cc
+++ b/mojo/runner/child_process_host.cc
@@ -103,9 +103,15 @@ void ChildProcessHost::DidStart() {
void ChildProcessHost::DoLaunch() {
const base::CommandLine* parent_command_line =
base::CommandLine::ForCurrentProcess();
- base::CommandLine child_command_line(parent_command_line->GetProgram());
+ base::FilePath target_path = parent_command_line->GetProgram();
+ if (!app_path_.MatchesExtension(FILE_PATH_LITERAL(".mojo")))
+ target_path = app_path_;
+
+ base::CommandLine child_command_line(target_path);
child_command_line.AppendArguments(*parent_command_line, false);
- child_command_line.AppendSwitchPath(switches::kChildProcess, app_path_);
+
+ if (target_path != app_path_)
+ child_command_line.AppendSwitchPath(switches::kChildProcess, app_path_);
if (start_sandboxed_)
child_command_line.AppendSwitch(switches::kEnableSandbox);

Powered by Google App Engine
This is Rietveld 408576698