| 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/application/public/cpp/lib/service_registry.h" | 5 #include "mojo/application/public/cpp/lib/service_registry.h" |
| 6 | 6 |
| 7 #include "mojo/application/public/cpp/application_connection.h" | 7 #include "mojo/application/public/cpp/application_connection.h" |
| 8 #include "mojo/application/public/cpp/application_impl.h" | 8 #include "mojo/application/public/cpp/application_impl.h" |
| 9 #include "mojo/application/public/cpp/service_connector.h" | 9 #include "mojo/application/public/cpp/service_connector.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 local_binding_.Bind(local_services.Pass()); | 26 local_binding_.Bind(local_services.Pass()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 ServiceRegistry::ServiceRegistry() | 29 ServiceRegistry::ServiceRegistry() |
| 30 : application_impl_(nullptr), local_binding_(this) { | 30 : application_impl_(nullptr), local_binding_(this) { |
| 31 } | 31 } |
| 32 | 32 |
| 33 ServiceRegistry::~ServiceRegistry() { | 33 ServiceRegistry::~ServiceRegistry() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void ServiceRegistry::CloseConnection() { |
| 37 application_impl_->CloseConnection(this); |
| 38 } |
| 39 |
| 36 void ServiceRegistry::SetServiceConnector(ServiceConnector* connector) { | 40 void ServiceRegistry::SetServiceConnector(ServiceConnector* connector) { |
| 37 service_connector_registry_.set_service_connector(connector); | 41 service_connector_registry_.set_service_connector(connector); |
| 38 } | 42 } |
| 39 | 43 |
| 40 void ServiceRegistry::SetServiceConnectorForName( | 44 void ServiceRegistry::SetServiceConnectorForName( |
| 41 ServiceConnector* service_connector, | 45 ServiceConnector* service_connector, |
| 42 const std::string& interface_name) { | 46 const std::string& interface_name) { |
| 43 service_connector_registry_.SetServiceConnectorForName(service_connector, | 47 service_connector_registry_.SetServiceConnectorForName(service_connector, |
| 44 interface_name); | 48 interface_name); |
| 45 } | 49 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 64 } | 68 } |
| 65 | 69 |
| 66 void ServiceRegistry::ConnectToService(const mojo::String& service_name, | 70 void ServiceRegistry::ConnectToService(const mojo::String& service_name, |
| 67 ScopedMessagePipeHandle client_handle) { | 71 ScopedMessagePipeHandle client_handle) { |
| 68 service_connector_registry_.ConnectToService(this, service_name, | 72 service_connector_registry_.ConnectToService(this, service_name, |
| 69 client_handle.Pass()); | 73 client_handle.Pass()); |
| 70 } | 74 } |
| 71 | 75 |
| 72 } // namespace internal | 76 } // namespace internal |
| 73 } // namespace mojo | 77 } // namespace mojo |
| OLD | NEW |