OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual ~ManagedValueStoreCache(); | 49 virtual ~ManagedValueStoreCache(); |
50 | 50 |
51 private: | 51 private: |
52 class ExtensionTracker; | 52 class ExtensionTracker; |
53 | 53 |
54 // Maps an extension ID to its PolicyValueStoreMap. | 54 // Maps an extension ID to its PolicyValueStoreMap. |
55 typedef std::map<std::string, linked_ptr<PolicyValueStore> > | 55 typedef std::map<std::string, linked_ptr<PolicyValueStore> > |
56 PolicyValueStoreMap; | 56 PolicyValueStoreMap; |
57 | 57 |
58 // ValueStoreCache implementation: | 58 // ValueStoreCache implementation: |
59 virtual void ShutdownOnUI() OVERRIDE; | 59 virtual void ShutdownOnUI() override; |
60 virtual void RunWithValueStoreForExtension( | 60 virtual void RunWithValueStoreForExtension( |
61 const StorageCallback& callback, | 61 const StorageCallback& callback, |
62 scoped_refptr<const Extension> extension) OVERRIDE; | 62 scoped_refptr<const Extension> extension) override; |
63 virtual void DeleteStorageSoon(const std::string& extension_id) OVERRIDE; | 63 virtual void DeleteStorageSoon(const std::string& extension_id) override; |
64 | 64 |
65 // PolicyService::Observer implementation: | 65 // PolicyService::Observer implementation: |
66 virtual void OnPolicyServiceInitialized(policy::PolicyDomain domain) OVERRIDE; | 66 virtual void OnPolicyServiceInitialized(policy::PolicyDomain domain) override; |
67 virtual void OnPolicyUpdated(const policy::PolicyNamespace& ns, | 67 virtual void OnPolicyUpdated(const policy::PolicyNamespace& ns, |
68 const policy::PolicyMap& previous, | 68 const policy::PolicyMap& previous, |
69 const policy::PolicyMap& current) OVERRIDE; | 69 const policy::PolicyMap& current) override; |
70 | 70 |
71 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the FILE | 71 // Posted by OnPolicyUpdated() to update a PolicyValueStore on the FILE |
72 // thread. | 72 // thread. |
73 void UpdatePolicyOnFILE(const std::string& extension_id, | 73 void UpdatePolicyOnFILE(const std::string& extension_id, |
74 scoped_ptr<policy::PolicyMap> current_policy); | 74 scoped_ptr<policy::PolicyMap> current_policy); |
75 | 75 |
76 // Returns an existing PolicyValueStore for |extension_id|, or NULL. | 76 // Returns an existing PolicyValueStore for |extension_id|, or NULL. |
77 PolicyValueStore* GetStoreFor(const std::string& extension_id); | 77 PolicyValueStore* GetStoreFor(const std::string& extension_id); |
78 | 78 |
79 // Returns true if a backing store has been created for |extension_id|. | 79 // Returns true if a backing store has been created for |extension_id|. |
(...skipping 18 matching lines...) Expand all Loading... |
98 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be | 98 // All the PolicyValueStores live on the FILE thread, and |store_map_| can be |
99 // accessed only on the FILE thread as well. | 99 // accessed only on the FILE thread as well. |
100 PolicyValueStoreMap store_map_; | 100 PolicyValueStoreMap store_map_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); | 102 DISALLOW_COPY_AND_ASSIGN(ManagedValueStoreCache); |
103 }; | 103 }; |
104 | 104 |
105 } // namespace extensions | 105 } // namespace extensions |
106 | 106 |
107 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ | 107 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_MANAGED_VALUE_STORE_CACHE_H_ |
OLD | NEW |