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