summaryrefslogtreecommitdiffstats
path: root/chrome/common/child_process_host.cc
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 22:52:49 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 22:52:49 +0000
commitb9148774aa3ad1d550a2835d5441febc97a4770e (patch)
treed728e96702a6ec4f1ea4d39942d7579038e57996 /chrome/common/child_process_host.cc
parent42d7c0218dc58679cebee0a2cd18dcb00a85dfbc (diff)
downloadchromium_src-b9148774aa3ad1d550a2835d5441febc97a4770e.zip
chromium_src-b9148774aa3ad1d550a2835d5441febc97a4770e.tar.gz
chromium_src-b9148774aa3ad1d550a2835d5441febc97a4770e.tar.bz2
Linux: make --renderer-cmd-prefix work after r32486
http://codereview.chromium.org/418028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process_host.cc')
-rw-r--r--chrome/common/child_process_host.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc
index 2e0f1f6..ca586d7 100644
--- a/chrome/common/child_process_host.cc
+++ b/chrome/common/child_process_host.cc
@@ -93,21 +93,25 @@ FilePath ChildProcessHost::GetChildPath() {
if (!child_path.empty())
return child_path;
-#if defined(OS_LINUX)
- // Use /proc/self/exe rather than our known binary path so updates
- // can't swap out the binary from underneath us.
- child_path = FilePath("/proc/self/exe");
-#elif defined(OS_MACOSX)
+#if defined(OS_MACOSX)
// On the Mac, the child executable lives at a predefined location within
// the app bundle's versioned directory.
- child_path = chrome::GetVersionedDirectory().
+ return chrome::GetVersionedDirectory().
Append(chrome::kHelperProcessExecutablePath);
-#else
+#endif
+
+#if defined(OS_LINUX)
+ // Use /proc/self/exe rather than our known binary path so updates
+ // can't swap out the binary from underneath us.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kRendererCmdPrefix)) {
+ return FilePath("/proc/self/exe");
+ }
+#endif
+
// On most platforms, the child executable is the same as the current
// executable.
PathService::Get(base::FILE_EXE, &child_path);
-#endif
-
return child_path;
}