OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UTILS_H_ | 5 #ifndef IPC_IPC_MESSAGE_UTILS_H_ |
6 #define IPC_IPC_MESSAGE_UTILS_H_ | 6 #define IPC_IPC_MESSAGE_UTILS_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 ConnectMessageAndReply(msg, reply); | 899 ConnectMessageAndReply(msg, reply); |
900 DispatchToMethod(obj, func, send_params, &t); | 900 DispatchToMethod(obj, func, send_params, &t); |
901 } else { | 901 } else { |
902 NOTREACHED() << "Error deserializing message " << msg->type(); | 902 NOTREACHED() << "Error deserializing message " << msg->type(); |
903 reply->set_reply_error(); | 903 reply->set_reply_error(); |
904 obj->Send(reply); | 904 obj->Send(reply); |
905 } | 905 } |
906 return ok; | 906 return ok; |
907 } | 907 } |
908 | 908 |
909 template<typename TA> | 909 template <typename... Ts> |
910 static void WriteReplyParams(Message* reply, TA a) { | 910 static void WriteReplyParams(Message* reply, Ts... args) { |
911 ReplyParam p(a); | 911 ReplyParam p(args...); |
912 WriteParam(reply, p); | |
913 } | |
914 | |
915 template<typename TA, typename TB> | |
916 static void WriteReplyParams(Message* reply, TA a, TB b) { | |
917 ReplyParam p(a, b); | |
918 WriteParam(reply, p); | |
919 } | |
920 | |
921 template<typename TA, typename TB, typename TC> | |
922 static void WriteReplyParams(Message* reply, TA a, TB b, TC c) { | |
923 ReplyParam p(a, b, c); | |
924 WriteParam(reply, p); | |
925 } | |
926 | |
927 template<typename TA, typename TB, typename TC, typename TD> | |
928 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) { | |
929 ReplyParam p(a, b, c, d); | |
930 WriteParam(reply, p); | |
931 } | |
932 | |
933 template<typename TA, typename TB, typename TC, typename TD, typename TE> | |
934 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { | |
935 ReplyParam p(a, b, c, d, e); | |
936 WriteParam(reply, p); | 912 WriteParam(reply, p); |
937 } | 913 } |
938 }; | 914 }; |
939 | 915 |
940 } // namespace IPC | 916 } // namespace IPC |
941 | 917 |
942 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 918 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
OLD | NEW |