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

Unified Diff: components/sync/model_impl/model_type_store_backend.cc

Issue 2953473002: Use leveldb_env::OpenDB() to open leveldb databases. (Closed)
Patch Set: Rebase; add comments to CHECK() 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: components/sync/model_impl/model_type_store_backend.cc
diff --git a/components/sync/model_impl/model_type_store_backend.cc b/components/sync/model_impl/model_type_store_backend.cc
index a17453122e1be09df40f1d75ed62e4e07d4ae794..45ff1bc267b9875b3961511cd938c7d2cbc9d3e1 100644
--- a/components/sync/model_impl/model_type_store_backend.cc
+++ b/components/sync/model_impl/model_type_store_backend.cc
@@ -178,7 +178,6 @@ ModelTypeStore::Result ModelTypeStoreBackend::Init(
leveldb::Status ModelTypeStoreBackend::OpenDatabase(const std::string& path,
leveldb::Env* env) {
- leveldb::DB* db_raw = nullptr;
leveldb::Options options;
options.create_if_missing = true;
options.reuse_logs = leveldb_env::kDefaultLogReuseOptionValue;
@@ -186,11 +185,7 @@ leveldb::Status ModelTypeStoreBackend::OpenDatabase(const std::string& path,
if (env)
options.env = env;
- leveldb::Status status = leveldb::DB::Open(options, path, &db_raw);
- DCHECK(status.ok() != (db_raw == nullptr));
- if (status.ok())
- db_.reset(db_raw);
- return status;
+ return leveldb_env::OpenDB(options, path, &db_);
}
leveldb::Status ModelTypeStoreBackend::DestroyDatabase(const std::string& path,

Powered by Google App Engine
This is Rietveld 408576698