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 "components/leveldb/leveldb_service_impl.h" | 7 #include "components/leveldb/leveldb_service_impl.h" |
8 #include "mojo/shell/public/cpp/connection.h" | 8 #include "mojo/shell/public/cpp/connection.h" |
9 | 9 |
10 namespace leveldb { | 10 namespace leveldb { |
11 | 11 |
| 12 scoped_ptr<mojo::ShellClient> CreateLevelDBApp() { |
| 13 return make_scoped_ptr(new LevelDBApp); |
| 14 } |
| 15 |
12 LevelDBApp::LevelDBApp() {} | 16 LevelDBApp::LevelDBApp() {} |
13 | 17 |
14 LevelDBApp::~LevelDBApp() {} | 18 LevelDBApp::~LevelDBApp() {} |
15 | 19 |
16 void LevelDBApp::Initialize(mojo::Shell* shell, | 20 void LevelDBApp::Initialize(mojo::Shell* shell, |
17 const std::string& url, | 21 const std::string& url, |
18 uint32_t id, | 22 uint32_t id, |
19 uint32_t user_id) { | 23 uint32_t user_id) { |
20 tracing_.Initialize(shell, url); | 24 tracing_.Initialize(shell, url); |
21 service_.reset(new LevelDBServiceImpl); | 25 service_.reset(new LevelDBServiceImpl); |
22 } | 26 } |
23 | 27 |
24 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) { | 28 bool LevelDBApp::AcceptConnection(mojo::Connection* connection) { |
25 connection->AddInterface<LevelDBService>(this); | 29 connection->AddInterface<LevelDBService>(this); |
26 return true; | 30 return true; |
27 } | 31 } |
28 | 32 |
29 void LevelDBApp::Create(mojo::Connection* connection, | 33 void LevelDBApp::Create(mojo::Connection* connection, |
30 mojo::InterfaceRequest<LevelDBService> request) { | 34 mojo::InterfaceRequest<LevelDBService> request) { |
31 bindings_.AddBinding(service_.get(), std::move(request)); | 35 bindings_.AddBinding(service_.get(), std::move(request)); |
32 } | 36 } |
33 | 37 |
34 } // namespace leveldb | 38 } // namespace leveldb |
OLD | NEW |