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

Unified Diff: chrome/browser/android/history_report/delta_file_backend_leveldb.cc

Issue 2953473002: Use leveldb_env::OpenDB() to open leveldb databases. (Closed)
Patch Set: Use OpenDB in unittests; add allocation edges Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/history_report/delta_file_backend_leveldb.cc
diff --git a/chrome/browser/android/history_report/delta_file_backend_leveldb.cc b/chrome/browser/android/history_report/delta_file_backend_leveldb.cc
index 1ded0791c45f9aea74dd393fd96963e4415f9a48..20c78809d242d55bbc28be27045b0b0a942ab772 100644
--- a/chrome/browser/android/history_report/delta_file_backend_leveldb.cc
+++ b/chrome/browser/android/history_report/delta_file_backend_leveldb.cc
@@ -95,16 +95,14 @@ bool DeltaFileBackend::Init() {
options.max_open_files = 0; // Use minimum number of files.
options.comparator = leveldb_cmp_.get();
std::string path = path_.value();
- leveldb::DB* db = NULL;
- leveldb::Status status = leveldb::DB::Open(options, path, &db);
+ leveldb::Status status = leveldb_env::OpenDB(options, path, &db_);
if (status.IsCorruption()) {
LOG(WARNING) << "Deleting possibly-corrupt database";
base::DeleteFile(path_, true);
- status = leveldb::DB::Open(options, path, &db);
+ status = leveldb_env::OpenDB(options, path, &db_);
}
if (status.ok()) {
- CHECK(db);
- db_.reset(db);
+ CHECK(db_);
return true;
}
LOG(WARNING) << "Unable to open " << path_.value() << ": "

Powered by Google App Engine
This is Rietveld 408576698