123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- #ifndef UPDATE_ENGINE_PAYLOAD_STATE_INTERFACE_H_
- #define UPDATE_ENGINE_PAYLOAD_STATE_INTERFACE_H_
- #include <string>
- #include "update_engine/common/action_processor.h"
- #include "update_engine/common/constants.h"
- #include "update_engine/omaha_response.h"
- namespace chromeos_update_engine {
- class PayloadStateInterface {
- public:
- virtual ~PayloadStateInterface() = default;
-
-
-
-
-
-
- virtual void SetResponse(const OmahaResponse& response) = 0;
-
-
-
-
-
-
- virtual void DownloadComplete() = 0;
-
-
-
-
- virtual void DownloadProgress(size_t count) = 0;
-
- virtual void UpdateResumed() = 0;
-
-
-
- virtual void UpdateRestarted() = 0;
-
-
-
- virtual void UpdateSucceeded() = 0;
-
-
-
- virtual void UpdateFailed(ErrorCode error) = 0;
-
-
-
- virtual void ResetUpdateStatus() = 0;
-
- virtual void Rollback() = 0;
-
-
-
-
-
- virtual void ExpectRebootInNewVersion(
- const std::string& target_version_uid) = 0;
-
-
-
- virtual void SetUsingP2PForDownloading(bool value) = 0;
-
- virtual void SetUsingP2PForSharing(bool value) = 0;
-
-
- virtual bool ShouldBackoffDownload() = 0;
-
-
- virtual std::string GetResponseSignature() = 0;
-
- virtual int GetPayloadAttemptNumber() = 0;
-
-
- virtual int GetFullPayloadAttemptNumber() = 0;
-
- virtual std::string GetCurrentUrl() = 0;
-
- virtual uint32_t GetUrlFailureCount() = 0;
-
-
- virtual uint32_t GetUrlSwitchCount() = 0;
-
-
- virtual int GetNumResponsesSeen() = 0;
-
- virtual base::Time GetBackoffExpiryTime() = 0;
-
-
-
- virtual base::TimeDelta GetUpdateDuration() = 0;
-
-
-
- virtual base::TimeDelta GetUpdateDurationUptime() = 0;
-
-
-
-
- virtual uint64_t GetCurrentBytesDownloaded(DownloadSource source) = 0;
-
-
-
- virtual uint64_t GetTotalBytesDownloaded(DownloadSource source) = 0;
-
- virtual uint32_t GetNumReboots() = 0;
-
- virtual void UpdateEngineStarted() = 0;
-
-
- virtual bool GetRollbackHappened() = 0;
-
-
-
-
- virtual void SetRollbackHappened(bool rollback_happened) = 0;
-
-
- virtual std::string GetRollbackVersion() = 0;
-
-
- virtual int GetP2PNumAttempts() = 0;
-
-
- virtual base::Time GetP2PFirstAttemptTimestamp() = 0;
-
-
-
- virtual void P2PNewAttempt() = 0;
-
-
-
-
- virtual bool P2PAttemptAllowed() = 0;
-
-
- virtual bool GetUsingP2PForDownloading() const = 0;
- virtual bool GetUsingP2PForSharing() const = 0;
-
- virtual base::TimeDelta GetScatteringWaitPeriod() = 0;
-
- virtual void SetScatteringWaitPeriod(base::TimeDelta wait_period) = 0;
-
- virtual void SetP2PUrl(const std::string& url) = 0;
- virtual std::string GetP2PUrl() const = 0;
-
- virtual bool NextPayload() = 0;
-
- virtual void SetStagingWaitPeriod(base::TimeDelta wait_period) = 0;
- };
- }
- #endif
|