| 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 <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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |