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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_client.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_client.h
diff --git a/chrome/browser/policy/cloud/cloud_policy_client.h b/chrome/browser/policy/cloud/cloud_policy_client.h
index f30fcc1e14a3e7c8697f9d6774a1a465f536756c..164db4955883272d52c23160e33c05b98ee69c5b 100644
--- a/chrome/browser/policy/cloud/cloud_policy_client.h
+++ b/chrome/browser/policy/cloud/cloud_policy_client.h
@@ -104,6 +104,11 @@ class CloudPolicyClient {
bool is_auto_enrollment,
const std::string& requisition);
+ // Sets information about a policy invalidation. Subsequent fetch operations
+ // will use the given info, and callers can use fetched_invalidation_version
+ // to determine which version of policy was fetched.
+ void SetInvalidationInfo(int64 version, const std::string& payload);
+
// Requests a policy fetch. The client being registered is a prerequisite to
// this operation and this call will CHECK if the client is not in registered
// state. FetchPolicy() triggers a policy fetch from the cloud. A policy
@@ -186,6 +191,13 @@ class CloudPolicyClient {
return robot_api_auth_code_;
}
+ // Returns the invalidation version that was used for the last FetchPolicy.
+ // Observers can call this method from their OnPolicyFetched method to
+ // determine which at which invalidation version the policy was fetched.
+ int64 fetched_invalidation_version() const {
+ return fetched_invalidation_version_;
+ }
+
protected:
// A set of PolicyNamespaceKeys to fetch.
typedef std::set<PolicyNamespaceKey> NamespaceSet;
@@ -245,6 +257,13 @@ class CloudPolicyClient {
bool public_key_version_valid_;
std::string robot_api_auth_code_;
+ // Information for the latest policy invalidation received.
+ int64 invalidation_version_;
+ std::string invalidation_payload_;
+
+ // The invalidation version used for the most recent fetch operation.
+ int64 fetched_invalidation_version_;
+
// Used for issuing requests to the cloud.
DeviceManagementService* service_;
scoped_ptr<DeviceManagementRequestJob> request_job_;

Powered by Google App Engine
This is Rietveld 408576698