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

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

Issue 2652653007: Chromad: Refresh policy every 90 minutes (Closed)
Patch Set: Convert int constants to TimeDelta 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/active_directory_policy_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9bf7935e70547556da3387e177da68710a16d6dd 100644
--- a/chrome/browser/chromeos/policy/active_directory_policy_manager.h
+++ b/chrome/browser/chromeos/policy/active_directory_policy_manager.h
@@ -7,8 +7,10 @@
#include <memory>
+#include "base/cancelable_callback.h"
#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 +54,36 @@ 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 next policy refresh to run after |delay|. (Deletes any previously
+ // scheduled refresh tasks.)
+ void ScheduleRefresh(base::TimeDelta delay);
+
+ // Schedule next automatic policy refresh based on initial fetch delay or
+ // refresh interval. (Deletes any previously scheduled refresh tasks.)
+ void ScheduleAutomaticRefresh();
+
+ // Actually execute the scheduled policy refresh.
+ void RunScheduledRefresh();
+
const AccountId account_id_;
std::unique_ptr<CloudPolicyStore> store_;
+ // Whether a policy refresh is in progress (and thus any further requests need
+ // to be blocked).
+ bool refresh_in_progress_ = false;
+ // Whether a refresh had been blocked and thus the next refresh needs to be
+ // scheduled at the shorter "retry" interval.
+ bool retry_refresh_ = false;
+ base::TimeTicks last_refresh_;
+ const base::TimeTicks startup_ = base::TimeTicks::Now();
+ std::unique_ptr<base::CancelableClosure> refresh_task_;
+
// Must be last member.
base::WeakPtrFactory<ActiveDirectoryPolicyManager> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/active_directory_policy_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698