| OLD | NEW |
| 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "mojo/public/cpp/bindings/binding_set.h" | 8 #include "mojo/public/cpp/bindings/binding_set.h" |
| 9 #include "services/service_manager/public/cpp/connection.h" | 9 #include "services/service_manager/public/cpp/connection.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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() {} | 27 Target() {} |
| 28 ~Target() override {} | 28 ~Target() override {} |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 // service_manager::Service: | 31 // service_manager::Service: |
| 32 void OnStart(const service_manager::Identity& identity) override { | 32 void OnStart(const service_manager::ServiceInfo& info) override { |
| 33 identity_ = identity; | 33 identity_ = info.identity; |
| 34 } | 34 } |
| 35 bool OnConnect(const service_manager::Identity& remote_identity, | 35 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 36 service_manager::InterfaceRegistry* registry) override { | 36 service_manager::InterfaceRegistry* registry) override { |
| 37 registry->AddInterface<ConnectTestService>(this); | 37 registry->AddInterface<ConnectTestService>(this); |
| 38 return true; | 38 return true; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // service_manager::InterfaceFactory<ConnectTestService>: | 41 // service_manager::InterfaceFactory<ConnectTestService>: |
| 42 void Create(const service_manager::Identity& remote_identity, | 42 void Create(const service_manager::Identity& remote_identity, |
| 43 ConnectTestServiceRequest request) override { | 43 ConnectTestServiceRequest request) override { |
| 44 bindings_.AddBinding(this, std::move(request)); | 44 bindings_.AddBinding(this, std::move(request)); |
| 45 } | 45 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 | 62 |
| 63 int main(int argc, char** argv) { | 63 int main(int argc, char** argv) { |
| 64 base::AtExitManager at_exit; | 64 base::AtExitManager at_exit; |
| 65 base::CommandLine::Init(argc, argv); | 65 base::CommandLine::Init(argc, argv); |
| 66 | 66 |
| 67 service_manager::InitializeLogging(); | 67 service_manager::InitializeLogging(); |
| 68 | 68 |
| 69 Target target; | 69 Target target; |
| 70 return service_manager::TestNativeMain(&target); | 70 return service_manager::TestNativeMain(&target); |
| 71 } | 71 } |
| OLD | NEW |