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. | |
25 class SettingsBackend { | 24 class SettingsBackend { |
26 public: | 25 public: |
27 SettingsBackend(const scoped_refptr<SettingsStorageFactory>& storage_factory, | 26 SettingsBackend(const scoped_refptr<SettingsStorageFactory>& storage_factory, |
28 const base::FilePath& base_path, | 27 const base::FilePath& base_path, |
29 const SettingsStorageQuotaEnforcer::Limits& quota); | 28 const SettingsStorageQuotaEnforcer::Limits& quota); |
30 virtual ~SettingsBackend(); | 29 virtual ~SettingsBackend(); |
31 | 30 |
32 // Gets a weak reference to the storage area for |extension_id|. | 31 // Gets a weak reference to the storage area for |extension_id|. |
33 // Must be run on the FILE thread. | 32 // Must be run on the FILE thread. |
34 virtual ValueStore* GetStorage(const std::string& extension_id) = 0; | 33 virtual ValueStore* GetStorage(const std::string& extension_id) = 0; |
(...skipping 30 matching lines...) Expand all Loading... |
65 | 64 |
66 // Quota limits (see SettingsStorageQuotaEnforcer). | 65 // Quota limits (see SettingsStorageQuotaEnforcer). |
67 const SettingsStorageQuotaEnforcer::Limits quota_; | 66 const SettingsStorageQuotaEnforcer::Limits quota_; |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); | 68 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); |
70 }; | 69 }; |
71 | 70 |
72 } // namespace extensions | 71 } // namespace extensions |
73 | 72 |
74 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ | 73 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_BACKEND_H_ |
OLD | NEW |