OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 <utility> | |
6 | |
7 #include "mojo/application/public/cpp/service_connector.h" | |
8 #include "mojo/application/public/cpp/service_provider_impl.h" | |
9 #include "mojo/public/cpp/environment/logging.h" | |
10 | |
11 namespace mojo { | |
12 | |
13 ServiceProviderImpl::ServiceProviderImpl() : binding_(this) { | |
14 } | |
15 | |
16 ServiceProviderImpl::ServiceProviderImpl( | |
17 InterfaceRequest<ServiceProvider> request) | |
18 : binding_(this, std::move(request)) {} | |
19 | |
20 ServiceProviderImpl::~ServiceProviderImpl() { | |
21 } | |
22 | |
23 void ServiceProviderImpl::Bind(InterfaceRequest<ServiceProvider> request) { | |
24 binding_.Bind(std::move(request)); | |
25 } | |
26 | |
27 void ServiceProviderImpl::ConnectToService( | |
28 const String& service_name, | |
29 ScopedMessagePipeHandle client_handle) { | |
30 // TODO(beng): perhaps take app connection thru ctor so that we can pass | |
31 // ApplicationConnection through? | |
32 service_connector_registry_.ConnectToService(nullptr, service_name, | |
33 std::move(client_handle)); | |
34 } | |
35 | |
36 void ServiceProviderImpl::SetServiceConnectorForName( | |
37 ServiceConnector* service_connector, | |
38 const std::string& interface_name) { | |
39 service_connector_registry_.SetServiceConnectorForName(service_connector, | |
40 interface_name); | |
41 } | |
42 | |
43 } // namespace mojo | |
OLD | NEW |