OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_SETTINGS_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_BACKEND_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_BACKEND_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_BACKEND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" |
13 #include "base/task.h" | 14 #include "base/task.h" |
14 #include "chrome/browser/extensions/syncable_extension_settings_storage.h" | 15 #include "chrome/browser/extensions/syncable_extension_settings_storage.h" |
15 #include "chrome/browser/sync/api/syncable_service.h" | 16 #include "chrome/browser/sync/api/syncable_service.h" |
16 | 17 |
17 // Manages ExtensionSettingsStorage objects for extensions, including routing | 18 // Manages ExtensionSettingsStorage objects for extensions, including routing |
18 // changes from sync to them. | 19 // changes from sync to them. |
19 // Lives entirely on the FILE thread. | 20 // Lives entirely on the FILE thread. |
20 class ExtensionSettingsBackend : public SyncableService { | 21 class ExtensionSettingsBackend |
| 22 : public SyncableService, |
| 23 public base::SupportsWeakPtr<ExtensionSettingsBackend> { |
21 public: | 24 public: |
22 // File path is the base of the extension settings directory. | 25 // File path is the base of the extension settings directory. |
23 // The databases will be at base_path/extension_id. | 26 // The databases will be at base_path/extension_id. |
24 explicit ExtensionSettingsBackend(const FilePath& base_path); | 27 explicit ExtensionSettingsBackend(const FilePath& base_path); |
25 | 28 |
26 virtual ~ExtensionSettingsBackend(); | 29 virtual ~ExtensionSettingsBackend(); |
27 | 30 |
28 // Gets a weak reference to the storage area for a given extension. | 31 // Gets a weak reference to the storage area for a given extension. |
29 // Must be run on the FILE thread. | 32 // Must be run on the FILE thread. |
30 // | 33 // |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 StorageObjMap; | 70 StorageObjMap; |
68 mutable StorageObjMap storage_objs_; | 71 mutable StorageObjMap storage_objs_; |
69 | 72 |
70 // Current sync processor, if any. | 73 // Current sync processor, if any. |
71 SyncChangeProcessor* sync_processor_; | 74 SyncChangeProcessor* sync_processor_; |
72 | 75 |
73 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsBackend); | 76 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsBackend); |
74 }; | 77 }; |
75 | 78 |
76 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_BACKEND_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_BACKEND_H_ |
OLD | NEW |