diff options
author | Gilad Arnold <garnold@chromium.org> | 2014-10-02 10:34:54 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-18 01:39:10 +0000 |
commit | 519cfc71f0a2f7f01adb51acd19b5cd23d2c93a2 (patch) | |
tree | 32b424d8c72226e13650ef16197614c19545b46e /payload_state.h | |
parent | d78caf9baf2026a356130f4754af2c504f423945 (diff) |
update_engine: Move scattering wait period store/load to PayloadState.
This is needed for decoupling the inference/use of this value from its
storing/loading, as we shift the former into the Update Manager.
BUG=chromium:384087
TEST=Unit tests.
Change-Id: I4b278dc817b6f148d5638122f934e9d1e280bfae
Reviewed-on: https://chromium-review.googlesource.com/221250
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'payload_state.h')
-rw-r--r-- | payload_state.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/payload_state.h b/payload_state.h index 99e7d84e..8eb541cd 100644 --- a/payload_state.h +++ b/payload_state.h @@ -113,6 +113,12 @@ class PayloadState : public PayloadStateInterface { return using_p2p_for_downloading_; } + base::TimeDelta GetScatteringWaitPeriod() override { + return scattering_wait_period_; + } + + void SetScatteringWaitPeriod(base::TimeDelta wait_period) override; + private: enum class AttemptType { kUpdate, @@ -386,6 +392,9 @@ class PayloadState : public PayloadStateInterface { // Sets the |kPrefsP2PFirstAttemptTimestamp| state variable to |time|. void SetP2PFirstAttemptTimestamp(const base::Time& time); + // Loads the persisted scattering wallclock-based wait period. + void LoadScatteringWaitPeriod(); + // The global state of the system. SystemState* system_state_; @@ -529,6 +538,9 @@ class PayloadState : public PayloadStateInterface { // Whether we're currently rolling back. AttemptType attempt_type_; + // The current scattering wallclock-based wait period. + base::TimeDelta scattering_wait_period_; + DISALLOW_COPY_AND_ASSIGN(PayloadState); }; |