Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: services/service_manager/tests/lifecycle/app_client.h

Issue 2480603004: Service Manager: Implement graceful service termination (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 14 matching lines...) Expand all
25 public: 25 public:
26 AppClient(); 26 AppClient();
27 ~AppClient() override; 27 ~AppClient() override;
28 28
29 void set_runner(ServiceRunner* runner) { runner_ = runner; } 29 void set_runner(ServiceRunner* runner) { runner_ = runner; }
30 30
31 // Serivce: 31 // Serivce:
32 void OnStart(ServiceContext* context) override; 32 void OnStart(ServiceContext* context) override;
33 bool OnConnect(const ServiceInfo& remote_info, 33 bool OnConnect(const ServiceInfo& remote_info,
34 InterfaceRegistry* registry) override; 34 InterfaceRegistry* registry) override;
35 bool OnStop() override;
35 36
36 // InterfaceFactory<LifecycleControl>: 37 // InterfaceFactory<LifecycleControl>:
37 void Create(const Identity& remote_identity, 38 void Create(const Identity& remote_identity,
38 mojom::LifecycleControlRequest request) override; 39 mojom::LifecycleControlRequest request) override;
39 40
40 // LifecycleControl: 41 // LifecycleControl:
41 void Ping(const PingCallback& callback) override; 42 void Ping(const PingCallback& callback) override;
42 void GracefulQuit() override; 43 void GracefulQuit() override;
43 void Crash() override; 44 void Crash() override;
44 void CloseServiceManagerConnection() override; 45 void CloseServiceManagerConnection() override;
45 46
46 private: 47 private:
47 class ServiceImpl; 48 class ServiceImpl;
48 49
49 void BindingLost(); 50 void BindingLost();
50 51
51 ServiceContext* context_; 52 ServiceContext* context_;
52 ServiceRunner* runner_ = nullptr; 53 ServiceRunner* runner_ = nullptr;
53 mojo::BindingSet<mojom::LifecycleControl> bindings_; 54 mojo::BindingSet<mojom::LifecycleControl> bindings_;
54 55
55 DISALLOW_COPY_AND_ASSIGN(AppClient); 56 DISALLOW_COPY_AND_ASSIGN(AppClient);
56 }; 57 };
57 58
58 } // namespace test 59 } // namespace test
59 } // namespace service_manager 60 } // namespace service_manager
60 61
61 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ 62 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698