OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_ | |
7 #pragma once | |
8 | |
9 #include "base/compiler_specific.h" | |
10 #include "chrome/browser/extensions/settings/settings_storage.h" | |
11 | |
12 namespace extensions { | |
13 | |
14 // In-memory storage, as opposed to SettingsLeveldbStorage. | |
15 class InMemorySettingsStorage : public SettingsStorage { | |
16 public: | |
17 InMemorySettingsStorage() {} | |
18 | |
19 // SettingsStorage implementation. | |
20 virtual ReadResult Get(const std::string& key) OVERRIDE; | |
21 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; | |
22 virtual ReadResult Get() OVERRIDE; | |
23 virtual WriteResult Set(const std::string& key, const Value& value) OVERRIDE; | |
24 virtual WriteResult Set(const DictionaryValue& values) OVERRIDE; | |
25 virtual WriteResult Remove(const std::string& key) OVERRIDE; | |
26 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; | |
27 virtual WriteResult Clear() OVERRIDE; | |
28 | |
29 private: | |
30 DictionaryValue storage_; | |
31 | |
32 DISALLOW_COPY_AND_ASSIGN(InMemorySettingsStorage); | |
33 }; | |
34 | |
35 } // namespace extensions | |
36 | |
37 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_IN_MEMORY_SETTINGS_STORAGE_H_ | |
OLD | NEW |