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

Unified Diff: content/browser/dom_storage/local_storage_context_mojo.cc

Issue 2597983003: Add tests for how LocalStorageContextMojo interacts with file/leveldb services. (Closed)
Patch Set: reapply change that got lost during rebase Created 4 years 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
« no previous file with comments | « no previous file | content/browser/dom_storage/local_storage_context_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/local_storage_context_mojo.cc
diff --git a/content/browser/dom_storage/local_storage_context_mojo.cc b/content/browser/dom_storage/local_storage_context_mojo.cc
index 241daeddff43a13c0a40d48c83b9f391f26d3ce6..fa68355acc9aff1da5c02d93014a3a40695257dc 100644
--- a/content/browser/dom_storage/local_storage_context_mojo.cc
+++ b/content/browser/dom_storage/local_storage_context_mojo.cc
@@ -141,10 +141,13 @@ void LocalStorageContextMojo::OnDirectoryOpened(
// database.
file_service_connection_->GetInterface(&leveldb_service_);
- leveldb_service_->Open(std::move(directory_), "leveldb",
- MakeRequest(&database_),
- base::Bind(&LocalStorageContextMojo::OnDatabaseOpened,
- weak_ptr_factory_.GetWeakPtr()));
+ auto options = leveldb::mojom::OpenOptions::New();
+ options->create_if_missing = true;
+ leveldb_service_->OpenWithOptions(
+ std::move(options), std::move(directory_), "leveldb",
+ MakeRequest(&database_),
+ base::Bind(&LocalStorageContextMojo::OnDatabaseOpened,
+ weak_ptr_factory_.GetWeakPtr()));
}
void LocalStorageContextMojo::OnDatabaseOpened(
« no previous file with comments | « no previous file | content/browser/dom_storage/local_storage_context_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698