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

Unified Diff: chrome/browser/chromeos/policy/active_directory_policy_manager.h

Issue 2652653007: Chromad: Refresh policy every 90 minutes (Closed)
Patch Set: Polish Created 3 years, 11 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
Index: chrome/browser/chromeos/policy/active_directory_policy_manager.h
diff --git a/chrome/browser/chromeos/policy/active_directory_policy_manager.h b/chrome/browser/chromeos/policy/active_directory_policy_manager.h
index 96fcac33a2de9e3e62308b05525d37081af42d2c..84b6469811959bb2e2f33e4b03c598e73930222e 100644
--- a/chrome/browser/chromeos/policy/active_directory_policy_manager.h
+++ b/chrome/browser/chromeos/policy/active_directory_policy_manager.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/time.h"
#include "components/policy/core/common/cloud/cloud_policy_store.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/signin/core/account_id/account_id.h"
@@ -52,15 +53,27 @@ class ActiveDirectoryPolicyManager : public ConfigurationPolicyProvider,
ActiveDirectoryPolicyManager(const AccountId& account_id,
std::unique_ptr<CloudPolicyStore> store);
- // Publishes the policy that's currently cached in the store.
+ // Publish the policy that's currently cached in the store.
void PublishPolicy();
// Callback from authpolicyd.
void OnPolicyRefreshed(bool success);
+ // Schedule the next policy refresh.
+ void ScheduleRefresh();
+
+ // Actually execute the scheduled policy refresh.
+ void RunScheduledRefresh(int task_number);
+
const AccountId account_id_;
std::unique_ptr<CloudPolicyStore> store_;
+ base::TimeDelta refresh_interval_;
+ base::TimeDelta min_scheduling_delay_;
+ base::TimeTicks last_refresh_;
+ bool refresh_in_progress_ = false;
+ int task_number_ = 0;
emaxx 2017/01/24 15:54:26 Worth adding a comment for this member. Also, mayb
Thiemo Nagel 2017/01/26 20:14:18 Obsolete.
+
// Must be last member.
base::WeakPtrFactory<ActiveDirectoryPolicyManager> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698