| Index: chrome/app/main_dll_loader_win.cc
|
| diff --git a/chrome/app/client_util.cc b/chrome/app/main_dll_loader_win.cc
|
| similarity index 90%
|
| copy from chrome/app/client_util.cc
|
| copy to chrome/app/main_dll_loader_win.cc
|
| index e12bec90705f0709ffe3f356cf062de17604a765..5f29dfb029ef18ca8386f6843d1d41326d2d2b4d 100644
|
| --- a/chrome/app/client_util.cc
|
| +++ b/chrome/app/main_dll_loader_win.cc
|
| @@ -5,12 +5,13 @@
|
| #include <windows.h>
|
| #include <shlwapi.h>
|
|
|
| +#include "chrome/app/main_dll_loader_win.h"
|
| +
|
| #include "base/base_paths.h"
|
| #include "base/base_switches.h"
|
| #include "base/command_line.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/environment.h"
|
| -#include "base/file_version_info.h"
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| @@ -20,7 +21,6 @@
|
| #include "base/strings/stringprintf.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/trace_event/trace_event.h"
|
| -#include "base/version.h"
|
| #include "base/win/scoped_handle.h"
|
| #include "base/win/windows_version.h"
|
| #include "chrome/app/chrome_crash_reporter_client.h"
|
| @@ -89,30 +89,12 @@ bool InMetroMode() {
|
|
|
| typedef int (*InitMetro)();
|
|
|
| -// Returns the directory in which the currently running executable resides.
|
| -base::FilePath GetExecutableDir() {
|
| - base::char16 path[MAX_PATH];
|
| - ::GetModuleFileNameW(nullptr, path, MAX_PATH);
|
| - return base::FilePath(path).DirName();
|
| -}
|
| -
|
| } // namespace
|
|
|
| -base::string16 GetCurrentModuleVersion() {
|
| - scoped_ptr<FileVersionInfo> file_version_info(
|
| - CREATE_FILE_VERSION_INFO_FOR_CURRENT_MODULE());
|
| - if (file_version_info.get()) {
|
| - base::string16 version_string(file_version_info->file_version());
|
| - if (Version(base::UTF16ToASCII(version_string)).IsValid())
|
| - return version_string;
|
| - }
|
| - return base::string16();
|
| -}
|
| -
|
| //=============================================================================
|
|
|
| MainDllLoader::MainDllLoader()
|
| - : dll_(nullptr), metro_mode_(InMetroMode()) {
|
| + : dll_(nullptr), metro_mode_(InMetroMode()) {
|
| }
|
|
|
| MainDllLoader::~MainDllLoader() {
|
| @@ -140,23 +122,16 @@ HMODULE MainDllLoader::Load(base::string16* version, base::FilePath* module) {
|
| #endif
|
| }
|
|
|
| + *module = GetModulePath(dll_name, version);
|
| + if (module->empty()) {
|
| + PLOG(ERROR) << "Cannot find module " << dll_name;
|
| + return nullptr;
|
| + }
|
| const bool pre_read = !metro_mode_;
|
| - base::FilePath module_dir = GetExecutableDir();
|
| - *module = module_dir.Append(dll_name);
|
| HMODULE dll = LoadModuleWithDirectory(*module, pre_read);
|
| if (!dll) {
|
| - base::string16 version_string(GetCurrentModuleVersion());
|
| - if (version_string.empty()) {
|
| - LOG(ERROR) << "No valid Chrome version found";
|
| - return nullptr;
|
| - }
|
| - *version = version_string;
|
| - *module = module_dir.Append(version_string).Append(dll_name);
|
| - dll = LoadModuleWithDirectory(*module, pre_read);
|
| - if (!dll) {
|
| - PLOG(ERROR) << "Failed to load Chrome DLL from " << module->value();
|
| - return nullptr;
|
| - }
|
| + PLOG(ERROR) << "Failed to load Chrome DLL from " << module->value();
|
| + return nullptr;
|
| }
|
|
|
| DCHECK(dll);
|
|
|