From 45691556e466004e5172adbf9481addcacc43142 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 10 Jun 2013 18:48:09 +0000 Subject: [PATCH] Linux: Force use of the sub-process executable path for the zygote process (issue #980). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1278 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/content_browser_client.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index afec4101e..a337339ff 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -450,7 +450,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( arraysize(kSwitchNames)); } - std::string process_type = + const std::string& process_type = command_line->GetSwitchValueASCII(switches::kProcessType); if (process_type == switches::kRendererProcess) { // Propagate the following switches to the renderer command line (along with @@ -466,6 +466,17 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( arraysize(kSwitchNames)); } +#if defined(OS_LINUX) + if (process_type == switches::kZygoteProcess && + command_line->HasSwitch(switches::kBrowserSubprocessPath)) { + // Force use of the sub-process executable path for the zygote process. + const base::FilePath& subprocess_path = + command_line->GetSwitchValuePath(switches::kBrowserSubprocessPath); + if (!subprocess_path.empty()) + command_line->SetProgram(subprocess_path); + } +#endif // defined(OS_LINUX) + CefRefPtr app = _Context->application(); if (app.get()) { CefRefPtr handler =