| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "services/shell/connect_util.h" | |
| 6 | |
| 7 #include <memory> | |
| 8 #include <utility> | |
| 9 | |
| 10 #include "services/shell/connect_params.h" | |
| 11 #include "services/shell/service_manager.h" | |
| 12 | |
| 13 namespace shell { | |
| 14 | |
| 15 mojo::ScopedMessagePipeHandle ConnectToInterfaceByName( | |
| 16 ServiceManager* service_manager, | |
| 17 const Identity& source, | |
| 18 const Identity& target, | |
| 19 const std::string& interface_name) { | |
| 20 mojom::InterfaceProviderPtr remote_interfaces; | |
| 21 std::unique_ptr<ConnectParams> params(new ConnectParams); | |
| 22 params->set_source(source); | |
| 23 params->set_target(target); | |
| 24 params->set_remote_interfaces(mojo::GetProxy(&remote_interfaces)); | |
| 25 service_manager->Connect(std::move(params)); | |
| 26 mojo::MessagePipe pipe; | |
| 27 remote_interfaces->GetInterface(interface_name, std::move(pipe.handle1)); | |
| 28 return std::move(pipe.handle0); | |
| 29 } | |
| 30 | |
| 31 } // namespace shell | |
| OLD | NEW |