| 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 "services/shell/public/cpp/connection.h" | 9 #include "services/shell/public/cpp/connection.h" |
| 10 | 10 |
| 11 namespace leveldb { | 11 namespace leveldb { |
| 12 | 12 |
| 13 LevelDBApp::LevelDBApp() {} | 13 LevelDBApp::LevelDBApp() {} |
| 14 | 14 |
| 15 LevelDBApp::~LevelDBApp() {} | 15 LevelDBApp::~LevelDBApp() {} |
| 16 | 16 |
| 17 void LevelDBApp::OnStart(shell::Connector* connector, | 17 void LevelDBApp::OnStart(const shell::Identity& identity) { |
| 18 const shell::Identity& identity, | 18 tracing_.Initialize(connector(), identity.name()); |
| 19 uint32_t id) { | |
| 20 tracing_.Initialize(connector, identity.name()); | |
| 21 } | 19 } |
| 22 | 20 |
| 23 bool LevelDBApp::OnConnect(shell::Connection* connection) { | 21 bool LevelDBApp::OnConnect(shell::Connection* connection) { |
| 24 connection->AddInterface<mojom::LevelDBService>(this); | 22 connection->AddInterface<mojom::LevelDBService>(this); |
| 25 return true; | 23 return true; |
| 26 } | 24 } |
| 27 | 25 |
| 28 void LevelDBApp::Create(const shell::Identity& remote_identity, | 26 void LevelDBApp::Create(const shell::Identity& remote_identity, |
| 29 leveldb::mojom::LevelDBServiceRequest request) { | 27 leveldb::mojom::LevelDBServiceRequest request) { |
| 30 if (!service_) | 28 if (!service_) |
| 31 service_.reset( | 29 service_.reset( |
| 32 new LevelDBServiceImpl(base::MessageLoop::current()->task_runner())); | 30 new LevelDBServiceImpl(base::MessageLoop::current()->task_runner())); |
| 33 bindings_.AddBinding(service_.get(), std::move(request)); | 31 bindings_.AddBinding(service_.get(), std::move(request)); |
| 34 } | 32 } |
| 35 | 33 |
| 36 } // namespace leveldb | 34 } // namespace leveldb |
| OLD | NEW |