Index: components/leveldb/leveldb_service_impl.h |
diff --git a/components/leveldb/leveldb_service_impl.h b/components/leveldb/leveldb_service_impl.h |
index 54b2942eba24fcf5a2d1d6a3c39529d4ac165a8a..85f2ff4769bf9f03dbba8ea367411e69b1dee6ec 100644 |
--- a/components/leveldb/leveldb_service_impl.h |
+++ b/components/leveldb/leveldb_service_impl.h |
@@ -9,12 +9,16 @@ |
#include "components/leveldb/leveldb_file_thread.h" |
#include "components/leveldb/public/interfaces/leveldb.mojom.h" |
+namespace mojo { |
+class MessageLoopRef; |
+} |
+ |
namespace leveldb { |
// Creates LevelDBDatabases based scoped to a |directory|/|dbname|. |
class LevelDBServiceImpl : public LevelDBService { |
public: |
- LevelDBServiceImpl(); |
+ explicit LevelDBServiceImpl(scoped_ptr<mojo::MessageLoopRef> ref); |
~LevelDBServiceImpl() override; |
// Overridden from LevelDBService: |
@@ -24,6 +28,9 @@ class LevelDBServiceImpl : public LevelDBService { |
const OpenCallback& callback) override; |
private: |
+ // Causes our application to quit when we go out of scope. |
+ scoped_ptr<mojo::MessageLoopRef> message_loop_ref_; |
+ |
// 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. |