Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_ptr_state.h

Issue 2766523002: mojo: MessageReceiver*::AcceptWithResponder() now take a unique_ptr to the responder (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_endpoint_client.cc ('k') | mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698