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

Unified Diff: components/leveldb/leveldb_app.h

Issue 1720603002: Revert of mojo: Get mojo:leveldb and mojo:filesystem compiled into content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « components/leveldb/leveldb.gyp ('k') | components/leveldb/leveldb_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb/leveldb_app.h
diff --git a/components/leveldb/leveldb_app.h b/components/leveldb/leveldb_app.h
index 7f5157a4f6bc36b6517a904d5d48bed5146685d5..64cec0b7a97741bbe73e4836c692e1fe8a8a30b3 100644
--- a/components/leveldb/leveldb_app.h
+++ b/components/leveldb/leveldb_app.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_LEVELDB_LEVELDB_APP_H_
#define COMPONENTS_LEVELDB_LEVELDB_APP_H_
+#include "components/leveldb/leveldb_file_thread.h"
#include "components/leveldb/public/interfaces/leveldb.mojom.h"
#include "mojo/public/cpp/bindings/weak_binding_set.h"
#include "mojo/services/tracing/public/cpp/tracing_impl.h"
@@ -14,7 +15,8 @@
namespace leveldb {
class LevelDBApp : public mojo::ShellClient,
- public mojo::InterfaceFactory<LevelDBService> {
+ public mojo::InterfaceFactory<LevelDBService>,
+ public LevelDBService {
public:
LevelDBApp();
~LevelDBApp() override;
@@ -33,9 +35,19 @@
void Create(mojo::Connection* connection,
mojo::InterfaceRequest<LevelDBService> request) override;
+ // Overridden from LevelDBService:
+ void Open(filesystem::DirectoryPtr directory,
+ const mojo::String& dbname,
+ mojo::InterfaceRequest<LevelDBDatabase> database,
+ const OpenCallback& callback) override;
+
mojo::TracingImpl tracing_;
- scoped_ptr<LevelDBService> service_;
mojo::WeakBindingSet<LevelDBService> bindings_;
+
+ // Thread to own the mojo message pipe. Because leveldb spawns multiple
+ // threads that want to call file stuff, we create a dedicated thread to send
+ // and receive mojo message calls.
+ scoped_refptr<LevelDBFileThread> thread_;
DISALLOW_COPY_AND_ASSIGN(LevelDBApp);
};
« no previous file with comments | « components/leveldb/leveldb.gyp ('k') | components/leveldb/leveldb_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698