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

Unified Diff: mojo/shell/child_process_host.cc

Issue 1107633002: Improve multi-process debugging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 8 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
« no previous file with comments | « mojo/shell/child_process_host.h ('k') | mojo/shell/child_process_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/child_process_host.cc
diff --git a/mojo/shell/child_process_host.cc b/mojo/shell/child_process_host.cc
index 9d955e22e0556d2cc5877b7efec0d399a0cb7387..97c940bace04f0f36d66dc64b64ee2838b65b2f6 100644
--- a/mojo/shell/child_process_host.cc
+++ b/mojo/shell/child_process_host.cc
@@ -13,6 +13,8 @@
#include "base/message_loop/message_loop.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
+#include "base/stl_util.h"
+#include "base/strings/string_split.h"
#include "base/task_runner.h"
#include "base/task_runner_util.h"
#include "mojo/edk/embedder/embedder.h"
@@ -24,9 +26,10 @@
namespace mojo {
namespace shell {
-ChildProcessHost::ChildProcessHost(Context* context)
- : context_(context), channel_info_(nullptr) {
+ChildProcessHost::ChildProcessHost(Context* context, const std::string& name)
+ : context_(context), name_(name), channel_info_(nullptr) {
platform_channel_ = platform_channel_pair_.PassServerHandle();
+ DCHECK(!name.empty());
CHECK(platform_channel_.is_valid());
}
@@ -102,7 +105,16 @@ bool ChildProcessHost::DoLaunch() {
base::CommandLine child_command_line(parent_command_line->GetProgram());
child_command_line.CopySwitchesFrom(*parent_command_line, kForwardSwitches,
arraysize(kForwardSwitches));
+ child_command_line.AppendSwitchASCII(switches::kApp, name_);
child_command_line.AppendSwitch(switches::kChildProcess);
+ if (parent_command_line->HasSwitch(switches::kWaitForDebugger)) {
+ std::vector<std::string> apps_to_debug;
+ base::SplitString(
+ parent_command_line->GetSwitchValueASCII(switches::kWaitForDebugger),
+ ',', &apps_to_debug);
+ if (apps_to_debug.empty() || ContainsValue(apps_to_debug, name_))
+ child_command_line.AppendSwitch(switches::kWaitForDebugger);
+ }
embedder::HandlePassingInformation handle_passing_info;
platform_channel_pair_.PrepareToPassClientHandleToChildProcess(
« no previous file with comments | « mojo/shell/child_process_host.h ('k') | mojo/shell/child_process_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698