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

Unified Diff: ipc/ipc_message_utils.h

Issue 1036883002: Simplify IPC::SyncMessageSchema::WriteReplyParams() using variadic templates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied the comments from Tom Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.h
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 597729705a952ca4c6ef5c3c6262c92036b77b52..6787c8e2eb80dd0a6da16009c6eff03bedfe959e 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -906,33 +906,9 @@ class SyncMessageSchema {
return ok;
}
- template<typename TA>
- static void WriteReplyParams(Message* reply, TA a) {
- ReplyParam p(a);
- WriteParam(reply, p);
- }
-
- template<typename TA, typename TB>
- static void WriteReplyParams(Message* reply, TA a, TB b) {
- ReplyParam p(a, b);
- WriteParam(reply, p);
- }
-
- template<typename TA, typename TB, typename TC>
- static void WriteReplyParams(Message* reply, TA a, TB b, TC c) {
- ReplyParam p(a, b, c);
- WriteParam(reply, p);
- }
-
- template<typename TA, typename TB, typename TC, typename TD>
- static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) {
- ReplyParam p(a, b, c, d);
- WriteParam(reply, p);
- }
-
- template<typename TA, typename TB, typename TC, typename TD, typename TE>
- static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) {
- ReplyParam p(a, b, c, d, e);
+ template <typename... Ts>
+ static void WriteReplyParams(Message* reply, Ts... args) {
+ ReplyParam p(args...);
WriteParam(reply, p);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698