OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_connector_registry.h" | 5 #include "mojo/application/public/cpp/lib/service_connector_registry.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "mojo/application/public/cpp/service_connector.h" | 9 #include "mojo/application/public/cpp/service_connector.h" |
8 | 10 |
9 namespace mojo { | 11 namespace mojo { |
10 namespace internal { | 12 namespace internal { |
11 | 13 |
12 ServiceConnectorRegistry::ServiceConnectorRegistry() | 14 ServiceConnectorRegistry::ServiceConnectorRegistry() |
13 : service_connector_(nullptr) { | 15 : service_connector_(nullptr) { |
14 } | 16 } |
15 | 17 |
16 ServiceConnectorRegistry::~ServiceConnectorRegistry() { | 18 ServiceConnectorRegistry::~ServiceConnectorRegistry() { |
(...skipping 22 matching lines...) Expand all Loading... |
39 name_to_service_connector_.erase(it); | 41 name_to_service_connector_.erase(it); |
40 } | 42 } |
41 | 43 |
42 void ServiceConnectorRegistry::ConnectToService( | 44 void ServiceConnectorRegistry::ConnectToService( |
43 ApplicationConnection* application_connection, | 45 ApplicationConnection* application_connection, |
44 const std::string& interface_name, | 46 const std::string& interface_name, |
45 ScopedMessagePipeHandle client_handle) { | 47 ScopedMessagePipeHandle client_handle) { |
46 auto iter = name_to_service_connector_.find(interface_name); | 48 auto iter = name_to_service_connector_.find(interface_name); |
47 if (iter != name_to_service_connector_.end()) { | 49 if (iter != name_to_service_connector_.end()) { |
48 iter->second->ConnectToService(application_connection, interface_name, | 50 iter->second->ConnectToService(application_connection, interface_name, |
49 client_handle.Pass()); | 51 std::move(client_handle)); |
50 return; | 52 return; |
51 } | 53 } |
52 if (service_connector_) { | 54 if (service_connector_) { |
53 service_connector_->ConnectToService(application_connection, interface_name, | 55 service_connector_->ConnectToService(application_connection, interface_name, |
54 client_handle.Pass()); | 56 std::move(client_handle)); |
55 } | 57 } |
56 } | 58 } |
57 | 59 |
58 } // namespace internal | 60 } // namespace internal |
59 } // namespace mojo | 61 } // namespace mojo |
OLD | NEW |