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

Unified Diff: components/sync/engine/attachments/on_disk_attachment_store.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/engine/attachments/on_disk_attachment_store.cc
diff --git a/components/sync/engine/attachments/on_disk_attachment_store.cc b/components/sync/engine/attachments/on_disk_attachment_store.cc
index e4f083b40386273a2b7b66cee695fd530255c450..15a83a2593e8f141e29a809c36fd2e24fef37871 100644
--- a/components/sync/engine/attachments/on_disk_attachment_store.cc
+++ b/components/sync/engine/attachments/on_disk_attachment_store.cc
@@ -359,7 +359,6 @@ AttachmentStore::Result OnDiskAttachmentStore::OpenOrCreate(
DCHECK(!db_);
base::FilePath leveldb_path = path.Append(kLeveldbDirectory);
- leveldb::DB* db_raw;
std::unique_ptr<leveldb::DB> db;
leveldb::Options options;
options.create_if_missing = true;
@@ -367,15 +366,13 @@ AttachmentStore::Result OnDiskAttachmentStore::OpenOrCreate(
// TODO(pavely): crbug/424287 Consider adding info_log, block_cache and
// filter_policy to options.
leveldb::Status status =
- leveldb::DB::Open(options, leveldb_path.AsUTF8Unsafe(), &db_raw);
+ leveldb_env::OpenDB(options, leveldb_path.AsUTF8Unsafe(), &db);
if (!status.ok()) {
- DVLOG(1) << "DB::Open failed: status=" << status.ToString()
+ DVLOG(1) << "OpenDB failed: status=" << status.ToString()
<< ", path=" << path.AsUTF8Unsafe();
return AttachmentStore::UNSPECIFIED_ERROR;
}
- db.reset(db_raw);
-
attachment_store_pb::StoreMetadata metadata;
status = ReadStoreMetadata(db.get(), &metadata);
if (!status.ok() && !status.IsNotFound()) {

Powered by Google App Engine
This is Rietveld 408576698