| Index: content/browser/dom_storage/dom_storage_context_wrapper.cc
|
| diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.cc b/content/browser/dom_storage/dom_storage_context_wrapper.cc
|
| index cfacb08805622497391c1d4feb058bef9c7e506c..d2343e0b9bf4497510356268a956bfe545f875f4 100644
|
| --- a/content/browser/dom_storage/dom_storage_context_wrapper.cc
|
| +++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
|
| @@ -140,14 +140,26 @@ void DOMStorageContextWrapper::MojoState::OpenLocalStorage(
|
| if (connection_state_ == NO_CONNECTION) {
|
| profile_app_connection_ = MojoAppConnection::Create(
|
| mojo_user_id_, "mojo:profile", kBrowserMojoAppUrl);
|
| - profile_app_connection_->GetInterface(&profile_service_);
|
|
|
| - profile_service_->GetSubDirectory(
|
| - mojo::String::From(subdirectory_.AsUTF8Unsafe()),
|
| - GetProxy(&directory_),
|
| - base::Bind(&MojoState::OnDirectoryOpened,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| connection_state_ = CONNECTION_IN_PROGRESS;
|
| +
|
| + if (!subdirectory_.empty()) {
|
| + // We were given a subdirectory to write to. Get it and use a disk backed
|
| + // database.
|
| + profile_app_connection_->GetInterface(&profile_service_);
|
| + profile_service_->GetSubDirectory(
|
| + mojo::String::From(subdirectory_.AsUTF8Unsafe()),
|
| + GetProxy(&directory_),
|
| + base::Bind(&MojoState::OnDirectoryOpened,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| + } else {
|
| + // We were not given a subdirectory. Use a memory backed database.
|
| + profile_app_connection_->GetInterface(&leveldb_service_);
|
| + leveldb_service_->OpenInMemory(
|
| + GetProxy(&database_),
|
| + base::Bind(&MojoState::OnDatabaseOpened,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| + }
|
| }
|
|
|
| if (connection_state_ == CONNECTION_IN_PROGRESS) {
|
|
|