Chromium Code Reviews| Index: chrome/installer/util/module_util_win.cc |
| diff --git a/chrome/installer/util/module_util_win.cc b/chrome/installer/util/module_util_win.cc |
| index 2ed551319da19b086ece7e40c443b95e5da2d37e..7c8bb7def9d18aae4562bbe2ac0db3173df8b18f 100644 |
| --- a/chrome/installer/util/module_util_win.cc |
| +++ b/chrome/installer/util/module_util_win.cc |
| @@ -4,35 +4,19 @@ |
| #include "chrome/installer/util/module_util_win.h" |
| -#include <memory> |
| - |
| #include "base/base_paths.h" |
| -#include "base/file_version_info.h" |
| #include "base/files/file.h" |
| #include "base/logging.h" |
| #include "base/path_service.h" |
| -#include "base/strings/string16.h" |
| -#include "base/strings/utf_string_conversions.h" |
| -#include "base/version.h" |
| -#include "base/win/current_module.h" |
| +#include "chrome/common/chrome_constants.h" |
| namespace installer { |
| namespace { |
| -// Returns the version in the current executable's version resource. |
| -base::string16 GetCurrentExecutableVersion() { |
| - std::unique_ptr<FileVersionInfo> file_version_info( |
| - FileVersionInfo::CreateFileVersionInfoForModule(CURRENT_MODULE())); |
| - DCHECK(file_version_info.get()); |
| - base::string16 version_string(file_version_info->file_version()); |
| - DCHECK(base::Version(base::UTF16ToASCII(version_string)).IsValid()); |
| - return version_string; |
| -} |
| - |
| // Indicates whether a file can be opened using the same flags that |
| // ::LoadLibrary() uses to open modules. |
| -bool ModuleCanBeRead(const base::FilePath file_path) { |
| +bool ModuleCanBeRead(const base::FilePath& file_path) { |
| return base::File(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ) |
| .IsValid(); |
| } |
| @@ -54,9 +38,7 @@ base::FilePath GetModulePath(base::StringPiece16 module_name) { |
| // Othwerwise, return the path to the module in a versioned sub-directory of |
| // the current executable's directory. This is the expected location of |
|
grt (UTC plus 2)
2017/01/24 09:37:16
"current executable" makes this a bit tricky. look
fdoray
2017/01/31 20:47:17
Done.
|
| // modules for proper installs. |
| - const base::string16 version = GetCurrentExecutableVersion(); |
| - DCHECK(!version.empty()); |
| - return exe_dir.Append(version).Append(module_name); |
| + return exe_dir.AppendASCII(chrome::kChromeVersion).Append(module_name); |
| } |
| } // namespace installer |