Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FRONTEND_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FRONTEND_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "chrome/browser/extensions/settings/settings_namespace_frontend.h" | |
| 12 #include "chrome/browser/extensions/settings/settings_observer.h" | |
| 13 #include "chrome/browser/extensions/settings/settings_storage_quota_enforcer.h" | |
| 14 | |
| 15 class FilePath; | |
| 16 | |
| 17 namespace extensions { | |
| 18 | |
| 19 class SettingsBackend; | |
| 20 class SettingsStorageFactory; | |
| 21 | |
| 22 // The frontend for the LOCAL and SYNC namespaces. It owns a backend for | |
| 23 // apps and another for extensions. Each backend takes care of persistence and | |
| 24 // syncing. | |
| 25 class SettingsStorageFrontend : public SettingsNamespaceFrontend { | |
|
not at google - send to devlin
2012/07/18 07:46:18
If you go with the ValueStoreCache thing, call thi
Joao da Silva
2012/07/18 21:40:25
Done.
| |
| 26 public: | |
| 27 SettingsStorageFrontend(settings_namespace::Namespace settings_namespace, | |
| 28 const scoped_refptr<SettingsStorageFactory>& factory, | |
| 29 const SettingsStorageQuotaEnforcer::Limits& quota, | |
| 30 const scoped_refptr<SettingsObserverList>& observers, | |
| 31 const FilePath& profile_path); | |
| 32 virtual ~SettingsStorageFrontend(); | |
| 33 | |
| 34 // This specific implementation executes the |callback| in the FILE thread, | |
| 35 // with the storage for |extension| provided by the appropriate backend. | |
| 36 virtual void RunWithStorage(const Extension* extension, | |
| 37 const StorageCallback& callback) OVERRIDE; | |
| 38 | |
| 39 virtual void DeleteStorageSoon(const std::string& extension_id) OVERRIDE; | |
| 40 | |
| 41 SettingsBackend* GetAppBackend() const; | |
| 42 SettingsBackend* GetExtensionBackend() const; | |
| 43 | |
| 44 private: | |
| 45 class BackendWrapper; | |
| 46 | |
| 47 settings_namespace::Namespace settings_namespace_; | |
| 48 scoped_refptr<BackendWrapper> app_backend_; | |
| 49 scoped_refptr<BackendWrapper> extension_backend_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(SettingsStorageFrontend); | |
| 52 }; | |
| 53 | |
| 54 } // namespace extensions | |
| 55 | |
| 56 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FRONTEND_H_ | |
| OLD | NEW |