PM: UpdaterProvider reports the number of consecutive failed update checks.
This adds a new variable to UpdaterProvider, along with the necessary
bits of implementation in UpdateAttempter, to track and report this
number.
BUG=chromium:367006
TEST=Unit tests.
Change-Id: I819dc5c9d4d351e5bfe1373dba0993e3f622b0e0
Reviewed-on: https://chromium-review.googlesource.com/197092
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index 311a918..c83f121 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -202,6 +202,11 @@
// This will return an empty string otherwise.
std::string const& GetPrevVersion() const { return prev_version_; }
+ // Returns the nubmer of consecutive failed update checks.
+ virtual unsigned int consecutive_failed_update_checks() const {
+ return consecutive_failed_update_checks_;
+ }
+
private:
// Update server URL for automated lab test.
static const char* const kTestUpdateUrl;
@@ -457,6 +462,10 @@
// ignored (nor is it being written), which is useful for testing situations.
std::string update_completed_marker_;
+ // The number of consecutive failed update checks. Needed for calculating the
+ // next update check interval.
+ unsigned int consecutive_failed_update_checks_ = 0;
+
DISALLOW_COPY_AND_ASSIGN(UpdateAttempter);
};