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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 21190: POSIX: add command line option to launch renderers in a wrapper (Closed)
Patch Set: ... Created 11 years, 10 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 | « base/command_line.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/browser_render_process_host.cc
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 33ef770a316b18a68ccd80762e3c8a71c6a80fa6..3e3081a1aa64f9ec75d261c9b6a64c5afac30419 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -284,6 +284,13 @@ bool BrowserRenderProcessHost::Init() {
DebugFlags::ProcessDebugFlags(&cmd_line,
DebugFlags::RENDERER,
in_sandbox);
+#elif defined(OS_POSIX)
+ if (browser_command_line.HasSwitch(switches::kRendererCmdPrefix)) {
+ // launch the renderer child with some prefix (usually "gdb --args")
+ const std::wstring prefix =
+ browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix);
+ cmd_line.PrependWrapper(prefix);
+ }
#endif
cmd_line.AppendSwitchWithValue(switches::kProcessType,
@@ -644,7 +651,15 @@ void BrowserRenderProcessHost::OnChannelConnected(int32 peer_pid) {
} else {
// Need to verify that the peer_pid is actually the process we know, if
// it is not, we need to panic now. See bug 1002150.
- CHECK(peer_pid == process_.pid());
+ if (peer_pid != process_.pid()) {
+ // In the case that we are running the renderer in a wrapper, this check
+ // is invalid as it's the wrapper PID that we'll have, not the actual
+ // renderer
+ const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+ if (cmd_line.HasSwitch(switches::kRendererCmdPrefix))
+ return;
+ CHECK(peer_pid == process_.pid());
+ }
}
}
« no previous file with comments | « base/command_line.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698