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

Side by Side Diff: mojo/public/cpp/bindings/lib/associated_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 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 AssociatedGroup* associated_group() { 126 AssociatedGroup* associated_group() {
127 return endpoint_client_ ? endpoint_client_->associated_group() : nullptr; 127 return endpoint_client_ ? endpoint_client_->associated_group() : nullptr;
128 } 128 }
129 129
130 void ForwardMessage(Message message) { endpoint_client_->Accept(&message); } 130 void ForwardMessage(Message message) { endpoint_client_->Accept(&message); }
131 131
132 void ForwardMessageWithResponder(Message message, 132 void ForwardMessageWithResponder(Message message,
133 std::unique_ptr<MessageReceiver> responder) { 133 std::unique_ptr<MessageReceiver> responder) {
134 endpoint_client_->AcceptWithResponder(&message, responder.release()); 134 endpoint_client_->AcceptWithResponder(&message, std::move(responder));
135 } 135 }
136 136
137 private: 137 private:
138 using Proxy = typename Interface::Proxy_; 138 using Proxy = typename Interface::Proxy_;
139 139
140 void OnQueryVersion(const base::Callback<void(uint32_t)>& callback, 140 void OnQueryVersion(const base::Callback<void(uint32_t)>& callback,
141 uint32_t version) { 141 uint32_t version) {
142 version_ = version; 142 version_ = version;
143 callback.Run(version); 143 callback.Run(version);
144 } 144 }
145 145
146 std::unique_ptr<InterfaceEndpointClient> endpoint_client_; 146 std::unique_ptr<InterfaceEndpointClient> endpoint_client_;
147 std::unique_ptr<Proxy> proxy_; 147 std::unique_ptr<Proxy> proxy_;
148 148
149 uint32_t version_; 149 uint32_t version_;
150 150
151 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); 151 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState);
152 }; 152 };
153 153
154 } // namespace internal 154 } // namespace internal
155 } // namespace mojo 155 } // namespace mojo
156 156
157 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 157 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/interface_endpoint_client.h ('k') | mojo/public/cpp/bindings/lib/control_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698