Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: components/leveldb_proto/leveldb_database.h

Issue 2049573003: Implement ProtoDatabase::GetEntry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not found vs error Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/leveldb_proto/leveldb_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ 5 #ifndef COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_
6 #define COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ 6 #define COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 // change once shipped. 37 // change once shipped.
38 explicit LevelDB(const char* client_name); 38 explicit LevelDB(const char* client_name);
39 virtual ~LevelDB(); 39 virtual ~LevelDB();
40 40
41 virtual bool InitWithOptions(const base::FilePath& database_dir, 41 virtual bool InitWithOptions(const base::FilePath& database_dir,
42 const leveldb::Options& options); 42 const leveldb::Options& options);
43 virtual bool Init(const base::FilePath& database_dir); 43 virtual bool Init(const base::FilePath& database_dir);
44 virtual bool Save(const base::StringPairs& pairs_to_save, 44 virtual bool Save(const base::StringPairs& pairs_to_save,
45 const std::vector<std::string>& keys_to_remove); 45 const std::vector<std::string>& keys_to_remove);
46 virtual bool Load(std::vector<std::string>* entries); 46 virtual bool Load(std::vector<std::string>* entries);
47 virtual bool Get(const std::string& key, bool* found, std::string* entry);
47 48
48 static bool Destroy(const base::FilePath& database_dir); 49 static bool Destroy(const base::FilePath& database_dir);
49 50
50 private: 51 private:
51 DFAKE_MUTEX(thread_checker_); 52 DFAKE_MUTEX(thread_checker_);
52 53
53 // The declaration order of these members matters: |db_| depends on |env_| and 54 // The declaration order of these members matters: |db_| depends on |env_| and
54 // therefore has to be destructed first. 55 // therefore has to be destructed first.
55 std::unique_ptr<leveldb::Env> env_; 56 std::unique_ptr<leveldb::Env> env_;
56 std::unique_ptr<leveldb::DB> db_; 57 std::unique_ptr<leveldb::DB> db_;
57 base::HistogramBase* open_histogram_; 58 base::HistogramBase* open_histogram_;
58 59
59 DISALLOW_COPY_AND_ASSIGN(LevelDB); 60 DISALLOW_COPY_AND_ASSIGN(LevelDB);
60 }; 61 };
61 62
62 } // namespace leveldb_proto 63 } // namespace leveldb_proto
63 64
64 #endif // COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_ 65 #endif // COMPONENTS_LEVELDB_PROTO_LEVELDB_DATABASE_H_
OLDNEW
« no previous file with comments | « no previous file | components/leveldb_proto/leveldb_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698