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

Unified Diff: chrome/installer/test/alternate_version_generator.cc

Issue 2283833002: Delete unused function GenerateSpecificPEFileVersion(). (Closed)
Patch Set: Created 4 years, 4 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/test/alternate_version_generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/test/alternate_version_generator.cc
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index f51efaf23af0b978f84fdb14549e5dfac6b64df2..a5d04042ce16f6b81a023387b337125dc8799381 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -743,33 +743,18 @@ base::string16 GenerateAlternatePEFileVersion(
return base::string16();
}
- base::Version new_version(base::UTF16ToASCII(ctx.new_version_str));
- GenerateSpecificPEFileVersion(original_file, target_file, new_version);
+ DCHECK_EQ(ctx.current_version_str.size(), ctx.new_version_str.size());
- return ctx.new_version_str;
-}
-
-bool GenerateSpecificPEFileVersion(const base::FilePath& original_file,
- const base::FilePath& target_file,
- const base::Version& version) {
- // First copy original_file to target_file.
if (!base::CopyFile(original_file, target_file)) {
LOG(DFATAL) << "Failed copying \"" << original_file.value()
<< "\" to \"" << target_file.value() << "\"";
- return false;
+ return base::string16();
}
- VisitResourceContext ctx;
- if (!GetFileVersion(target_file, &ctx.current_version)) {
- LOG(DFATAL) << "Failed reading version from \"" << target_file.value()
- << "\"";
- return false;
- }
- ctx.current_version_str = ctx.current_version.ToString();
- ctx.new_version = ChromeVersion::FromString(version.GetString());
- ctx.new_version_str = ctx.new_version.ToString();
+ if (!UpdateVersionIfMatch(target_file, &ctx))
+ return base::string16();
- return UpdateVersionIfMatch(target_file, &ctx);
+ return ctx.new_version_str;
}
} // namespace upgrade_test
« no previous file with comments | « chrome/installer/test/alternate_version_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698