OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/service_manager/public/cpp/lib/connector_impl.h" | 5 #include "services/service_manager/public/cpp/lib/connector_impl.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "services/service_manager/public/cpp/identity.h" | 8 #include "services/service_manager/public/cpp/identity.h" |
9 | 9 |
10 namespace service_manager { | 10 namespace service_manager { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 std::unique_ptr<Connector> ConnectorImpl::Clone() { | 77 std::unique_ptr<Connector> ConnectorImpl::Clone() { |
78 if (!BindConnectorIfNecessary()) | 78 if (!BindConnectorIfNecessary()) |
79 return nullptr; | 79 return nullptr; |
80 | 80 |
81 mojom::ConnectorPtr connector; | 81 mojom::ConnectorPtr connector; |
82 mojom::ConnectorRequest request(&connector); | 82 mojom::ConnectorRequest request(&connector); |
83 connector_->Clone(std::move(request)); | 83 connector_->Clone(std::move(request)); |
84 return base::MakeUnique<ConnectorImpl>(connector.PassInterface()); | 84 return base::MakeUnique<ConnectorImpl>(connector.PassInterface()); |
85 } | 85 } |
86 | 86 |
| 87 void ConnectorImpl::ApplySpec(const std::string& spec, |
| 88 const Identity& source_identity, |
| 89 mojom::InterfaceProviderRequest request, |
| 90 mojom::InterfaceProviderPtr target) { |
| 91 connector_->ApplySpec(spec, source_identity, std::move(request), |
| 92 std::move(target)); |
| 93 } |
| 94 |
87 void ConnectorImpl::BindConnectorRequest(mojom::ConnectorRequest request) { | 95 void ConnectorImpl::BindConnectorRequest(mojom::ConnectorRequest request) { |
88 if (!BindConnectorIfNecessary()) | 96 if (!BindConnectorIfNecessary()) |
89 return; | 97 return; |
90 connector_->Clone(std::move(request)); | 98 connector_->Clone(std::move(request)); |
91 } | 99 } |
92 | 100 |
93 base::WeakPtr<Connector> ConnectorImpl::GetWeakPtr() { | 101 base::WeakPtr<Connector> ConnectorImpl::GetWeakPtr() { |
94 return weak_factory_.GetWeakPtr(); | 102 return weak_factory_.GetWeakPtr(); |
95 } | 103 } |
96 | 104 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 start_service_callback_.Run(result, user_id); | 150 start_service_callback_.Run(result, user_id); |
143 } | 151 } |
144 | 152 |
145 std::unique_ptr<Connector> Connector::Create(mojom::ConnectorRequest* request) { | 153 std::unique_ptr<Connector> Connector::Create(mojom::ConnectorRequest* request) { |
146 mojom::ConnectorPtr proxy; | 154 mojom::ConnectorPtr proxy; |
147 *request = mojo::MakeRequest(&proxy); | 155 *request = mojo::MakeRequest(&proxy); |
148 return base::MakeUnique<ConnectorImpl>(proxy.PassInterface()); | 156 return base::MakeUnique<ConnectorImpl>(proxy.PassInterface()); |
149 } | 157 } |
150 | 158 |
151 } // namespace service_manager | 159 } // namespace service_manager |
OLD | NEW |