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_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 DISALLOW_COPY_AND_ASSIGN(Factory); | 40 DISALLOW_COPY_AND_ASSIGN(Factory); |
41 }; | 41 }; |
42 | 42 |
43 // Must be deleted on the FILE thread. | 43 // Must be deleted on the FILE thread. |
44 virtual ~SettingsLeveldbStorage(); | 44 virtual ~SettingsLeveldbStorage(); |
45 | 45 |
46 // SettingsStorage implementation. | 46 // SettingsStorage implementation. |
47 virtual ReadResult Get(const std::string& key) OVERRIDE; | 47 virtual ReadResult Get(const std::string& key) OVERRIDE; |
48 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; | 48 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; |
49 virtual ReadResult Get() OVERRIDE; | 49 virtual ReadResult Get() OVERRIDE; |
50 virtual WriteResult Set(const std::string& key, const Value& value) OVERRIDE; | 50 virtual WriteResult Set( |
51 virtual WriteResult Set(const DictionaryValue& settings) OVERRIDE; | 51 WriteOptions options, |
| 52 const std::string& key, |
| 53 const Value& value) OVERRIDE; |
| 54 virtual WriteResult Set( |
| 55 WriteOptions options, const DictionaryValue& values) OVERRIDE; |
52 virtual WriteResult Remove(const std::string& key) OVERRIDE; | 56 virtual WriteResult Remove(const std::string& key) OVERRIDE; |
53 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; | 57 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; |
54 virtual WriteResult Clear() OVERRIDE; | 58 virtual WriteResult Clear() OVERRIDE; |
55 | 59 |
56 private: | 60 private: |
57 // Ownership of db is taken. | 61 // Ownership of db is taken. |
58 explicit SettingsLeveldbStorage( | 62 explicit SettingsLeveldbStorage( |
59 const FilePath& db_path, leveldb::DB* db); | 63 const FilePath& db_path, leveldb::DB* db); |
60 | 64 |
61 // Reads a setting from the database. Returns whether the read was | 65 // Reads a setting from the database. Returns whether the read was |
(...skipping 13 matching lines...) Expand all Loading... |
75 | 79 |
76 // leveldb backend. | 80 // leveldb backend. |
77 scoped_ptr<leveldb::DB> db_; | 81 scoped_ptr<leveldb::DB> db_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(SettingsLeveldbStorage); | 83 DISALLOW_COPY_AND_ASSIGN(SettingsLeveldbStorage); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace extensions | 86 } // namespace extensions |
83 | 87 |
84 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ | 88 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_LEVELDB_STORAGE_H_ |
OLD | NEW |