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

Side by Side Diff: ipc/ipc_message_utils.h

Issue 1418743006: ipc: Add ParamTraits<signed char> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Change ordering Created 5 years, 1 month 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
« no previous file with comments | « no previous file | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 static bool Read(const Message* m, 127 static bool Read(const Message* m,
128 base::PickleIterator* iter, 128 base::PickleIterator* iter,
129 param_type* r) { 129 param_type* r) {
130 return iter->ReadBool(r); 130 return iter->ReadBool(r);
131 } 131 }
132 IPC_EXPORT static void Log(const param_type& p, std::string* l); 132 IPC_EXPORT static void Log(const param_type& p, std::string* l);
133 }; 133 };
134 134
135 template <> 135 template <>
136 struct IPC_EXPORT ParamTraits<signed char> {
137 typedef signed char param_type;
138 static void Write(Message* m, const param_type& p);
139 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
140 static void Log(const param_type& p, std::string* l);
141 };
142
143 template <>
136 struct IPC_EXPORT ParamTraits<unsigned char> { 144 struct IPC_EXPORT ParamTraits<unsigned char> {
137 typedef unsigned char param_type; 145 typedef unsigned char param_type;
138 static void Write(Message* m, const param_type& p); 146 static void Write(Message* m, const param_type& p);
139 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); 147 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
140 static void Log(const param_type& p, std::string* l); 148 static void Log(const param_type& p, std::string* l);
141 }; 149 };
142 150
143 template <> 151 template <>
144 struct IPC_EXPORT ParamTraits<unsigned short> { 152 struct IPC_EXPORT ParamTraits<unsigned short> {
145 typedef unsigned short param_type; 153 typedef unsigned short param_type;
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 template <typename... Ts> 1066 template <typename... Ts>
1059 static void WriteReplyParams(Message* reply, Ts... args) { 1067 static void WriteReplyParams(Message* reply, Ts... args) {
1060 ReplyParam p(args...); 1068 ReplyParam p(args...);
1061 WriteParam(reply, p); 1069 WriteParam(reply, p);
1062 } 1070 }
1063 }; 1071 };
1064 1072
1065 } // namespace IPC 1073 } // namespace IPC
1066 1074
1067 #endif // IPC_IPC_MESSAGE_UTILS_H_ 1075 #endif // IPC_IPC_MESSAGE_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698