Chromium Code Reviews| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 template <> | 135 template <> |
| 136 struct IPC_EXPORT ParamTraits<unsigned char> { | 136 struct IPC_EXPORT ParamTraits<unsigned char> { |
| 137 typedef unsigned char param_type; | 137 typedef unsigned char param_type; |
| 138 static void Write(Message* m, const param_type& p); | 138 static void Write(Message* m, const param_type& p); |
| 139 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 139 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 140 static void Log(const param_type& p, std::string* l); | 140 static void Log(const param_type& p, std::string* l); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 template <> | 143 template <> |
|
Tom Sepez
2015/10/29 22:30:01
nit: put this before <unsigned char> just to keep
ortuno
2015/10/29 22:43:34
Done.
| |
| 144 struct IPC_EXPORT ParamTraits<signed char> { | |
|
Tom Sepez
2015/10/29 22:30:01
you shouldn't have to explicitly say "signed" -- I
ortuno
2015/10/29 22:43:34
If I don't put the 'signed' the compiler complains
| |
| 145 typedef signed char param_type; | |
| 146 static void Write(Message* m, const param_type& p); | |
| 147 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | |
| 148 static void Log(const param_type& p, std::string* l); | |
| 149 }; | |
| 150 | |
| 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; |
| 146 static void Write(Message* m, const param_type& p); | 154 static void Write(Message* m, const param_type& p); |
| 147 static bool Read(const Message* m, | 155 static bool Read(const Message* m, |
| 148 base::PickleIterator* iter, | 156 base::PickleIterator* iter, |
| 149 param_type* r); | 157 param_type* r); |
| 150 static void Log(const param_type& p, std::string* l); | 158 static void Log(const param_type& p, std::string* l); |
| 151 }; | 159 }; |
| 152 | 160 |
| 153 template <> | 161 template <> |
| (...skipping 904 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 |