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

Side by Side Diff: services/service_manager/tests/lifecycle/parent.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 <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 19 matching lines...) Expand all
30 public: 30 public:
31 Parent() { 31 Parent() {
32 registry_.AddInterface<service_manager::test::mojom::Parent>(this); 32 registry_.AddInterface<service_manager::test::mojom::Parent>(this);
33 } 33 }
34 ~Parent() override { 34 ~Parent() override {
35 parent_bindings_.CloseAllBindings(); 35 parent_bindings_.CloseAllBindings();
36 } 36 }
37 37
38 private: 38 private:
39 // Service: 39 // Service:
40 void OnBindInterface(const service_manager::ServiceInfo& source_info, 40 void OnBindInterface(const service_manager::BindSourceInfo& source_info,
41 const std::string& interface_name, 41 const std::string& interface_name,
42 mojo::ScopedMessagePipeHandle interface_pipe) override { 42 mojo::ScopedMessagePipeHandle interface_pipe) override {
43 registry_.BindInterface(source_info.identity, interface_name, 43 registry_.BindInterface(source_info.identity, interface_name,
44 std::move(interface_pipe)); 44 std::move(interface_pipe));
45 } 45 }
46 46
47 // InterfaceFactory<service_manager::test::mojom::Parent>: 47 // InterfaceFactory<service_manager::test::mojom::Parent>:
48 void Create(const service_manager::Identity& remote_identity, 48 void Create(const service_manager::Identity& remote_identity,
49 service_manager::test::mojom::ParentRequest request) override { 49 service_manager::test::mojom::ParentRequest request) override {
50 parent_bindings_.AddBinding(this, std::move(request)); 50 parent_bindings_.AddBinding(this, std::move(request));
(...skipping 21 matching lines...) Expand all
72 72
73 DISALLOW_COPY_AND_ASSIGN(Parent); 73 DISALLOW_COPY_AND_ASSIGN(Parent);
74 }; 74 };
75 75
76 } // namespace 76 } // namespace
77 77
78 MojoResult ServiceMain(MojoHandle service_request_handle) { 78 MojoResult ServiceMain(MojoHandle service_request_handle) {
79 Parent* parent = new Parent; 79 Parent* parent = new Parent;
80 return service_manager::ServiceRunner(parent).Run(service_request_handle); 80 return service_manager::ServiceRunner(parent).Run(service_request_handle);
81 } 81 }
OLDNEW
« no previous file with comments | « services/service_manager/tests/lifecycle/package.cc ('k') | services/service_manager/tests/service_manager/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698