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

Unified Diff: components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h

Issue 2472593003: Fix behavior of cloud policy refreshes scheduled for soon (Closed)
Patch Set: Change comment Created 4 years, 1 month 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 | components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fc1a2edd9f8651a081afc5b00499f0a789da5664..f82052e1c7418b12b1682215c558d1c638db8d03 100644
--- a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
+++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h
@@ -57,7 +57,7 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
// invalidations are available or not).
int64_t GetActualRefreshDelay() const;
- // Requests a policy refresh to be performed soon.
+ // Schedules a refresh to be performed immediately.
void RefreshSoon();
// The refresh scheduler starts by assuming that invalidations are not
@@ -93,9 +93,6 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
// a refresh on every restart.
void UpdateLastRefreshFromPolicy();
- // Schedules a refresh to be performed immediately.
- void RefreshNow();
-
// Evaluates when the next refresh is pending and updates the callback to
// execute that refresh at the appropriate time.
void ScheduleRefresh();
@@ -103,10 +100,13 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
// Triggers a policy refresh.
void PerformRefresh();
- // Schedules a policy refresh to happen after |delta_ms| milliseconds,
- // relative to |last_refresh_|.
+ // Schedules a policy refresh to happen no later than |delta_ms| msecs after
+ // |last_refresh_|.
void RefreshAfter(int delta_ms);
+ // Cancels the scheduled policy refresh.
+ void CancelRefresh();
+
CloudPolicyClient* client_;
CloudPolicyStore* store_;
@@ -116,6 +116,10 @@ class POLICY_EXPORT CloudPolicyRefreshScheduler
// The delayed refresh callback.
base::CancelableClosure refresh_callback_;
+ // Whether the refresh is scheduled for soon (using |RefreshSoon| or
+ // |RefreshNow|).
+ bool is_scheduled_for_soon_ = false;
+
// The last time a refresh callback completed.
base::Time last_refresh_;
« no previous file with comments | « no previous file | components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698