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

Unified Diff: update_attempter.h

Issue 3617002: AU: Fall back to full updates after a number of failed delta update attempts. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: remove leftover log Created 10 years, 3 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 | « prefs_interface.h ('k') | update_attempter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.h
diff --git a/update_attempter.h b/update_attempter.h
index 5df6af930a4f3fe4edba2ace4e0ba2f1c2c177b4..05f3dcb31b257b94d66411a514aafaff5db6a406 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -45,6 +45,8 @@ const char* UpdateStatusToString(UpdateStatus status);
class UpdateAttempter : public ActionProcessorDelegate,
public DownloadActionDelegate {
public:
+ static const int kMaxDeltaUpdateFailures;
+
UpdateAttempter(PrefsInterface* prefs, MetricsLibraryInterface* metrics_lib);
virtual ~UpdateAttempter();
@@ -106,6 +108,8 @@ class UpdateAttempter : public ActionProcessorDelegate,
private:
friend class UpdateAttempterTest;
+ FRIEND_TEST(UpdateAttempterTest, DisableDeltaUpdateIfNeededTest);
+ FRIEND_TEST(UpdateAttempterTest, MarkDeltaUpdateFailureTest);
FRIEND_TEST(UpdateAttempterTest, UpdateTest);
// Sets the status to the given status and notifies a status update
@@ -142,6 +146,14 @@ class UpdateAttempter : public ActionProcessorDelegate,
static gboolean StaticManagePriorityCallback(gpointer data);
bool ManagePriorityCallback();
+ // Checks if a full update is needed and forces it by updating the Omaha
+ // request params.
+ void DisableDeltaUpdateIfNeeded();
+
+ // If this was a delta update attempt that failed, count it so that a full
+ // update can be tried when needed.
+ void MarkDeltaUpdateFailure();
+
// Last status notification timestamp used for throttling. Use
// monotonic TimeTicks to ensure that notifications are sent even if
// the system clock is set back in the middle of an update.
@@ -188,6 +200,7 @@ class UpdateAttempter : public ActionProcessorDelegate,
int64_t last_checked_time_;
std::string new_version_;
int64_t new_size_;
+ bool is_full_update_;
// Device paramaters common to all Omaha requests.
OmahaRequestDeviceParams omaha_request_params_;
« no previous file with comments | « prefs_interface.h ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698