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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> // For |std::swap()|. | 10 #include <algorithm> // For |std::swap()|. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 void ForwardMessage(Message message) { | 163 void ForwardMessage(Message message) { |
164 ConfigureProxyIfNecessary(); | 164 ConfigureProxyIfNecessary(); |
165 endpoint_client_->Accept(&message); | 165 endpoint_client_->Accept(&message); |
166 } | 166 } |
167 | 167 |
168 void ForwardMessageWithResponder(Message message, | 168 void ForwardMessageWithResponder(Message message, |
169 std::unique_ptr<MessageReceiver> responder) { | 169 std::unique_ptr<MessageReceiver> responder) { |
170 ConfigureProxyIfNecessary(); | 170 ConfigureProxyIfNecessary(); |
171 endpoint_client_->AcceptWithResponder(&message, responder.release()); | 171 endpoint_client_->AcceptWithResponder(&message, std::move(responder)); |
172 } | 172 } |
173 | 173 |
174 private: | 174 private: |
175 using Proxy = typename Interface::Proxy_; | 175 using Proxy = typename Interface::Proxy_; |
176 | 176 |
177 void ConfigureProxyIfNecessary() { | 177 void ConfigureProxyIfNecessary() { |
178 // The proxy has been configured. | 178 // The proxy has been configured. |
179 if (proxy_) { | 179 if (proxy_) { |
180 DCHECK(router_); | 180 DCHECK(router_); |
181 DCHECK(endpoint_client_); | 181 DCHECK(endpoint_client_); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 uint32_t version_; | 223 uint32_t version_; |
224 | 224 |
225 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 225 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
226 }; | 226 }; |
227 | 227 |
228 } // namespace internal | 228 } // namespace internal |
229 } // namespace mojo | 229 } // namespace mojo |
230 | 230 |
231 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 231 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
OLD | NEW |