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

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

Issue 8517012: Add support for --critical-update-version to installer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last tweaks Created 9 years, 1 month 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/installer_state.h ('k') | chrome/installer/util/installer_state_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/installer_state.cc
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index bc365de421198549c97fb728c00bc7fdd9ce6f30..5e88ad50d1af57df8ab9aca165ae7f5d456ad6c1 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -156,6 +156,11 @@ void InstallerState::Initialize(const CommandLine& command_line,
state_key_ = operand->GetStateKey();
state_type_ = operand->GetType();
+
+ // Parse --critical-update-version=W.X.Y.Z
+ std::string critical_version_value(
+ command_line.GetSwitchValueASCII(switches::kCriticalUpdateVersion));
+ critical_update_version_ = Version(critical_version_value);
}
void InstallerState::set_level(Level level) {
@@ -413,6 +418,20 @@ Version* InstallerState::GetCurrentVersion(
return current_version.release();
}
+Version InstallerState::DetermineCriticalVersion(
+ const Version* current_version,
+ const Version& new_version) const {
+ DCHECK(current_version == NULL || current_version->IsValid());
+ DCHECK(new_version.IsValid());
+ if (critical_update_version_.IsValid() &&
+ (current_version == NULL ||
+ (current_version->CompareTo(critical_update_version_) < 0)) &&
+ new_version.CompareTo(critical_update_version_) >= 0) {
+ return critical_update_version_;
+ }
+ return Version();
+}
+
bool InstallerState::IsChromeFrameRunning(
const InstallationState& machine_state) const {
// We check only for the current version (e.g. the version we are upgrading
« no previous file with comments | « chrome/installer/util/installer_state.h ('k') | chrome/installer/util/installer_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698