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_SETTINGS_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.
h" | 13 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.
h" |
14 | 14 |
15 namespace syncer { | 15 namespace syncer { |
16 class SyncableService; | 16 class SyncableService; |
17 } | 17 } |
18 | 18 |
19 class ValueStore; | 19 class ValueStore; |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 class SettingsStorageFactory; | 22 class SettingsStorageFactory; |
23 | 23 |
| 24 // Performs work for the storage API on the FILE thread. |
24 class SettingsBackend { | 25 class SettingsBackend { |
25 public: | 26 public: |
26 SettingsBackend(const scoped_refptr<SettingsStorageFactory>& storage_factory, | 27 SettingsBackend(const scoped_refptr<SettingsStorageFactory>& storage_factory, |
27 const base::FilePath& base_path, | 28 const base::FilePath& base_path, |
28 const SettingsStorageQuotaEnforcer::Limits& quota); | 29 const SettingsStorageQuotaEnforcer::Limits& quota); |
29 virtual ~SettingsBackend(); | 30 virtual ~SettingsBackend(); |
30 | 31 |
31 // Gets a weak reference to the storage area for |extension_id|. | 32 // Gets a weak reference to the storage area for |extension_id|. |
32 // Must be run on the FILE thread. | 33 // Must be run on the FILE thread. |
33 virtual ValueStore* GetStorage(const std::string& extension_id) = 0; | 34 virtual ValueStore* GetStorage(const std::string& extension_id) = 0; |
(...skipping 30 matching lines...) Expand all Loading... |
64 | 65 |
65 // Quota limits (see SettingsStorageQuotaEnforcer). | 66 // Quota limits (see SettingsStorageQuotaEnforcer). |
66 const SettingsStorageQuotaEnforcer::Limits quota_; | 67 const SettingsStorageQuotaEnforcer::Limits quota_; |
67 | 68 |
68 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); | 69 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); |
69 }; | 70 }; |
70 | 71 |
71 } // namespace extensions | 72 } // namespace extensions |
72 | 73 |
73 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ | 74 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ |
OLD | NEW |