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 #ifndef IPC_IPC_MESSAGE_TEMPLATES_H_ | 5 #ifndef IPC_IPC_MESSAGE_TEMPLATES_H_ |
6 #define IPC_IPC_MESSAGE_TEMPLATES_H_ | 6 #define IPC_IPC_MESSAGE_TEMPLATES_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <type_traits> | 10 #include <type_traits> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 T* obj, | 160 T* obj, |
161 S* sender, | 161 S* sender, |
162 P* parameter, | 162 P* parameter, |
163 Method func) { | 163 Method func) { |
164 SendParam send_params; | 164 SendParam send_params; |
165 bool ok = ReadSendParam(msg, &send_params); | 165 bool ok = ReadSendParam(msg, &send_params); |
166 Message* reply = SyncMessage::GenerateReply(msg); | 166 Message* reply = SyncMessage::GenerateReply(msg); |
167 if (ok) { | 167 if (ok) { |
168 ReplyParam reply_params; | 168 ReplyParam reply_params; |
169 base::DispatchToMethod(obj, func, send_params, &reply_params); | 169 base::DispatchToMethod(obj, func, send_params, &reply_params); |
170 WriteParam(reply, reply_params); | 170 WriteParamUnchecked(reply, reply_params); |
171 LogReplyParamsToMessage(reply_params, msg); | 171 LogReplyParamsToMessage(reply_params, msg); |
172 } else { | 172 } else { |
173 NOTREACHED() << "Error deserializing message " << msg->type(); | 173 NOTREACHED() << "Error deserializing message " << msg->type(); |
174 reply->set_reply_error(); | 174 reply->set_reply_error(); |
175 } | 175 } |
176 sender->Send(reply); | 176 sender->Send(reply); |
177 return ok; | 177 return ok; |
178 } | 178 } |
179 | 179 |
180 template <class T, class P, class Method> | 180 template <class T, class P, class Method> |
(...skipping 20 matching lines...) Expand all Loading... |
201 MessageT(Routing routing, const Ins&... ins, Outs*... outs); | 201 MessageT(Routing routing, const Ins&... ins, Outs*... outs); |
202 }; | 202 }; |
203 | 203 |
204 } // namespace IPC | 204 } // namespace IPC |
205 | 205 |
206 #if defined(IPC_MESSAGE_IMPL) | 206 #if defined(IPC_MESSAGE_IMPL) |
207 #include "ipc/ipc_message_templates_impl.h" | 207 #include "ipc/ipc_message_templates_impl.h" |
208 #endif | 208 #endif |
209 | 209 |
210 #endif // IPC_IPC_MESSAGE_TEMPLATES_H_ | 210 #endif // IPC_IPC_MESSAGE_TEMPLATES_H_ |
OLD | NEW |