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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "mojo/public/cpp/bindings/binding_set.h" | 7 #include "mojo/public/cpp/bindings/binding_set.h" |
8 #include "services/service_manager/public/c/main.h" | 8 #include "services/service_manager/public/c/main.h" |
9 #include "services/service_manager/public/cpp/binder_registry.h" | 9 #include "services/service_manager/public/cpp/binder_registry.h" |
10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public mojom::ShutdownTestClientController, | 22 public mojom::ShutdownTestClientController, |
23 public mojom::ShutdownTestClient { | 23 public mojom::ShutdownTestClient { |
24 public: | 24 public: |
25 ShutdownClientApp() { | 25 ShutdownClientApp() { |
26 registry_.AddInterface<mojom::ShutdownTestClientController>(this); | 26 registry_.AddInterface<mojom::ShutdownTestClientController>(this); |
27 } | 27 } |
28 ~ShutdownClientApp() override {} | 28 ~ShutdownClientApp() override {} |
29 | 29 |
30 private: | 30 private: |
31 // service_manager::Service: | 31 // service_manager::Service: |
32 void OnBindInterface(const ServiceInfo& source_info, | 32 void OnBindInterface(const BindSourceInfo& source_info, |
33 const std::string& interface_name, | 33 const std::string& interface_name, |
34 mojo::ScopedMessagePipeHandle interface_pipe) override { | 34 mojo::ScopedMessagePipeHandle interface_pipe) override { |
35 registry_.BindInterface(source_info.identity, interface_name, | 35 registry_.BindInterface(source_info.identity, interface_name, |
36 std::move(interface_pipe)); | 36 std::move(interface_pipe)); |
37 } | 37 } |
38 | 38 |
39 // InterfaceFactory<mojom::ShutdownTestClientController>: | 39 // InterfaceFactory<mojom::ShutdownTestClientController>: |
40 void Create(const Identity& remote_identity, | 40 void Create(const Identity& remote_identity, |
41 mojom::ShutdownTestClientControllerRequest request) override { | 41 mojom::ShutdownTestClientControllerRequest request) override { |
42 bindings_.AddBinding(this, std::move(request)); | 42 bindings_.AddBinding(this, std::move(request)); |
(...skipping 25 matching lines...) Expand all Loading... |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp); | 69 DISALLOW_COPY_AND_ASSIGN(ShutdownClientApp); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace service_manager | 72 } // namespace service_manager |
73 | 73 |
74 MojoResult ServiceMain(MojoHandle service_request_handle) { | 74 MojoResult ServiceMain(MojoHandle service_request_handle) { |
75 service_manager::ServiceRunner runner(new service_manager::ShutdownClientApp); | 75 service_manager::ServiceRunner runner(new service_manager::ShutdownClientApp); |
76 return runner.Run(service_request_handle); | 76 return runner.Run(service_request_handle); |
77 } | 77 } |
OLD | NEW |