OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 const std::string& data); | 87 const std::string& data); |
88 | 88 |
89 // Deletes the storage of namespace |ns| and stops serving its policies. | 89 // Deletes the storage of namespace |ns| and stops serving its policies. |
90 void Delete(const PolicyNamespace& ns); | 90 void Delete(const PolicyNamespace& ns); |
91 | 91 |
92 // Deletes the storage of all components of |domain| that pass then given | 92 // Deletes the storage of all components of |domain| that pass then given |
93 // |filter|, and stops serving their policies. | 93 // |filter|, and stops serving their policies. |
94 void Purge(PolicyDomain domain, | 94 void Purge(PolicyDomain domain, |
95 const ResourceCache::SubkeyFilter& filter); | 95 const ResourceCache::SubkeyFilter& filter); |
96 | 96 |
| 97 // Deletes the storage of every component. |
| 98 void Clear(); |
| 99 |
97 // Validates |proto| and returns the corresponding policy namespace in |ns|, | 100 // Validates |proto| and returns the corresponding policy namespace in |ns|, |
98 // and the parsed ExternalPolicyData in |payload|. | 101 // and the parsed ExternalPolicyData in |payload|. |
99 // If |proto| validates successfully then its |payload| can be trusted, and | 102 // If |proto| validates successfully then its |payload| can be trusted, and |
100 // the data referenced there can be downloaded. A |proto| must be validated | 103 // the data referenced there can be downloaded. A |proto| must be validated |
101 // before attempting to download the data, and before storing both. | 104 // before attempting to download the data, and before storing both. |
102 bool ValidatePolicy( | 105 bool ValidatePolicy( |
103 scoped_ptr<enterprise_management::PolicyFetchResponse> proto, | 106 scoped_ptr<enterprise_management::PolicyFetchResponse> proto, |
104 PolicyNamespace* ns, | 107 PolicyNamespace* ns, |
105 enterprise_management::ExternalPolicyData* payload); | 108 enterprise_management::ExternalPolicyData* payload); |
106 | 109 |
(...skipping 25 matching lines...) Expand all Loading... |
132 | 135 |
133 PolicyBundle policy_bundle_; | 136 PolicyBundle policy_bundle_; |
134 std::map<PolicyNamespace, std::string> cached_hashes_; | 137 std::map<PolicyNamespace, std::string> cached_hashes_; |
135 | 138 |
136 DISALLOW_COPY_AND_ASSIGN(ComponentCloudPolicyStore); | 139 DISALLOW_COPY_AND_ASSIGN(ComponentCloudPolicyStore); |
137 }; | 140 }; |
138 | 141 |
139 } // namespace policy | 142 } // namespace policy |
140 | 143 |
141 #endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ | 144 #endif // CHROME_BROWSER_POLICY_CLOUD_COMPONENT_CLOUD_POLICY_STORE_H_ |
OLD | NEW |