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_FACTORY_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FACTORY_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/file_path.h" | |
11 #include "base/memory/ref_counted.h" | |
12 | |
13 class ValueStore; | |
14 | |
15 namespace extensions { | |
16 | |
17 // Factory for creating SettingStorage instances. | |
18 // | |
19 // Refcouted because it's just too messy to distribute these objects between | |
20 // SettingsBackend instances any other way. | |
21 class SettingsStorageFactory | |
22 : public base::RefCountedThreadSafe<SettingsStorageFactory> { | |
23 public: | |
24 // Creates a new ValueStore area for an extension under |base_path|. | |
25 // Return NULL to indicate failure. Must be called on the FILE thread. | |
26 virtual ValueStore* Create(const FilePath& base_path, | |
27 const std::string& extension_id) = 0; | |
28 | |
29 protected: | |
30 friend class base::RefCountedThreadSafe<SettingsStorageFactory>; | |
31 virtual ~SettingsStorageFactory() {} | |
32 }; | |
33 | |
34 } // namespace extensions | |
35 | |
36 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FACTORY_H_ | |
OLD | NEW |