| 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/service_connector.h" | 8 #include "mojo/public/cpp/application/service_connector.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const std::string& interface_name) { | 27 const std::string& interface_name) { |
| 28 service_connector_registry_.SetServiceConnectorForName( | 28 service_connector_registry_.SetServiceConnectorForName( |
| 29 std::unique_ptr<ServiceConnector>(service_connector), interface_name); | 29 std::unique_ptr<ServiceConnector>(service_connector), interface_name); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void ServiceRegistry::RemoveServiceConnectorForName( | 32 void ServiceRegistry::RemoveServiceConnectorForName( |
| 33 const std::string& interface_name) { | 33 const std::string& interface_name) { |
| 34 service_connector_registry_.RemoveServiceConnectorForName(interface_name); | 34 service_connector_registry_.RemoveServiceConnectorForName(interface_name); |
| 35 } | 35 } |
| 36 | 36 |
| 37 const ConnectionContext& ServiceRegistry::GetConnectionContext() const { |
| 38 return connection_context_; |
| 39 } |
| 40 |
| 37 const std::string& ServiceRegistry::GetConnectionURL() { | 41 const std::string& ServiceRegistry::GetConnectionURL() { |
| 38 return connection_context_.connection_url; | 42 return connection_context_.connection_url; |
| 39 } | 43 } |
| 40 | 44 |
| 41 const std::string& ServiceRegistry::GetRemoteApplicationURL() { | 45 const std::string& ServiceRegistry::GetRemoteApplicationURL() { |
| 42 return connection_context_.remote_url; | 46 return connection_context_.remote_url; |
| 43 } | 47 } |
| 44 | 48 |
| 45 void ServiceRegistry::ConnectToService(const String& service_name, | 49 void ServiceRegistry::ConnectToService(const String& service_name, |
| 46 ScopedMessagePipeHandle client_handle) { | 50 ScopedMessagePipeHandle client_handle) { |
| 47 service_connector_registry_.ConnectToService(this, service_name, | 51 service_connector_registry_.ConnectToService(this, service_name, |
| 48 &client_handle); | 52 &client_handle); |
| 49 } | 53 } |
| 50 | 54 |
| 51 } // namespace internal | 55 } // namespace internal |
| 52 } // namespace mojo | 56 } // namespace mojo |
| OLD | NEW |