summaryrefslogtreecommitdiffstats
path: root/chrome/app/client_util.cc
diff options
context:
space:
mode:
authorgregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:10:10 +0000
committergregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:10:10 +0000
commit08aab35037965c2d7d71263b453fda74fa48b378 (patch)
tree45eabab475f9137125bc74a45062a78d9e7f0cc5 /chrome/app/client_util.cc
parent7946a0ca0347117c1f8870eb441f31ba185fc5ab (diff)
downloadchromium_src-08aab35037965c2d7d71263b453fda74fa48b378.zip
chromium_src-08aab35037965c2d7d71263b453fda74fa48b378.tar.gz
chromium_src-08aab35037965c2d7d71263b453fda74fa48b378.tar.bz2
Implement the broker process that launches NaCl loader processes on 64-bit Windows systems.
BUG=28176 TEST=none Review URL: http://codereview.chromium.org/542030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/client_util.cc')
-rw-r--r--chrome/app/client_util.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index 993f468..a4bc50b 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -7,6 +7,7 @@
#include "chrome/app/breakpad_win.h"
#include "chrome/app/client_util.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/result_codes.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/install_util.h"
@@ -83,7 +84,22 @@ bool EnvQueryStr(const wchar_t* key_name, std::wstring* value) {
// value not being null to dermine if this path contains a valid dll.
HMODULE LoadChromeWithDirectory(std::wstring* dir) {
::SetCurrentDirectoryW(dir->c_str());
+#ifdef _WIN64
+ const CommandLine& cmd_line = *CommandLine::ForCurrentProcess();
+ if ((cmd_line.GetSwitchValueASCII(switches::kProcessType) ==
+ switches::kNaClBrokerProcess) ||
+ (cmd_line.GetSwitchValueASCII(switches::kProcessType) ==
+ switches::kNaClLoaderProcess)) {
+ // Load the 64-bit DLL when running in a 64-bit process.
+ dir->append(installer_util::kChromeNaCl64Dll);
+ } else {
+ // Only NaCl broker and loader can be launched as Win64 processes.
+ NOTREACHED();
+ return NULL;
+ }
+#else
dir->append(installer_util::kChromeDll);
+#endif
return ::LoadLibraryExW(dir->c_str(), NULL,
LOAD_WITH_ALTERED_SEARCH_PATH);
}