| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/linked_ptr.h" | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "chrome/browser/extensions/api/storage/settings_backend.h" | |
| 14 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.
h" | |
| 15 | |
| 16 namespace base { | |
| 17 class FilePath; | |
| 18 } | |
| 19 | |
| 20 class ValueStore; | |
| 21 | |
| 22 namespace extensions { | |
| 23 class SettingStorageFactory; | |
| 24 | |
| 25 class LocalStorageBackend : public SettingsBackend { | |
| 26 public: | |
| 27 LocalStorageBackend( | |
| 28 const scoped_refptr<SettingsStorageFactory>& storage_factory, | |
| 29 const base::FilePath& base_path, | |
| 30 const SettingsStorageQuotaEnforcer::Limits& quota); | |
| 31 virtual ~LocalStorageBackend(); | |
| 32 | |
| 33 // SettingsBackend implementation. | |
| 34 virtual ValueStore* GetStorage(const std::string& extension_id) OVERRIDE; | |
| 35 virtual void DeleteStorage(const std::string& extension_id) OVERRIDE; | |
| 36 | |
| 37 private: | |
| 38 typedef std::map<std::string, linked_ptr<ValueStore> > StorageMap; | |
| 39 | |
| 40 StorageMap storage_map_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(LocalStorageBackend); | |
| 43 }; | |
| 44 | |
| 45 } // namespace extensions | |
| 46 | |
| 47 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_ | |
| OLD | NEW |