OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/leveldb/leveldb_app.h" | 5 #include "components/leveldb/leveldb_app.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "components/leveldb/leveldb_service_impl.h" | 8 #include "components/leveldb/leveldb_service_impl.h" |
9 #include "mojo/shell/public/cpp/connection.h" | 9 #include "mojo/shell/public/cpp/connection.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) { | 23 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) { |
24 connection->AddInterface<LevelDBService>(this); | 24 connection->AddInterface<LevelDBService>(this); |
25 return true; | 25 return true; |
26 } | 26 } |
27 | 27 |
28 void LevelDBApp::Create(mojo::Connection* connection, | 28 void LevelDBApp::Create(mojo::Connection* connection, |
29 leveldb::LevelDBServiceRequest request) { | 29 leveldb::LevelDBServiceRequest request) { |
30 if (!service_) | 30 if (!service_) |
31 service_.reset(new LevelDBServiceImpl); | 31 service_.reset( |
| 32 new LevelDBServiceImpl(base::MessageLoop::current()->task_runner())); |
32 bindings_.AddBinding(service_.get(), std::move(request)); | 33 bindings_.AddBinding(service_.get(), std::move(request)); |
33 } | 34 } |
34 | 35 |
35 } // namespace leveldb | 36 } // namespace leveldb |
OLD | NEW |