| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 5 #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
| 6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 LogParam(p.c, l); | 1166 LogParam(p.c, l); |
| 1167 l->append(L", "); | 1167 l->append(L", "); |
| 1168 LogParam(p.d, l); | 1168 LogParam(p.d, l); |
| 1169 l->append(L", "); | 1169 l->append(L", "); |
| 1170 LogParam(p.e, l); | 1170 LogParam(p.e, l); |
| 1171 l->append(L", "); | 1171 l->append(L", "); |
| 1172 LogParam(p.f, l); | 1172 LogParam(p.f, l); |
| 1173 } | 1173 } |
| 1174 }; | 1174 }; |
| 1175 | 1175 |
| 1176 template <class A, class B, class C, class D, class E, class F, class G> |
| 1177 struct ParamTraits< Tuple7<A, B, C, D, E, F, G> > { |
| 1178 typedef Tuple7<A, B, C, D, E, F, G> param_type; |
| 1179 static void Write(Message* m, const param_type& p) { |
| 1180 WriteParam(m, p.a); |
| 1181 WriteParam(m, p.b); |
| 1182 WriteParam(m, p.c); |
| 1183 WriteParam(m, p.d); |
| 1184 WriteParam(m, p.e); |
| 1185 WriteParam(m, p.f); |
| 1186 WriteParam(m, p.g); |
| 1187 } |
| 1188 static bool Read(const Message* m, void** iter, param_type* r) { |
| 1189 return (ReadParam(m, iter, &r->a) && |
| 1190 ReadParam(m, iter, &r->b) && |
| 1191 ReadParam(m, iter, &r->c) && |
| 1192 ReadParam(m, iter, &r->d) && |
| 1193 ReadParam(m, iter, &r->e) && |
| 1194 ReadParam(m, iter, &r->f) && |
| 1195 ReadParam(m, iter, &r->g)); |
| 1196 } |
| 1197 static void Log(const param_type& p, std::wstring* l) { |
| 1198 LogParam(p.a, l); |
| 1199 l->append(L", "); |
| 1200 LogParam(p.b, l); |
| 1201 l->append(L", "); |
| 1202 LogParam(p.c, l); |
| 1203 l->append(L", "); |
| 1204 LogParam(p.d, l); |
| 1205 l->append(L", "); |
| 1206 LogParam(p.e, l); |
| 1207 l->append(L", "); |
| 1208 LogParam(p.f, l); |
| 1209 l->append(L", "); |
| 1210 LogParam(p.g, l); |
| 1211 } |
| 1212 }; |
| 1213 |
| 1176 | 1214 |
| 1177 | 1215 |
| 1178 //----------------------------------------------------------------------------- | 1216 //----------------------------------------------------------------------------- |
| 1179 // Generic message subclasses | 1217 // Generic message subclasses |
| 1180 | 1218 |
| 1181 // Used for asynchronous messages. | 1219 // Used for asynchronous messages. |
| 1182 template <class ParamType> | 1220 template <class ParamType> |
| 1183 class MessageWithTuple : public Message { | 1221 class MessageWithTuple : public Message { |
| 1184 public: | 1222 public: |
| 1185 typedef ParamType Param; | 1223 typedef ParamType Param; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 ReplyParam p(a, b, c, d, e); | 1505 ReplyParam p(a, b, c, d, e); |
| 1468 WriteParam(reply, p); | 1506 WriteParam(reply, p); |
| 1469 } | 1507 } |
| 1470 }; | 1508 }; |
| 1471 | 1509 |
| 1472 //----------------------------------------------------------------------------- | 1510 //----------------------------------------------------------------------------- |
| 1473 | 1511 |
| 1474 } // namespace IPC | 1512 } // namespace IPC |
| 1475 | 1513 |
| 1476 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 1514 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |