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

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

Issue 2701883002: service_manager: More consistent Service lifecycle API (Closed)
Patch Set: . Created 3 years, 10 months 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 13 matching lines...) Expand all
24 public mojom::LifecycleControl { 24 public mojom::LifecycleControl {
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 // Service: 31 // Service:
32 bool OnConnect(const ServiceInfo& remote_info, 32 bool OnConnect(const ServiceInfo& remote_info,
33 InterfaceRegistry* registry) override; 33 InterfaceRegistry* registry) override;
34 bool OnStop() override; 34 bool OnServiceManagerConnectionLost() override;
35 35
36 // InterfaceFactory<LifecycleControl>: 36 // InterfaceFactory<LifecycleControl>:
37 void Create(const Identity& remote_identity, 37 void Create(const Identity& remote_identity,
38 mojom::LifecycleControlRequest request) override; 38 mojom::LifecycleControlRequest request) override;
39 39
40 // LifecycleControl: 40 // LifecycleControl:
41 void Ping(const PingCallback& callback) override; 41 void Ping(const PingCallback& callback) override;
42 void GracefulQuit() override; 42 void GracefulQuit() override;
43 void Crash() override; 43 void Crash() override;
44 void CloseServiceManagerConnection() override; 44 void CloseServiceManagerConnection() override;
45 45
46 private: 46 private:
47 class ServiceImpl; 47 class ServiceImpl;
48 48
49 void BindingLost(); 49 void BindingLost();
50 50
51 ServiceRunner* runner_ = nullptr; 51 ServiceRunner* runner_ = nullptr;
52 mojo::BindingSet<mojom::LifecycleControl> bindings_; 52 mojo::BindingSet<mojom::LifecycleControl> bindings_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(AppClient); 54 DISALLOW_COPY_AND_ASSIGN(AppClient);
55 }; 55 };
56 56
57 } // namespace test 57 } // namespace test
58 } // namespace service_manager 58 } // namespace service_manager
59 59
60 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_ 60 #endif // SERVICES_SERVICE_MANAGER_TESTS_LIFECYCLE_APP_CLIENT_H_
OLDNEW
« no previous file with comments | « services/service_manager/tests/connect/connect_test_package.cc ('k') | services/service_manager/tests/lifecycle/app_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698