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

Unified Diff: components/profile_service/profile_app.cc

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add OWNERS file by request. Created 4 years, 9 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/profile_service/profile_app.cc
diff --git a/components/profile_service/profile_app.cc b/components/profile_service/profile_app.cc
index 27491db5e910d27946721e9031860a493591c71b..33718001f4e5b09522c36486dc28e3ae0cd0a740 100644
--- a/components/profile_service/profile_app.cc
+++ b/components/profile_service/profile_app.cc
@@ -6,6 +6,7 @@
#include "base/lazy_instance.h"
#include "components/leveldb/leveldb_service_impl.h"
+#include "components/profile_service/leveldb_thread.h"
#include "components/profile_service/profile_service_impl.h"
#include "mojo/shell/public/cpp/connection.h"
@@ -39,7 +40,6 @@ void ProfileApp::Initialize(mojo::Connector* connector,
const mojo::Identity& identity,
uint32_t id) {
tracing_.Initialize(connector, identity.name());
- leveldb_service_.reset(new leveldb::LevelDBServiceImpl);
auto it = g_user_id_to_data_dir.Get().find(identity.user_id());
DCHECK(it != g_user_id_to_data_dir.Get().end());
@@ -57,13 +57,22 @@ void ProfileApp::Create(mojo::Connection* connection,
// No, we need one of these per connection.
new ProfileServiceImpl(connection,
std::move(request),
+ ref_factory_.CreateRef(),
profile_data_dir_,
lock_table_.get());
}
-void ProfileApp::Create(mojo::Connection* connection,
- leveldb::LevelDBServiceRequest request) {
- leveldb_bindings_.AddBinding(leveldb_service_.get(), std::move(request));
+void ProfileApp::Create(
+ mojo::Connection* connection,
Ben Goodger (Google) 2016/03/11 23:21:38 up to prev line
michaeln 2016/03/16 03:11:12 what is |connection| used for in this method?
Elliot Glaysher 2016/03/17 19:29:44 Nothing, but it's part of the virtual interface si
+ leveldb::LevelDBServiceRequest request) {
Ben Goodger (Google) 2016/03/11 23:21:38 indent over
+ if (!leveldb_thread_) {
michaeln 2016/03/16 03:11:12 if OnServiceError() with empty bindings had alread
+ leveldb_thread_ = new LevelDBThread(
+ ref_factory_.CreateRef(),
+ std::move(request));
+ } else {
+ // We need to pass this binding to the leveldb thread.
+ leveldb_thread_->BindNewRequest(std::move(request));
+ }
}
} // namespace profile

Powered by Google App Engine
This is Rietveld 408576698