| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 IPC_EXPORT static void Log(const param_type& p, std::string* l); | 210 IPC_EXPORT static void Log(const param_type& p, std::string* l); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 // Note that the IPC layer doesn't sanitize NaNs and +/- INF values. Clients | 213 // Note that the IPC layer doesn't sanitize NaNs and +/- INF values. Clients |
| 214 // should be sure to check the sanity of these values after receiving them over | 214 // should be sure to check the sanity of these values after receiving them over |
| 215 // IPC. | 215 // IPC. |
| 216 template <> | 216 template <> |
| 217 struct IPC_EXPORT ParamTraits<float> { | 217 struct IPC_EXPORT ParamTraits<float> { |
| 218 typedef float param_type; | 218 typedef float param_type; |
| 219 static void Write(Message* m, const param_type& p); | 219 static void Write(Message* m, const param_type& p) { |
| 220 m->WriteFloat(p); |
| 221 } |
| 220 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 222 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 221 static void Log(const param_type& p, std::string* l); | 223 static void Log(const param_type& p, std::string* l); |
| 222 }; | 224 }; |
| 223 | 225 |
| 224 template <> | 226 template <> |
| 225 struct IPC_EXPORT ParamTraits<double> { | 227 struct IPC_EXPORT ParamTraits<double> { |
| 226 typedef double param_type; | 228 typedef double param_type; |
| 227 static void Write(Message* m, const param_type& p); | 229 static void Write(Message* m, const param_type& p); |
| 228 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 230 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 229 static void Log(const param_type& p, std::string* l); | 231 static void Log(const param_type& p, std::string* l); |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 template<typename TA, typename TB, typename TC, typename TD, typename TE> | 876 template<typename TA, typename TB, typename TC, typename TD, typename TE> |
| 875 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { | 877 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { |
| 876 ReplyParam p(a, b, c, d, e); | 878 ReplyParam p(a, b, c, d, e); |
| 877 WriteParam(reply, p); | 879 WriteParam(reply, p); |
| 878 } | 880 } |
| 879 }; | 881 }; |
| 880 | 882 |
| 881 } // namespace IPC | 883 } // namespace IPC |
| 882 | 884 |
| 883 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 885 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |