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

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

Issue 1923673002: Run the DOMStorageBrowserTest.SanityCheck against the mojo based implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/browser/dom_storage/dom_storage_browsertest.cc ('k') | content/browser/leveldb_wrapper_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f7ea18a20f7828d30c4d0c4581fc30638bfbb9a..96e2cee81d7cfa739884aba795f18909a534aef5 100644
--- a/content/browser/dom_storage/dom_storage_context_wrapper.cc
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -98,6 +98,15 @@ class DOMStorageContextWrapper::MojoState {
level_db_wrappers_.erase(origin);
}
+ void OnUserServiceConnectionComplete() {
+ CHECK_EQ(shell::mojom::ConnectResult::SUCCEEDED,
+ user_service_connection_->GetResult());
+ }
+
+ void OnUserServiceConnectionError() {
+ CHECK(false);
+ }
+
// Part of our asynchronous directory opening called from OpenLocalStorage().
void OnDirectoryOpened(filesystem::FileError err);
void OnDatabaseOpened(leveldb::DatabaseError status);
@@ -143,6 +152,12 @@ void DOMStorageContextWrapper::MojoState::OpenLocalStorage(
user_service_connection_ =
connector_->Connect(user_service::kUserServiceName);
connection_state_ = CONNECTION_IN_PROGRESS;
+ user_service_connection_->AddConnectionCompletedClosure(
+ base::Bind(&MojoState::OnUserServiceConnectionComplete,
+ weak_ptr_factory_.GetWeakPtr()));
+ user_service_connection_->SetConnectionLostClosure(
+ base::Bind(&MojoState::OnUserServiceConnectionError,
+ weak_ptr_factory_.GetWeakPtr()));
if (!subdirectory_.empty()) {
// We were given a subdirectory to write to. Get it and use a disk backed
« no previous file with comments | « content/browser/dom_storage/dom_storage_browsertest.cc ('k') | content/browser/leveldb_wrapper_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698