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

Unified Diff: update_attempter.h

Issue 3042007: AU: A basic framework for sending error events when update attempt fails. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: Change ERROR_EVENT to REPORTING_ERROR_EVENT status. Created 10 years, 5 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 | « no previous file | 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 5eda43f119c963f821d74b1f4a17cb39c3de9b79..e84c4798c7caea34410beb4ed34ec86d15ea8f62 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -29,7 +29,8 @@ enum UpdateStatus {
UPDATE_STATUS_DOWNLOADING,
UPDATE_STATUS_VERIFYING,
UPDATE_STATUS_FINALIZING,
- UPDATE_STATUS_UPDATED_NEED_REBOOT
+ UPDATE_STATUS_UPDATED_NEED_REBOOT,
+ UPDATE_STATUS_REPORTING_ERROR_EVENT,
};
const char* UpdateStatusToString(UpdateStatus status);
@@ -87,6 +88,16 @@ class UpdateAttempter : public ActionProcessorDelegate,
// over dbus.
void SetStatusAndNotify(UpdateStatus status);
+ // Creates an error event object in |error_event_| to be included in
+ // an OmahaRequestAction once the current action processor is done.
+ void CreatePendingErrorEvent(ActionExitCode code);
+
+ // If there's a pending error event allocated in |error_event_|,
+ // schedules an OmahaRequestAction with that event in the current
+ // processor, clears the pending event, updates the status and
+ // returns true. Returns false otherwise.
+ bool ScheduleErrorEventAction();
+
struct timespec last_notify_time_;
std::vector<std::tr1::shared_ptr<AbstractAction> > actions_;
@@ -102,6 +113,9 @@ class UpdateAttempter : public ActionProcessorDelegate,
// Pointer to the UMA metrics collection library.
MetricsLibraryInterface* metrics_lib_;
+ // Pending error event, if any.
+ scoped_ptr<OmahaEvent> error_event_;
+
// For status:
UpdateStatus status_;
double download_progress_;
« no previous file with comments | « no previous file | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698