| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ |
| 6 #define EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ | 6 #define EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 // Returns the current instance for |context|. | 28 // Returns the current instance for |context|. |
| 29 static StorageFrontend* Get(content::BrowserContext* context); | 29 static StorageFrontend* Get(content::BrowserContext* context); |
| 30 | 30 |
| 31 // Creates with a specific |storage_factory|. Caller owns the object. | 31 // Creates with a specific |storage_factory|. Caller owns the object. |
| 32 static StorageFrontend* CreateForTesting( | 32 static StorageFrontend* CreateForTesting( |
| 33 const scoped_refptr<SettingsStorageFactory>& storage_factory, | 33 const scoped_refptr<SettingsStorageFactory>& storage_factory, |
| 34 content::BrowserContext* context); | 34 content::BrowserContext* context); |
| 35 | 35 |
| 36 // Public so tests can create and delete their own instances. | 36 // Public so tests can create and delete their own instances. |
| 37 virtual ~StorageFrontend(); | 37 ~StorageFrontend() override; |
| 38 | 38 |
| 39 // Returns the value store cache for |settings_namespace|. | 39 // Returns the value store cache for |settings_namespace|. |
| 40 ValueStoreCache* GetValueStoreCache( | 40 ValueStoreCache* GetValueStoreCache( |
| 41 settings_namespace::Namespace settings_namespace) const; | 41 settings_namespace::Namespace settings_namespace) const; |
| 42 | 42 |
| 43 // Returns true if |settings_namespace| is a valid namespace. | 43 // Returns true if |settings_namespace| is a valid namespace. |
| 44 bool IsStorageEnabled(settings_namespace::Namespace settings_namespace) const; | 44 bool IsStorageEnabled(settings_namespace::Namespace settings_namespace) const; |
| 45 | 45 |
| 46 // Runs |callback| with the storage area of the given |settings_namespace| | 46 // Runs |callback| with the storage area of the given |settings_namespace| |
| 47 // for the |extension|. | 47 // for the |extension|. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Maps a known namespace to its corresponding ValueStoreCache. The caches | 90 // Maps a known namespace to its corresponding ValueStoreCache. The caches |
| 91 // are owned by this object. | 91 // are owned by this object. |
| 92 CacheMap caches_; | 92 CacheMap caches_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(StorageFrontend); | 94 DISALLOW_COPY_AND_ASSIGN(StorageFrontend); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace extensions | 97 } // namespace extensions |
| 98 | 98 |
| 99 #endif // EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ | 99 #endif // EXTENSIONS_BROWSER_API_STORAGE_STORAGE_FRONTEND_H_ |
| OLD | NEW |