AU: Throttle notifications based on progress; still notify if slow progress.
This switches time based notifications to monotonic TimeTicks to avoid
system clock jump issues.
BUG=5885
TEST=unit tests, gmerged on device and watched notifications
Change-Id: Ia19a7bd9c4dc206f0d793a83eff64e0562af0803
Review URL: http://codereview.chromium.org/3187012
diff --git a/update_attempter.h b/update_attempter.h
index 0f5d605..b2ef371 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -13,6 +13,7 @@
#include <glib.h>
+#include "base/time.h"
#include "update_engine/action_processor.h"
#include "update_engine/download_action.h"
#include "update_engine/omaha_request_params.h"
@@ -126,7 +127,10 @@
static gboolean StaticManagePriorityCallback(gpointer data);
bool ManagePriorityCallback();
- struct timespec last_notify_time_;
+ // 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.
+ base::TimeTicks last_notify_time_;
std::vector<std::tr1::shared_ptr<AbstractAction> > actions_;
ActionProcessor processor_;