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

Side by Side Diff: services/service_manager/tests/connect/connect_test_exe.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "mojo/public/cpp/bindings/binding_set.h" 9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "services/service_manager/public/c/main.h" 10 #include "services/service_manager/public/c/main.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class Target : public service_manager::Service, 23 class Target : public service_manager::Service,
24 public service_manager::InterfaceFactory<ConnectTestService>, 24 public service_manager::InterfaceFactory<ConnectTestService>,
25 public ConnectTestService { 25 public ConnectTestService {
26 public: 26 public:
27 Target() { registry_.AddInterface<ConnectTestService>(this); } 27 Target() { registry_.AddInterface<ConnectTestService>(this); }
28 ~Target() override {} 28 ~Target() override {}
29 29
30 private: 30 private:
31 // service_manager::Service: 31 // service_manager::Service:
32 void OnBindInterface(const service_manager::ServiceInfo& source_info, 32 void OnBindInterface(const service_manager::BindSourceInfo& source_info,
33 const std::string& interface_name, 33 const std::string& interface_name,
34 mojo::ScopedMessagePipeHandle interface_pipe) override { 34 mojo::ScopedMessagePipeHandle interface_pipe) override {
35 registry_.BindInterface(source_info.identity, interface_name, 35 registry_.BindInterface(source_info.identity, interface_name,
36 std::move(interface_pipe)); 36 std::move(interface_pipe));
37 } 37 }
38 38
39 // service_manager::InterfaceFactory<ConnectTestService>: 39 // service_manager::InterfaceFactory<ConnectTestService>:
40 void Create(const service_manager::Identity& remote_identity, 40 void Create(const service_manager::Identity& remote_identity,
41 ConnectTestServiceRequest request) override { 41 ConnectTestServiceRequest request) override {
42 bindings_.AddBinding(this, std::move(request)); 42 bindings_.AddBinding(this, std::move(request));
(...skipping 13 matching lines...) Expand all
56 56
57 DISALLOW_COPY_AND_ASSIGN(Target); 57 DISALLOW_COPY_AND_ASSIGN(Target);
58 }; 58 };
59 59
60 } // namespac 60 } // namespac
61 61
62 MojoResult ServiceMain(MojoHandle service_request_handle) { 62 MojoResult ServiceMain(MojoHandle service_request_handle) {
63 service_manager::ServiceRunner runner(new Target); 63 service_manager::ServiceRunner runner(new Target);
64 return runner.Run(service_request_handle); 64 return runner.Run(service_request_handle);
65 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698