diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:51:02 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:51:02 +0000 |
commit | 961306dca553f6e7b5262e384317a73351a77985 (patch) | |
tree | dbba7e1e9d1774eaf03c5254bbeb71a42c914fda /chrome/common/child_process_host.cc | |
parent | d04d10a3b93b428d5e4fe636be4ab6ffd94424d9 (diff) | |
download | chromium_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/common/child_process_host.cc')
-rw-r--r-- | chrome/common/child_process_host.cc | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc index ca0f972..b7cab7f 100644 --- a/chrome/common/child_process_host.cc +++ b/chrome/common/child_process_host.cc @@ -4,17 +4,13 @@ #include "chrome/common/child_process_host.h" -#include "base/command_line.h" #include "base/compiler_specific.h" -#include "base/file_path.h" #include "base/logging.h" #include "base/message_loop.h" -#include "base/path_service.h" #include "base/process_util.h" #include "base/singleton.h" #include "base/waitable_event.h" #include "chrome/browser/chrome_thread.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "chrome/common/plugin_messages.h" @@ -69,67 +65,6 @@ ChildProcessHost::~ChildProcessHost() { ProcessWatcher::EnsureProcessTerminated(handle()); } -// static -std::wstring ChildProcessHost::GetChildPath() { - std::wstring child_path = CommandLine::ForCurrentProcess()->GetSwitchValue( - switches::kBrowserSubprocessPath); - if (!child_path.empty()) - return child_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; -#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 - // be that name with ".app" appended. - FilePath::StringType child_exe_name = path.BaseName().value(); - const FilePath::StringType child_suffix = FILE_PATH_LITERAL(" Helper"); - - if (child_exe_name.size() > child_suffix.size()) { - size_t test_suffix_pos = child_exe_name.size() - child_suffix.size(); - const FilePath::CharType* test_suffix = - child_exe_name.c_str() + test_suffix_pos; - 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(); - } - } - - child_exe_name.append(child_suffix); - FilePath::StringType child_app_name = child_exe_name; - child_app_name.append(FILE_PATH_LITERAL(".app")); - // The renderer app bundle lives in the browser app bundle's Resources - // directory. Take off the executable name. - path = path.DirName(); - - // Take off the MacOS component, after verifying that's what's there. - FilePath::StringType macos = path.BaseName().value(); - DCHECK_EQ(macos, FILE_PATH_LITERAL("MacOS")); - path = path.DirName(); - - // Append the components to get to the sub-app bundle's executable. - path = path.Append(FILE_PATH_LITERAL("Resources")); - path = path.Append(child_app_name); - path = path.Append(FILE_PATH_LITERAL("Contents")); - path = path.Append(FILE_PATH_LITERAL("MacOS")); - path = path.Append(child_exe_name); - - return path.ToWStringHack(); -#endif // OS_MACOSX -} - bool ChildProcessHost::CreateChannel() { channel_id_ = GenerateRandomChannelID(this); channel_.reset(new IPC::Channel( |