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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_manager.h

Issue 19733003: Implement cloud policy invalidations using the invalidation service framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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/policy/cloud/cloud_policy_manager.h
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager.h b/chrome/browser/policy/cloud/cloud_policy_manager.h
index 34be652e8e2a0fd8524a0a9f259c018900ee4ed0..08252b7a3483b430a9e42302504f7ef9cd5ea5e4 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager.h
+++ b/chrome/browser/policy/cloud/cloud_policy_manager.h
@@ -12,6 +12,7 @@
#include "base/prefs/pref_member.h"
#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/cloud/cloud_policy_core.h"
+#include "chrome/browser/policy/cloud/cloud_policy_invalidator.h"
#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "chrome/browser/policy/configuration_policy_provider.h"
@@ -27,7 +28,8 @@ class PolicyBundle;
// functionality specific to user-level and device-level cloud policy, such as
// blocking on initial user policy fetch or device enrollment.
class CloudPolicyManager : public ConfigurationPolicyProvider,
- public CloudPolicyStore::Observer {
+ public CloudPolicyStore::Observer,
+ public CloudPolicyInvalidationHandler {
public:
CloudPolicyManager(const PolicyNamespaceKey& policy_ns_key,
CloudPolicyStore* cloud_policy_store);
@@ -45,11 +47,23 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
virtual void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) OVERRIDE;
virtual void OnStoreError(CloudPolicyStore* cloud_policy_store) OVERRIDE;
+ // CloudPolicyInvalidationHandler:
+ virtual void SetInvalidationInfo(
+ int64 version,
+ const std::string& payload) OVERRIDE;
+ virtual void InvalidatePolicy() OVERRIDE;
+ virtual void OnInvalidatorStateChanged(bool invalidations_enabled) OVERRIDE;
+
protected:
// Check whether fully initialized and if so, publish policy by calling
// ConfigurationPolicyStore::UpdatePolicy().
void CheckAndPublishPolicy();
+ // Starts the policy refresh scheduler. This must be called instead of calling
+ // enabling the scheduler on core() directly so that invalidations received
+ // before the refresh scheduler is started are handled correctly.
+ void StartRefreshScheduler();
+
// Called by CheckAndPublishPolicy() to create a bundle with the current
// policies.
virtual scoped_ptr<PolicyBundle> CreatePolicyBundle();
@@ -72,6 +86,11 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
// policy update notifications are deferred until after it completes.
bool waiting_for_policy_refresh_;
+ // Replays the latest invalidation that occurred before the refresh
+ // scheduler was started. Without storing the information, invalidations
+ // generated before the refresh scheduler started would be lost.
+ CloudPolicyInvalidationReplayer invalidation_replayer_;
rlarocque 2013/07/25 19:23:40 Are you sure this is necessary? The InvalidationS
Steve Condie 2013/07/26 01:39:25 With the new way of managing the lifetime of the U
Steve Condie 2013/07/26 08:47:27 After thinking about it more, there is a fairly st
+
DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager);
};

Powered by Google App Engine
This is Rietveld 408576698