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

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

Issue 2435153004: Change Service contract to pass ServiceInfo instead of Identity (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 #include "services/service_manager/tests/lifecycle/app_client.h" 5 #include "services/service_manager/tests/lifecycle/app_client.h"
6 6
7 #include "services/service_manager/public/cpp/interface_registry.h" 7 #include "services/service_manager/public/cpp/interface_registry.h"
8 #include "services/service_manager/public/cpp/service_context.h" 8 #include "services/service_manager/public/cpp/service_context.h"
9 9
10 namespace service_manager { 10 namespace service_manager {
11 namespace test { 11 namespace test {
12 12
13 AppClient::AppClient() {} 13 AppClient::AppClient() {}
14 AppClient::AppClient(service_manager::mojom::ServiceRequest request) 14 AppClient::AppClient(service_manager::mojom::ServiceRequest request)
15 : context_(new ServiceContext(this, std::move(request))) {} 15 : context_(new ServiceContext(this, std::move(request))) {}
16 AppClient::~AppClient() {} 16 AppClient::~AppClient() {}
17 17
18 bool AppClient::OnConnect(const Identity& remote_identity, 18 bool AppClient::OnConnect(const ServiceInfo& remote_info,
19 InterfaceRegistry* registry) { 19 InterfaceRegistry* registry) {
20 registry->AddInterface<LifecycleControl>(this); 20 registry->AddInterface<LifecycleControl>(this);
21 return true; 21 return true;
22 } 22 }
23 23
24 void AppClient::Create(const Identity& remote_identity, 24 void AppClient::Create(const Identity& remote_identity,
25 LifecycleControlRequest request) { 25 LifecycleControlRequest request) {
26 bindings_.AddBinding(this, std::move(request)); 26 bindings_.AddBinding(this, std::move(request));
27 } 27 }
28 28
(...skipping 20 matching lines...) Expand all
49 base::Bind(&AppClient::BindingLost, base::Unretained(this))); 49 base::Bind(&AppClient::BindingLost, base::Unretained(this)));
50 } 50 }
51 51
52 void AppClient::BindingLost() { 52 void AppClient::BindingLost() {
53 if (bindings_.empty()) 53 if (bindings_.empty())
54 GracefulQuit(); 54 GracefulQuit();
55 } 55 }
56 56
57 } // namespace test 57 } // namespace test
58 } // namespace service_manager 58 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/tests/lifecycle/app_client.h ('k') | services/service_manager/tests/lifecycle/package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698