| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 param_type* r) { | 221 param_type* r) { |
| 222 return m->ReadInt(iter, reinterpret_cast<int*>(r)); | 222 return m->ReadInt(iter, reinterpret_cast<int*>(r)); |
| 223 } | 223 } |
| 224 IPC_EXPORT static void Log(const param_type& p, std::string* l); | 224 IPC_EXPORT static void Log(const param_type& p, std::string* l); |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 template <> | 227 template <> |
| 228 struct ParamTraits<long> { | 228 struct ParamTraits<long> { |
| 229 typedef long param_type; | 229 typedef long param_type; |
| 230 static void Write(Message* m, const param_type& p) { | 230 static void Write(Message* m, const param_type& p) { |
| 231 m->WriteLong(p); | 231 m->WriteLongUsingDangerousNonPortableLessPersistableForm(p); |
| 232 } | 232 } |
| 233 static bool Read(const Message* m, PickleIterator* iter, | 233 static bool Read(const Message* m, PickleIterator* iter, |
| 234 param_type* r) { | 234 param_type* r) { |
| 235 return m->ReadLong(iter, r); | 235 return m->ReadLong(iter, r); |
| 236 } | 236 } |
| 237 IPC_EXPORT static void Log(const param_type& p, std::string* l); | 237 IPC_EXPORT static void Log(const param_type& p, std::string* l); |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 template <> | 240 template <> |
| 241 struct ParamTraits<unsigned long> { | 241 struct ParamTraits<unsigned long> { |
| 242 typedef unsigned long param_type; | 242 typedef unsigned long param_type; |
| 243 static void Write(Message* m, const param_type& p) { | 243 static void Write(Message* m, const param_type& p) { |
| 244 m->WriteLong(p); | 244 m->WriteLongUsingDangerousNonPortableLessPersistableForm(p); |
| 245 } | 245 } |
| 246 static bool Read(const Message* m, PickleIterator* iter, | 246 static bool Read(const Message* m, PickleIterator* iter, |
| 247 param_type* r) { | 247 param_type* r) { |
| 248 return m->ReadLong(iter, reinterpret_cast<long*>(r)); | 248 return m->ReadLong(iter, reinterpret_cast<long*>(r)); |
| 249 } | 249 } |
| 250 IPC_EXPORT static void Log(const param_type& p, std::string* l); | 250 IPC_EXPORT static void Log(const param_type& p, std::string* l); |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 template <> | 253 template <> |
| 254 struct ParamTraits<long long> { | 254 struct ParamTraits<long long> { |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 ReplyParam p(a, b, c, d, e); | 1164 ReplyParam p(a, b, c, d, e); |
| 1165 WriteParam(reply, p); | 1165 WriteParam(reply, p); |
| 1166 } | 1166 } |
| 1167 }; | 1167 }; |
| 1168 | 1168 |
| 1169 //----------------------------------------------------------------------------- | 1169 //----------------------------------------------------------------------------- |
| 1170 | 1170 |
| 1171 } // namespace IPC | 1171 } // namespace IPC |
| 1172 | 1172 |
| 1173 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1173 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |