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

Unified Diff: omaha_response_handler_action.cc

Issue 3541016: AU: Optimize checkpointing a bit and decide on new update vs. resume. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: fix copyrights Created 10 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 | « install_plan.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_response_handler_action.cc
diff --git a/omaha_response_handler_action.cc b/omaha_response_handler_action.cc
index cdcf73544391e5ed3d70179cb844df2cc6b88f5f..d3142a7eaf8759494ca601c119315d20367287f4 100644
--- a/omaha_response_handler_action.cc
+++ b/omaha_response_handler_action.cc
@@ -8,6 +8,7 @@
#include <base/logging.h>
+#include "update_engine/delta_performer.h"
#include "update_engine/prefs_interface.h"
#include "update_engine/utils.h"
@@ -27,12 +28,17 @@ void OmahaResponseHandlerAction::PerformAction() {
install_plan_.download_url = response.codebase;
install_plan_.size = response.size;
install_plan_.download_hash = response.hash;
- // TODO(petkov): Decide here if this is going to be a regular update or
- // resume-after-boot. This should also set the number of ops performed so far
- // to invalid if no need to resume.
- LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash,
- response.hash))
- << "Unable to save the update check response hash.";
+
+ install_plan_.is_resume =
+ DeltaPerformer::CanResumeUpdate(prefs_, response.hash);
+ if (!install_plan_.is_resume) {
+ LOG_IF(WARNING, !DeltaPerformer::ResetUpdateProgress(prefs_))
+ << "Unable to reset the update progress.";
+ LOG_IF(WARNING, !prefs_->SetString(kPrefsUpdateCheckResponseHash,
+ response.hash))
+ << "Unable to save the update check response hash.";
+ }
+
TEST_AND_RETURN(GetInstallDev(
(!boot_device_.empty() ? boot_device_ : utils::BootDevice()),
&install_plan_.install_path));
« no previous file with comments | « install_plan.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698