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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 service_factory_bindings_.set_connection_error_handler(error_handler); | 174 service_factory_bindings_.set_connection_error_handler(error_handler); |
175 } | 175 } |
176 | 176 |
177 bool OnConnect(const ServiceInfo& remote_info, | 177 bool OnConnect(const ServiceInfo& remote_info, |
178 InterfaceRegistry* registry) override { | 178 InterfaceRegistry* registry) override { |
179 registry->AddInterface<ServiceFactory>(this); | 179 registry->AddInterface<ServiceFactory>(this); |
180 registry->AddInterface<test::mojom::ConnectTestService>(this); | 180 registry->AddInterface<test::mojom::ConnectTestService>(this); |
181 return true; | 181 return true; |
182 } | 182 } |
183 | 183 |
184 bool OnStop() override { | 184 bool OnServiceManagerConnectionLost() override { |
185 provided_services_.clear(); | 185 provided_services_.clear(); |
186 return true; | 186 return true; |
187 } | 187 } |
188 | 188 |
189 // InterfaceFactory<mojom::ServiceFactory>: | 189 // InterfaceFactory<mojom::ServiceFactory>: |
190 void Create(const Identity& remote_identity, | 190 void Create(const Identity& remote_identity, |
191 mojom::ServiceFactoryRequest request) override { | 191 mojom::ServiceFactoryRequest request) override { |
192 service_factory_bindings_.AddBinding(this, std::move(request)); | 192 service_factory_bindings_.AddBinding(this, std::move(request)); |
193 } | 193 } |
194 | 194 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 232 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
233 }; | 233 }; |
234 | 234 |
235 } // namespace service_manager | 235 } // namespace service_manager |
236 | 236 |
237 MojoResult ServiceMain(MojoHandle service_request_handle) { | 237 MojoResult ServiceMain(MojoHandle service_request_handle) { |
238 service_manager::ServiceRunner runner( | 238 service_manager::ServiceRunner runner( |
239 new service_manager::ConnectTestService); | 239 new service_manager::ConnectTestService); |
240 return runner.Run(service_request_handle); | 240 return runner.Run(service_request_handle); |
241 } | 241 } |
OLD | NEW |