Chromium Code Reviews| Index: chrome/browser/nacl_host/nacl_process_host.cc |
| diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc |
| index 037006ddd7efbe9cd6937a7f66563e14bfe160e7..d809e53d495d02598b9112fb2f6292e73ef97a30 100644 |
| --- a/chrome/browser/nacl_host/nacl_process_host.cc |
| +++ b/chrome/browser/nacl_host/nacl_process_host.cc |
| @@ -26,7 +26,6 @@ |
| #include "chrome/browser/nacl_host/nacl_browser.h" |
| #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
| #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h" |
| -#include "chrome/common/chrome_constants.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_process_type.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -548,12 +547,9 @@ bool NaClProcessHost::LaunchSelLdr() { |
| #if defined(OS_WIN) |
| // On Windows 64-bit NaCl loader is called nacl64.exe instead of chrome.exe |
| if (RunningOnWOW64()) { |
| - base::FilePath module_path; |
| - if (!PathService::Get(base::FILE_MODULE, &module_path)) { |
| - LOG(ERROR) << "NaCl process launch failed: could not resolve module"; |
| + if (!GetNaclAppPath(exe_path)) { |
| return false; |
| } |
| - exe_path = module_path.DirName().Append(chrome::kNaClAppName); |
| } |
| #endif |
| @@ -1074,4 +1070,17 @@ bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info, |
| return true; |
| } |
| } |
| + |
| +bool NaClProcessHost::GetNaclAppPath(base::FilePath& exe_path) |
| +{ |
|
Mark Seaborn
2013/05/31 19:42:30
Style is that '{' goes on previous line
|
| + static const wchar_t kNaClAppName[] = L"nacl64"; |
|
dmichael (off chromium)
2013/05/31 19:42:18
nit: static doesn't really add anything here.
Lei Zhang
2013/05/31 19:45:48
Is this Windows-only code? If not, then it won't w
Mark Seaborn
2013/05/31 19:51:13
Yes, this is Windows-only. It's inside "#if defin
|
| + base::FilePath module_path; |
| + if (!PathService::Get(base::FILE_MODULE, &module_path)) { |
| + LOG(ERROR) << "NaCl process launch failed: could not resolve module"; |
|
dmichael (off chromium)
2013/05/31 19:42:18
FWIW, this log used to only be emitted from this f
|
| + return false; |
| + } |
| + exe_path = module_path.DirName().Append(kNaClAppName); |
|
dmichael (off chromium)
2013/05/31 19:42:18
optional nit: Seems like you could just stick the
|
| + return true; |
| +} |
| + |
|
Mark Seaborn
2013/05/31 19:51:13
Nit: make the whitespace after "#if" and before "#
Mark Seaborn
2013/05/31 19:51:13
Nit: make the whitespace after "#if" and before "#
|
| #endif |