| Index: components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
|
| diff --git a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
|
| index f82052e1c7418b12b1682215c558d1c638db8d03..7110c94aaf76f32d30f8cea120fca6934b4dc4e2 100644
|
| --- a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
|
| +++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
|
| @@ -83,6 +83,7 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
|
| void OnStoreError(CloudPolicyStore* store) override;
|
|
|
| // net::NetworkChangeNotifier::IPAddressObserver:
|
| + // Triggered also when the device wakes up.
|
| void OnIPAddressChanged() override;
|
|
|
| private:
|
| @@ -101,12 +102,15 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
|
| void PerformRefresh();
|
|
|
| // Schedules a policy refresh to happen no later than |delta_ms| msecs after
|
| - // |last_refresh_|.
|
| + // |last_refresh_| or |last_refresh_ticks_| whichever is sooner.
|
| void RefreshAfter(int delta_ms);
|
|
|
| // Cancels the scheduled policy refresh.
|
| void CancelRefresh();
|
|
|
| + // Sets the |last_refresh_| and |last_refresh_ticks_| to current time.
|
| + void UpdateLastRefresh();
|
| +
|
| CloudPolicyClient* client_;
|
| CloudPolicyStore* store_;
|
|
|
| @@ -120,9 +124,15 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
|
| // |RefreshNow|).
|
| bool is_scheduled_for_soon_ = false;
|
|
|
| - // The last time a refresh callback completed.
|
| + // The last time a refresh callback completed. Is null in case the client is
|
| + // not registered.
|
| base::Time last_refresh_;
|
|
|
| + // The same |last_refresh_|, but based on TimeTicks. This allows to schedule
|
| + // the refresh times based on both, system time and TimeTicks, providing a
|
| + // protection against changes in system time.
|
| + base::TimeTicks last_refresh_ticks_;
|
| +
|
| // Error retry delay in milliseconds.
|
| int64_t error_retry_delay_ms_;
|
|
|
|
|