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

Unified Diff: update_attempter.h

Issue 3215006: AU: Implement exponential back off for 500 and 503 HTTP response codes. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: elaborate on the CHECK Created 10 years, 4 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 | « omaha_request_action.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 1c9ad40577791b52cbf3f9a7050936ba8f893e42..fd9bc2a9b14a59dc25bc2abcf00c87f02c363424 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -24,9 +24,7 @@ struct UpdateEngineService;
namespace chromeos_update_engine {
-namespace utils {
-enum ProcessPriority;
-};
+class UpdateCheckScheduler;
extern const char* kUpdateCompletedMarker;
@@ -47,12 +45,13 @@ class UpdateAttempter : public ActionProcessorDelegate,
public DownloadActionDelegate {
public:
UpdateAttempter(PrefsInterface* prefs, MetricsLibraryInterface* metrics_lib);
- ~UpdateAttempter();
+ virtual ~UpdateAttempter();
// Checks for update and, if a newer version is available, attempts
// to update the system. Non-empty |in_app_version| or
// |in_update_url| prevents automatic detection of the parameter.
- void Update(const std::string& app_version, const std::string& omaha_url);
+ virtual void Update(const std::string& app_version,
+ const std::string& omaha_url);
// ActionProcessorDelegate methods:
void ProcessingDone(const ActionProcessor* processor, ActionExitCode code);
@@ -75,10 +74,22 @@ class UpdateAttempter : public ActionProcessorDelegate,
std::string* new_version,
int64_t* new_size);
+ UpdateStatus status() const { return status_; }
+
+ int http_response_code() const { return http_response_code_; }
+ void set_http_response_code(int code) { http_response_code_ = code; }
+
void set_dbus_service(struct UpdateEngineService* dbus_service) {
dbus_service_ = dbus_service;
}
+ UpdateCheckScheduler* update_check_scheduler() const {
+ return update_check_scheduler_;
+ }
+ void set_update_check_scheduler(UpdateCheckScheduler* scheduler) {
+ update_check_scheduler_ = scheduler;
+ }
+
// This is the D-Bus service entry point for going through an
// update. If the current status is idle invokes Update.
void CheckForUpdate(const std::string& app_version,
@@ -88,13 +99,6 @@ class UpdateAttempter : public ActionProcessorDelegate,
// UPDATED_NEED_REBOOT. Returns true on sucess, false otherwise.
bool RebootIfNeeded();
- // Kicks off the periodic update checks, if necessary.
- void InitiatePeriodicUpdateChecks();
-
- // Schedules the next periodic update check |seconds| from now. Note
- // that the actual timeout will be fuzzed.
- void SchedulePeriodicUpdateCheck(int seconds);
-
// DownloadActionDelegate methods
void SetDownloadStatus(bool active);
void BytesReceived(uint64_t bytes_received, uint64_t total);
@@ -155,9 +159,14 @@ class UpdateAttempter : public ActionProcessorDelegate,
// Pointer to the UMA metrics collection library.
MetricsLibraryInterface* metrics_lib_;
+ // The current UpdateCheckScheduler to notify of state transitions.
+ UpdateCheckScheduler* update_check_scheduler_;
+
// Pending error event, if any.
scoped_ptr<OmahaEvent> error_event_;
+ int http_response_code_;
+
// Current process priority.
utils::ProcessPriority priority_;
« no previous file with comments | « omaha_request_action.h ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698