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

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

Issue 2850743004: Replace ServiceInfo with BindSourceInfo. (Closed)
Patch Set: . Created 3 years, 7 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 #include "services/service_manager/tests/lifecycle/app_client.h" 5 #include "services/service_manager/tests/lifecycle/app_client.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.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 registry_.AddInterface<mojom::LifecycleControl>(this); 14 registry_.AddInterface<mojom::LifecycleControl>(this);
15 } 15 }
16 16
17 AppClient::~AppClient() {} 17 AppClient::~AppClient() {}
18 18
19 void AppClient::OnBindInterface(const ServiceInfo& source_info, 19 void AppClient::OnBindInterface(const BindSourceInfo& source_info,
20 const std::string& interface_name, 20 const std::string& interface_name,
21 mojo::ScopedMessagePipeHandle interface_pipe) { 21 mojo::ScopedMessagePipeHandle interface_pipe) {
22 registry_.BindInterface(source_info.identity, interface_name, 22 registry_.BindInterface(source_info.identity, interface_name,
23 std::move(interface_pipe)); 23 std::move(interface_pipe));
24 } 24 }
25 25
26 bool AppClient::OnServiceManagerConnectionLost() { 26 bool AppClient::OnServiceManagerConnectionLost() {
27 base::MessageLoop::current()->QuitWhenIdle(); 27 base::MessageLoop::current()->QuitWhenIdle();
28 return true; 28 return true;
29 } 29 }
(...skipping 24 matching lines...) Expand all
54 base::Bind(&AppClient::BindingLost, base::Unretained(this))); 54 base::Bind(&AppClient::BindingLost, base::Unretained(this)));
55 } 55 }
56 56
57 void AppClient::BindingLost() { 57 void AppClient::BindingLost() {
58 if (bindings_.empty()) 58 if (bindings_.empty())
59 OnServiceManagerConnectionLost(); 59 OnServiceManagerConnectionLost();
60 } 60 }
61 61
62 } // namespace test 62 } // namespace test
63 } // namespace service_manager 63 } // 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