Chromium Code Reviews| 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_EXTENSION_SETTINGS_LEVELDB_STORAGE_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_LEVELDB_STORAGE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/scoped_ptr.h" | |
| 10 #include "chrome/browser/extensions/extension_settings_storage.h" | |
| 11 #include "third_party/leveldb/include/leveldb/db.h" | |
| 12 | |
| 13 // Extension settings storage object, backed by a leveldb database. | |
| 14 // No caching is done; that should be handled by wrapping with an | |
| 15 // ExtensionSettingsStorageCache. | |
| 16 class ExtensionSettingsLeveldbStorage : public ExtensionSettingsStorage { | |
| 17 public: | |
| 18 // Ownership of db is taken. | |
| 19 explicit ExtensionSettingsLeveldbStorage(leveldb::DB* db); | |
| 20 ~ExtensionSettingsLeveldbStorage() {} | |
|
dgrogan
2011/06/18 01:54:40
I was going to comment that this needs to be delet
not at google - send to devlin
2011/06/20 05:33:11
I don't see why not. A crash is a crash, whether
| |
| 21 | |
| 22 int type() { return LEVELDB; } | |
| 23 | |
| 24 void Get(const std::string& key, Callback* callback); | |
| 25 void Get(const ListValue& keys, Callback* callback); | |
| 26 void Get(Callback* callback); | |
| 27 void Set(const std::string& key, const Value& value, Callback* callback); | |
| 28 void Set(const DictionaryValue& values, Callback* callback); | |
| 29 void Remove(const std::string& key, Callback* callback); | |
| 30 void Remove(const ListValue& keys, Callback* callback); | |
| 31 void Clear(Callback *callback); | |
| 32 | |
| 33 private: | |
| 34 scoped_ptr<leveldb::DB> db_; | |
| 35 }; | |
| 36 | |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_LEVELDB_STORAGE_H_ | |
| OLD | NEW |