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_RESOURCE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const std::string& subkey, | 45 const std::string& subkey, |
46 std::string* data); | 46 std::string* data); |
47 | 47 |
48 // Loads all the subkeys of |key| into |contents|. | 48 // Loads all the subkeys of |key| into |contents|. |
49 void LoadAllSubkeys(const std::string& key, | 49 void LoadAllSubkeys(const std::string& key, |
50 std::map<std::string, std::string>* contents); | 50 std::map<std::string, std::string>* contents); |
51 | 51 |
52 // Deletes (key, subkey). | 52 // Deletes (key, subkey). |
53 void Delete(const std::string& key, const std::string& subkey); | 53 void Delete(const std::string& key, const std::string& subkey); |
54 | 54 |
| 55 // Deletes all the subkeys of |key|. |
| 56 void Clear(const std::string& key); |
| 57 |
55 // Deletes the subkeys of |key| for which the |filter| returns true. | 58 // Deletes the subkeys of |key| for which the |filter| returns true. |
56 typedef base::Callback<bool(const std::string&)> SubkeyFilter; | 59 typedef base::Callback<bool(const std::string&)> SubkeyFilter; |
57 void FilterSubkeys(const std::string& key, const SubkeyFilter& filter); | 60 void FilterSubkeys(const std::string& key, const SubkeyFilter& filter); |
58 | 61 |
59 // Deletes all keys not in |keys_to_keep|, along with their subkeys. | 62 // Deletes all keys not in |keys_to_keep|, along with their subkeys. |
60 void PurgeOtherKeys(const std::set<std::string>& keys_to_keep); | 63 void PurgeOtherKeys(const std::set<std::string>& keys_to_keep); |
61 | 64 |
62 // Deletes all the subkeys of |key| not in |subkeys_to_keep|. | 65 // Deletes all the subkeys of |key| not in |subkeys_to_keep|. |
63 void PurgeOtherSubkeys(const std::string& key, | 66 void PurgeOtherSubkeys(const std::string& key, |
64 const std::set<std::string>& subkeys_to_keep); | 67 const std::set<std::string>& subkeys_to_keep); |
(...skipping 19 matching lines...) Expand all Loading... |
84 | 87 |
85 // Task runner that |this| runs on. | 88 // Task runner that |this| runs on. |
86 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 89 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
87 | 90 |
88 DISALLOW_COPY_AND_ASSIGN(ResourceCache); | 91 DISALLOW_COPY_AND_ASSIGN(ResourceCache); |
89 }; | 92 }; |
90 | 93 |
91 } // namespace policy | 94 } // namespace policy |
92 | 95 |
93 #endif // CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_ | 96 #endif // CHROME_BROWSER_POLICY_CLOUD_RESOURCE_CACHE_H_ |
OLD | NEW |