summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 23:00:11 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 23:00:11 +0000
commitba4c78e5b07788094ec02c6a1b44eebd7a727926 (patch)
tree96cf69e6fcc2c1fc4eb3c1eda5ffc9a30cafbfcb /chrome
parente9403ab1516c5ada016249c1c124485640c2ae8f (diff)
downloadchromium_src-ba4c78e5b07788094ec02c6a1b44eebd7a727926.zip
chromium_src-ba4c78e5b07788094ec02c6a1b44eebd7a727926.tar.gz
chromium_src-ba4c78e5b07788094ec02c6a1b44eebd7a727926.tar.bz2
Use FilePath in ChildProcessHost.
BUG=24672 TEST=still compiles Review URL: http://codereview.chromium.org/270077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/plugin_process_host.cc5
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc2
-rw-r--r--chrome/browser/utility_process_host.cc4
-rw-r--r--chrome/browser/utility_process_host.h2
-rw-r--r--chrome/browser/utility_process_host_unittest.cc4
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc2
-rw-r--r--chrome/common/child_process_host.cc18
-rw-r--r--chrome/common/child_process_host.h2
8 files changed, 18 insertions, 21 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 525e640..1fe75af 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -357,10 +357,9 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
// Build command line for plugin, we have to quote the plugin's path to deal
// with spaces.
- std::wstring exe_path = GetChildPath();
- if (exe_path.empty()) {
+ FilePath exe_path = GetChildPath();
+ if (exe_path.empty())
return false;
- }
CommandLine cmd_line(exe_path);
// Put the process type and plugin path first so they're easier to see
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index b43b878..2d55eca 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -268,7 +268,7 @@ bool BrowserRenderProcessHost::Init() {
// Find the renderer before creating the channel so if this fails early we
// return without creating the channel.
- std::wstring renderer_path = ChildProcessHost::GetChildPath();
+ FilePath renderer_path = ChildProcessHost::GetChildPath();
if (renderer_path.empty())
return false;
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index 246e7ff..0e44688 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -59,7 +59,7 @@ bool UtilityProcessHost::StartUpdateManifestParse(const std::string& xml) {
return true;
}
-std::wstring UtilityProcessHost::GetUtilityProcessCmd() {
+FilePath UtilityProcessHost::GetUtilityProcessCmd() {
return GetChildPath();
}
@@ -78,7 +78,7 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
if (!CreateChannel())
return false;
- std::wstring exe_path = GetUtilityProcessCmd();
+ FilePath exe_path = GetUtilityProcessCmd();
if (exe_path.empty()) {
NOTREACHED() << "Unable to get utility process binary name.";
return false;
diff --git a/chrome/browser/utility_process_host.h b/chrome/browser/utility_process_host.h
index fa0a63c..d9e6d3f 100644
--- a/chrome/browser/utility_process_host.h
+++ b/chrome/browser/utility_process_host.h
@@ -94,7 +94,7 @@ class UtilityProcessHost : public ChildProcessHost {
protected:
// Allow these methods to be overridden for tests.
- virtual std::wstring GetUtilityProcessCmd();
+ virtual FilePath GetUtilityProcessCmd();
virtual bool UseSandbox() {
return true;
}
diff --git a/chrome/browser/utility_process_host_unittest.cc b/chrome/browser/utility_process_host_unittest.cc
index 8874719..f901a9a 100644
--- a/chrome/browser/utility_process_host_unittest.cc
+++ b/chrome/browser/utility_process_host_unittest.cc
@@ -76,12 +76,12 @@ class TestUtilityProcessHost : public UtilityProcessHost {
}
protected:
- virtual std::wstring GetUtilityProcessCmd() {
+ virtual FilePath GetUtilityProcessCmd() {
FilePath exe_path;
PathService::Get(base::DIR_EXE, &exe_path);
exe_path = exe_path.AppendASCII(WideToASCII(
chrome::kHelperProcessExecutablePath));
- return exe_path.ToWStringHack();
+ return exe_path;
}
virtual bool UseSandbox() {
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index b05df3b..094a2fd 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -90,7 +90,7 @@ bool WorkerProcessHost::Init() {
if (!CreateChannel())
return false;
- std::wstring exe_path = GetChildPath();
+ FilePath exe_path = GetChildPath();
if (exe_path.empty())
return false;
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc
index 4b7a999..6495fba 100644
--- a/chrome/common/child_process_host.cc
+++ b/chrome/common/child_process_host.cc
@@ -82,25 +82,23 @@ ChildProcessHost::~ChildProcessHost() {
}
// static
-std::wstring ChildProcessHost::GetChildPath() {
- std::wstring child_path = CommandLine::ForCurrentProcess()->GetSwitchValue(
+FilePath ChildProcessHost::GetChildPath() {
+ FilePath child_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kBrowserSubprocessPath);
if (!child_path.empty())
return child_path;
+ FilePath path;
+ PathService::Get(base::FILE_EXE, &path);
+
#if !defined(OS_MACOSX)
// On most platforms, the child executable is the same as the current
// executable.
- PathService::Get(base::FILE_EXE, &child_path);
- return child_path;
+ return path;
#else
// On the Mac, the child executable lives at a predefined location within
// the current app bundle.
- FilePath path;
- if (!PathService::Get(base::FILE_EXE, &path))
- return child_path;
-
// Figure out the current executable name. In a browser, this will be
// "Chromium" or "Google Chrome". The child name will be the browser
// executable name with " Helper" appended. The child app bundle name will
@@ -115,7 +113,7 @@ std::wstring ChildProcessHost::GetChildPath() {
if (strcmp(test_suffix, child_suffix.c_str()) == 0) {
// FILE_EXE already ends with the child suffix and therefore already
// refers to the child process path. Just return it.
- return path.ToWStringHack();
+ return path;
}
}
@@ -138,7 +136,7 @@ std::wstring ChildProcessHost::GetChildPath() {
path = path.Append(FILE_PATH_LITERAL("MacOS"));
path = path.Append(child_exe_name);
- return path.ToWStringHack();
+ return path;
#endif // OS_MACOSX
}
diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h
index eaff476..6e1725e 100644
--- a/chrome/common/child_process_host.h
+++ b/chrome/common/child_process_host.h
@@ -34,7 +34,7 @@ class ChildProcessHost : public ResourceDispatcherHost::Receiver,
// the default child process pathname will be returned. On most platforms,
// this will be the same as the currently-executing process. On failure,
// returns an empty wstring.
- static std::wstring GetChildPath();
+ static FilePath GetChildPath();
// Prepares command_line for crash reporting as appropriate. On Linux and
// Mac, a command-line flag to enable crash reporting in the child process