Chromium Code Reviews| Index: components/policy/core/common/cloud/cloud_policy_client.h |
| diff --git a/components/policy/core/common/cloud/cloud_policy_client.h b/components/policy/core/common/cloud/cloud_policy_client.h |
| index bcf43530890981f62d1a4ea6778527451b772dac..3a8b68eb9f45ace9877033aa343b11dde3ba932c 100644 |
| --- a/components/policy/core/common/cloud/cloud_policy_client.h |
| +++ b/components/policy/core/common/cloud/cloud_policy_client.h |
| @@ -38,6 +38,9 @@ class DeviceManagementService; |
| // installed in the cloud policy cache. |
| class POLICY_EXPORT CloudPolicyClient { |
| public: |
| + // A set of PolicyNamespaceKeys to fetch. |
| + typedef std::set<PolicyNamespaceKey> NamespaceSet; |
| + |
| // Maps a PolicyNamespaceKey to its corresponding PolicyFetchResponse. |
| typedef std::map<PolicyNamespaceKey, |
| enterprise_management::PolicyFetchResponse*> ResponseMap; |
| @@ -196,6 +199,14 @@ class POLICY_EXPORT CloudPolicyClient { |
| return responses_; |
| } |
| + // Returns a set with the policy namespaces that were included in the fetch |
| + // request that produced the current |responses()|. This can be used to |
| + // determine if a namespace is missing because it wasn't requested or because |
| + // the server didn't include a response. |
|
Mattias Nissler (ping if slow)
2014/11/26 13:44:14
Hm, this moves the responsibility to do the diffin
|
| + const NamespaceSet& namespaces_requested() const { |
| + return namespaces_requested_; |
| + } |
| + |
| // Returns the policy response for |policy_ns_key|, if found in |responses()|; |
| // otherwise returns NULL. |
| const enterprise_management::PolicyFetchResponse* GetPolicyFor( |
| @@ -219,9 +230,6 @@ class POLICY_EXPORT CloudPolicyClient { |
| scoped_refptr<net::URLRequestContextGetter> GetRequestContext(); |
| protected: |
| - // A set of PolicyNamespaceKeys to fetch. |
| - typedef std::set<PolicyNamespaceKey> NamespaceSet; |
| - |
| // Callback for retries of registration requests. |
| void OnRetryRegister(DeviceManagementRequestJob* job); |
| @@ -233,6 +241,7 @@ class POLICY_EXPORT CloudPolicyClient { |
| // Callback for policy fetch requests. |
| void OnPolicyFetchCompleted( |
| + const NamespaceSet& namespaces_requested, |
| DeviceManagementStatus status, |
| int net_error, |
| const enterprise_management::DeviceManagementResponse& response); |
| @@ -297,6 +306,9 @@ class POLICY_EXPORT CloudPolicyClient { |
| ResponseMap responses_; |
| DeviceManagementStatus status_; |
| + // The namespaces that were requested in the last successful policy fetch. |
| + NamespaceSet namespaces_requested_; |
| + |
| ObserverList<Observer, true> observers_; |
| scoped_refptr<net::URLRequestContextGetter> request_context_; |