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

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..3839aa23b2bf804038e62b18894747e937bd2efd 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager.h
+++ b/chrome/browser/policy/cloud/cloud_policy_manager.h
@@ -15,8 +15,13 @@
#include "chrome/browser/policy/cloud/cloud_policy_store.h"
#include "chrome/browser/policy/configuration_policy_provider.h"
+namespace invalidation {
+class InvalidationService;
+}
+
namespace policy {
+class CloudPolicyInvalidator;
class PolicyBundle;
// CloudPolicyManager is the main switching central between cloud policy and the
@@ -50,6 +55,18 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
// ConfigurationPolicyStore::UpdatePolicy().
void CheckAndPublishPolicy();
+ // Enable policy invalidations to be received by creating the invalidator
+ // object. The refresh scheduler must be started before calling this method.
+ // |service| is the invalidation service to use and must remain valid until
+ // Shutdown or UnregisterInvalidator is called.
+ void CreateInvalidator(invalidation::InvalidationService* service);
+
+ // Causes the invalidator to unregister with the invalidation service and then
+ // destroys the invalidator. This method should only be called when policy is
+ // no longer applied; it should not be called for normal browser shutdown.
+ // This method has no effect if CreateInvalidator has not been called.
+ void UnregisterInvalidator();
+
// Called by CheckAndPublishPolicy() to create a bundle with the current
// policies.
virtual scoped_ptr<PolicyBundle> CreatePolicyBundle();
@@ -72,6 +89,9 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
// policy update notifications are deferred until after it completes.
bool waiting_for_policy_refresh_;
+ // The policy invalidator, which handles invalidations to the policy.
+ scoped_ptr<CloudPolicyInvalidator> invalidator_;
+
DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager);
};

Powered by Google App Engine
This is Rietveld 408576698