| Index: components/leveldb_proto/leveldb_database.cc
|
| diff --git a/components/leveldb_proto/leveldb_database.cc b/components/leveldb_proto/leveldb_database.cc
|
| index 6a8586f87059b0697cde433968e58676a9a77004..0b31e51c66146b10b69b57130006069798229339 100644
|
| --- a/components/leveldb_proto/leveldb_database.cc
|
| +++ b/components/leveldb_proto/leveldb_database.cc
|
| @@ -123,6 +123,21 @@ bool LevelDB::Load(std::vector<std::string>* entries) {
|
| return true;
|
| }
|
|
|
| +bool LevelDB::LoadKeys(std::vector<std::string>* keys) {
|
| + DFAKE_SCOPED_LOCK(thread_checker_);
|
| + if (!db_)
|
| + return false;
|
| +
|
| + leveldb::ReadOptions options;
|
| + options.fill_cache = false;
|
| + std::unique_ptr<leveldb::Iterator> db_iterator(db_->NewIterator(options));
|
| + for (db_iterator->SeekToFirst(); db_iterator->Valid(); db_iterator->Next()) {
|
| + leveldb::Slice key_slice = db_iterator->key();
|
| + keys->push_back(std::string(key_slice.data(), key_slice.size()));
|
| + }
|
| + return true;
|
| +}
|
| +
|
| bool LevelDB::Get(const std::string& key, bool* found, std::string* entry) {
|
| DFAKE_SCOPED_LOCK(thread_checker_);
|
| if (!db_)
|
|
|