| 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 #ifndef COMPONENTS_LEVELDB_LEVELDB_APP_H_ | 5 #ifndef COMPONENTS_LEVELDB_LEVELDB_APP_H_ |
| 6 #define COMPONENTS_LEVELDB_LEVELDB_APP_H_ | 6 #define COMPONENTS_LEVELDB_LEVELDB_APP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "components/leveldb/public/interfaces/leveldb.mojom.h" | 10 #include "components/leveldb/public/interfaces/leveldb.mojom.h" |
| 11 #include "mojo/public/cpp/bindings/binding_set.h" | 11 #include "mojo/public/cpp/bindings/binding_set.h" |
| 12 #include "services/shell/public/cpp/interface_factory.h" | 12 #include "services/shell/public/cpp/interface_factory.h" |
| 13 #include "services/shell/public/cpp/service.h" | 13 #include "services/shell/public/cpp/service.h" |
| 14 #include "services/tracing/public/cpp/tracing_impl.h" | 14 #include "services/tracing/public/cpp/tracing_impl.h" |
| 15 | 15 |
| 16 namespace leveldb { | 16 namespace leveldb { |
| 17 | 17 |
| 18 class LevelDBApp : public shell::Service, | 18 class LevelDBApp : public shell::Service, |
| 19 public shell::InterfaceFactory<mojom::LevelDBService> { | 19 public shell::InterfaceFactory<mojom::LevelDBService> { |
| 20 public: | 20 public: |
| 21 LevelDBApp(); | 21 LevelDBApp(); |
| 22 ~LevelDBApp() override; | 22 ~LevelDBApp() override; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // |Service| override: | 25 // |Service| override: |
| 26 void OnStart(shell::Connector* connector, | 26 void OnStart(const shell::Identity& identity) override; |
| 27 const shell::Identity& identity, | |
| 28 uint32_t id) override; | |
| 29 bool OnConnect(shell::Connection* connection) override; | 27 bool OnConnect(shell::Connection* connection) override; |
| 30 | 28 |
| 31 // |InterfaceFactory<mojom::LevelDBService>| implementation: | 29 // |InterfaceFactory<mojom::LevelDBService>| implementation: |
| 32 void Create(const shell::Identity& remote_identity, | 30 void Create(const shell::Identity& remote_identity, |
| 33 leveldb::mojom::LevelDBServiceRequest request) override; | 31 leveldb::mojom::LevelDBServiceRequest request) override; |
| 34 | 32 |
| 35 mojo::TracingImpl tracing_; | 33 mojo::TracingImpl tracing_; |
| 36 std::unique_ptr<mojom::LevelDBService> service_; | 34 std::unique_ptr<mojom::LevelDBService> service_; |
| 37 mojo::BindingSet<mojom::LevelDBService> bindings_; | 35 mojo::BindingSet<mojom::LevelDBService> bindings_; |
| 38 | 36 |
| 39 DISALLOW_COPY_AND_ASSIGN(LevelDBApp); | 37 DISALLOW_COPY_AND_ASSIGN(LevelDBApp); |
| 40 }; | 38 }; |
| 41 | 39 |
| 42 } // namespace leveldb | 40 } // namespace leveldb |
| 43 | 41 |
| 44 #endif // COMPONENTS_LEVELDB_LEVELDB_APP_H_ | 42 #endif // COMPONENTS_LEVELDB_LEVELDB_APP_H_ |
| OLD | NEW |