OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "mojo/public/cpp/application/lib/service_registry.h" | 5 #include "mojo/public/cpp/application/lib/service_registry.h" |
6 | 6 |
7 #include "mojo/public/cpp/application/application_connection.h" | 7 #include "mojo/public/cpp/application/application_connection.h" |
8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
9 #include "mojo/public/cpp/application/service_connector.h" | 9 #include "mojo/public/cpp/application/service_connector.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 ServiceRegistry::ServiceRegistry( | 14 ServiceRegistry::ServiceRegistry( |
15 ApplicationImpl* application_impl, | 15 ApplicationImpl* application_impl, |
16 const std::string& connection_url, | 16 const std::string& connection_url, |
17 const std::string& remote_url, | 17 const std::string& remote_url, |
18 ServiceProviderPtr remote_services, | 18 InterfaceHandle<ServiceProvider> remote_services, |
19 InterfaceRequest<ServiceProvider> local_services) | 19 InterfaceRequest<ServiceProvider> local_services) |
20 : application_impl_(application_impl), | 20 : application_impl_(application_impl), |
21 connection_url_(connection_url), | 21 connection_url_(connection_url), |
22 remote_url_(remote_url), | 22 remote_url_(remote_url), |
23 local_binding_(this), | 23 local_binding_(this), |
24 remote_service_provider_(remote_services.Pass()) { | 24 remote_service_provider_( |
| 25 ServiceProviderPtr::Create(std::move(remote_services))) { |
25 if (local_services.is_pending()) | 26 if (local_services.is_pending()) |
26 local_binding_.Bind(local_services.Pass()); | 27 local_binding_.Bind(local_services.Pass()); |
27 } | 28 } |
28 | 29 |
29 ServiceRegistry::ServiceRegistry() | 30 ServiceRegistry::ServiceRegistry() |
30 : application_impl_(nullptr), local_binding_(this) { | 31 : application_impl_(nullptr), local_binding_(this) { |
31 } | 32 } |
32 | 33 |
33 ServiceRegistry::~ServiceRegistry() { | 34 ServiceRegistry::~ServiceRegistry() { |
34 } | 35 } |
(...skipping 25 matching lines...) Expand all Loading... |
60 } | 61 } |
61 | 62 |
62 void ServiceRegistry::ConnectToService(const mojo::String& service_name, | 63 void ServiceRegistry::ConnectToService(const mojo::String& service_name, |
63 ScopedMessagePipeHandle client_handle) { | 64 ScopedMessagePipeHandle client_handle) { |
64 service_connector_registry_.ConnectToService(this, service_name, | 65 service_connector_registry_.ConnectToService(this, service_name, |
65 &client_handle); | 66 &client_handle); |
66 } | 67 } |
67 | 68 |
68 } // namespace internal | 69 } // namespace internal |
69 } // namespace mojo | 70 } // namespace mojo |
OLD | NEW |