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

Side by Side Diff: services/service_manager/tests/lifecycle/parent.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 <memory> 5 #include <memory>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "mojo/public/cpp/bindings/binding_set.h" 10 #include "mojo/public/cpp/bindings/binding_set.h"
(...skipping 17 matching lines...) Expand all
28 public service_manager::test::mojom::Parent { 28 public service_manager::test::mojom::Parent {
29 public: 29 public:
30 Parent() {} 30 Parent() {}
31 ~Parent() override { 31 ~Parent() override {
32 child_connection_.reset(); 32 child_connection_.reset();
33 parent_bindings_.CloseAllBindings(); 33 parent_bindings_.CloseAllBindings();
34 } 34 }
35 35
36 private: 36 private:
37 // Service: 37 // Service:
38 bool OnConnect(const service_manager::Identity& remote_identity, 38 bool OnConnect(const service_manager::ServiceInfo& remote_info,
39 service_manager::InterfaceRegistry* registry) override { 39 service_manager::InterfaceRegistry* registry) override {
40 registry->AddInterface<service_manager::test::mojom::Parent>(this); 40 registry->AddInterface<service_manager::test::mojom::Parent>(this);
41 return true; 41 return true;
42 } 42 }
43 43
44 // InterfaceFactory<service_manager::test::mojom::Parent>: 44 // InterfaceFactory<service_manager::test::mojom::Parent>:
45 void Create(const service_manager::Identity& remote_identity, 45 void Create(const service_manager::Identity& remote_identity,
46 service_manager::test::mojom::ParentRequest request) override { 46 service_manager::test::mojom::ParentRequest request) override {
47 parent_bindings_.AddBinding(this, std::move(request)); 47 parent_bindings_.AddBinding(this, std::move(request));
48 } 48 }
(...skipping 21 matching lines...) Expand all
70 70
71 DISALLOW_COPY_AND_ASSIGN(Parent); 71 DISALLOW_COPY_AND_ASSIGN(Parent);
72 }; 72 };
73 73
74 } // namespace 74 } // namespace
75 75
76 MojoResult ServiceMain(MojoHandle service_request_handle) { 76 MojoResult ServiceMain(MojoHandle service_request_handle) {
77 Parent* parent = new Parent; 77 Parent* parent = new Parent;
78 return service_manager::ServiceRunner(parent).Run(service_request_handle); 78 return service_manager::ServiceRunner(parent).Run(service_request_handle);
79 } 79 }
OLDNEW
« no previous file with comments | « services/service_manager/tests/lifecycle/package.cc ('k') | services/service_manager/tests/service_manager/driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698