| 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 SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 6 #define SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 AppClient(); | 32 AppClient(); |
| 33 explicit AppClient(service_manager::mojom::ServiceRequest request); | 33 explicit AppClient(service_manager::mojom::ServiceRequest request); |
| 34 ~AppClient() override; | 34 ~AppClient() override; |
| 35 | 35 |
| 36 void set_runner(ServiceRunner* runner) { | 36 void set_runner(ServiceRunner* runner) { |
| 37 runner_ = runner; | 37 runner_ = runner; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Service: | 40 // Service: |
| 41 bool OnConnect(const Identity& remote_identity, | 41 bool OnConnect(const ServiceInfo& remote_info, |
| 42 InterfaceRegistry* registry) override; | 42 InterfaceRegistry* registry) override; |
| 43 | 43 |
| 44 // InterfaceFactory<LifecycleControl>: | 44 // InterfaceFactory<LifecycleControl>: |
| 45 void Create(const Identity& remote_identity, | 45 void Create(const Identity& remote_identity, |
| 46 LifecycleControlRequest request) override; | 46 LifecycleControlRequest request) override; |
| 47 | 47 |
| 48 // LifecycleControl: | 48 // LifecycleControl: |
| 49 void Ping(const PingCallback& callback) override; | 49 void Ping(const PingCallback& callback) override; |
| 50 void GracefulQuit() override; | 50 void GracefulQuit() override; |
| 51 void Crash() override; | 51 void Crash() override; |
| 52 void CloseServiceManagerConnection() override; | 52 void CloseServiceManagerConnection() override; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 void BindingLost(); | 55 void BindingLost(); |
| 56 | 56 |
| 57 ServiceRunner* runner_ = nullptr; | 57 ServiceRunner* runner_ = nullptr; |
| 58 mojo::BindingSet<LifecycleControl> bindings_; | 58 mojo::BindingSet<LifecycleControl> bindings_; |
| 59 std::unique_ptr<ServiceContext> context_; | 59 std::unique_ptr<ServiceContext> context_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(AppClient); | 61 DISALLOW_COPY_AND_ASSIGN(AppClient); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace test | 64 } // namespace test |
| 65 } // namespace service_manager | 65 } // namespace service_manager |
| 66 | 66 |
| 67 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ | 67 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ |
| OLD | NEW |