summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 00:51:02 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-11 00:51:02 +0000
commit961306dca553f6e7b5262e384317a73351a77985 (patch)
treedbba7e1e9d1774eaf03c5254bbeb71a42c914fda /chrome/browser
parentd04d10a3b93b428d5e4fe636be4ab6ffd94424d9 (diff)
downloadchromium_src-961306dca553f6e7b5262e384317a73351a77985.zip
chromium_src-961306dca553f6e7b5262e384317a73351a77985.tar.gz
chromium_src-961306dca553f6e7b5262e384317a73351a77985.tar.bz2
Back out r22981, it may have caused Windows test failures.
Review URL: http://codereview.chromium.org/164298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22992 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/plugin_process_host.cc9
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc24
-rw-r--r--chrome/browser/utility_process_host.cc7
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc4
4 files changed, 30 insertions, 14 deletions
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 9a81b94..3c5f169 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -335,10 +335,11 @@ 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()) {
+ const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+ std::wstring exe_path =
+ browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath);
+ if (exe_path.empty() && !PathService::Get(base::FILE_EXE, &exe_path))
return false;
- }
CommandLine cmd_line(exe_path);
if (logging::DialogsAreSuppressed())
@@ -367,8 +368,6 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
switches::kEnableStatsTable,
};
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
-
for (size_t i = 0; i < arraysize(switch_names); ++i) {
if (browser_command_line.HasSwitch(switch_names[i])) {
cmd_line.AppendSwitchWithValue(
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 07b7c7e..0fc5e05 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -47,7 +47,6 @@
#include "chrome/browser/visitedlink_master.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/child_process_info.h"
-#include "chrome/common/child_process_host.h"
#include "chrome/common/chrome_descriptors.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/notification_service.h"
@@ -202,6 +201,16 @@ class VisitedLinkUpdater {
VisitedLinkCommon::Fingerprints pending_;
};
+
+// Used for a View_ID where the renderer has not been attached yet
+const int32 kInvalidViewID = -1;
+
+// Get the path to the renderer executable, which is the same as the
+// current executable.
+bool GetRendererPath(std::wstring* cmd_line) {
+ return PathService::Get(base::FILE_EXE, cmd_line);
+}
+
BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile)
: RenderProcessHost(profile),
visible_widgets_(0),
@@ -298,12 +307,15 @@ bool BrowserRenderProcessHost::Init() {
// Build command line for renderer, we have to quote the executable name to
// deal with spaces.
- std::wstring renderer_path = ChildProcessHost::GetChildPath();
+ std::wstring renderer_path =
+ browser_command_line.GetSwitchValue(switches::kBrowserSubprocessPath);
if (renderer_path.empty()) {
- // Need to reset the channel we created above or others might think the
- // connection is live.
- channel_.reset();
- return false;
+ if (!GetRendererPath(&renderer_path)) {
+ // Need to reset the channel we created above or others might think the
+ // connection is live.
+ channel_.reset();
+ return false;
+ }
}
CommandLine cmd_line(renderer_path);
if (logging::DialogsAreSuppressed())
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index c06749d..149d296 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -52,7 +52,12 @@ bool UtilityProcessHost::StartWebResourceUnpacker(const std::string& data) {
}
std::wstring UtilityProcessHost::GetUtilityProcessCmd() {
- return GetChildPath();
+ std::wstring exe_path = CommandLine::ForCurrentProcess()->GetSwitchValue(
+ switches::kBrowserSubprocessPath);
+ if (exe_path.empty()) {
+ PathService::Get(base::FILE_EXE, &exe_path);
+ }
+ return exe_path;
}
bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 16cbada..e1e7829 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -88,8 +88,8 @@ bool WorkerProcessHost::Init() {
if (!CreateChannel())
return false;
- std::wstring exe_path = GetChildPath();
- if (exe_path.empty())
+ std::wstring exe_path;
+ if (!PathService::Get(base::FILE_EXE, &exe_path))
return false;
CommandLine cmd_line(exe_path);