OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "services/resource_coordinator/tracing/service.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom.
h" |
| 9 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 10 |
| 11 namespace resource_coordinator { |
| 12 namespace tracing { |
| 13 |
| 14 Service::Service() { |
| 15 registry_.AddInterface<mojom::AgentSet>(base::BindRepeating( |
| 16 &Service::BindAgentSetRequest, base::Unretained(this))); |
| 17 registry_.AddInterface<mojom::Coordinator>(base::BindRepeating( |
| 18 &Service::BindCoordinatorRequest, base::Unretained(this))); |
| 19 } |
| 20 |
| 21 Service::~Service() {} |
| 22 |
| 23 void Service::OnBindInterface( |
| 24 const service_manager::BindSourceInfo& source_info, |
| 25 const std::string& interface_name, |
| 26 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 27 registry_.BindInterface(source_info, interface_name, |
| 28 std::move(interface_pipe)); |
| 29 } |
| 30 |
| 31 void Service::BindAgentSetRequest( |
| 32 const service_manager::BindSourceInfo& source_info, |
| 33 mojom::AgentSetRequest request) { |
| 34 coordinator_.agent_set()->BindAgentSetRequest( |
| 35 service_manager::BindSourceInfo(), std::move(request)); |
| 36 } |
| 37 |
| 38 void Service::BindCoordinatorRequest( |
| 39 const service_manager::BindSourceInfo& source_info, |
| 40 mojom::CoordinatorRequest request) { |
| 41 coordinator_.BindCoordinatorRequest(std::move(request)); |
| 42 } |
| 43 |
| 44 } // namespace tracing |
| 45 } // namespace resource_coordinator |
OLD | NEW |