Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3954)

Unified Diff: chrome/installer/util/install_util.cc

Issue 2456853002: Remove shortcut path fixups introduced to repair breakages caused by r378802. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util.cc
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index ed9b8adc52fc4954c79de7238b9b92626cb515a9..25f96f0c987c8db7fde04ad1e866b216180a6656 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -530,14 +530,11 @@ base::string16 InstallUtil::GetCurrentDate() {
// Open |path| with minimal access to obtain information about it, returning
// true and populating |file| on success.
+// static
bool InstallUtil::ProgramCompare::OpenForInfo(const base::FilePath& path,
- base::File* file,
- ComparisonType comparison_type) {
+ base::File* file) {
DCHECK(file);
- uint32_t flags = base::File::FLAG_OPEN;
- if (comparison_type == ComparisonType::FILE_OR_DIRECTORY)
- flags |= base::File::FLAG_BACKUP_SEMANTICS;
- file->Initialize(path, flags);
+ file->Initialize(path, base::File::FLAG_OPEN);
return file->IsValid();
}
@@ -591,15 +588,10 @@ void InstallUtil::AddUpdateDowngradeVersionItem(
}
InstallUtil::ProgramCompare::ProgramCompare(const base::FilePath& path_to_match)
- : ProgramCompare(path_to_match, ComparisonType::FILE) {}
-
-InstallUtil::ProgramCompare::ProgramCompare(const base::FilePath& path_to_match,
- ComparisonType comparison_type)
: path_to_match_(path_to_match),
- file_info_(),
- comparison_type_(comparison_type) {
+ file_info_() {
DCHECK(!path_to_match_.empty());
- if (!OpenForInfo(path_to_match_, &file_, comparison_type_)) {
+ if (!OpenForInfo(path_to_match_, &file_)) {
PLOG(WARNING) << "Failed opening " << path_to_match_.value()
<< "; falling back to path string comparisons.";
} else if (!GetInfo(file_, &file_info_)) {
@@ -643,7 +635,8 @@ bool InstallUtil::ProgramCompare::EvaluatePath(
base::File file;
BY_HANDLE_FILE_INFORMATION info = {};
- return (OpenForInfo(path, &file, comparison_type_) && GetInfo(file, &info) &&
+ return (OpenForInfo(path, &file) &&
+ GetInfo(file, &info) &&
info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
info.nFileIndexHigh == file_info_.nFileIndexHigh &&
info.nFileIndexLow == file_info_.nFileIndexLow);
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/install_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698