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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 m->WriteBool(p); | 115 m->WriteBool(p); |
116 } | 116 } |
117 static bool Read(const Message* m, PickleIterator* iter, param_type* r) { | 117 static bool Read(const Message* m, PickleIterator* iter, param_type* r) { |
118 return m->ReadBool(iter, r); | 118 return m->ReadBool(iter, r); |
119 } | 119 } |
120 IPC_EXPORT static void Log(const param_type& p, std::string* l); | 120 IPC_EXPORT static void Log(const param_type& p, std::string* l); |
121 }; | 121 }; |
122 | 122 |
123 template <> | 123 template <> |
124 struct IPC_EXPORT ParamTraits<unsigned char> { | 124 struct IPC_EXPORT ParamTraits<unsigned char> { |
125 typedef unsigned short param_type; | 125 typedef unsigned char param_type; |
126 static void Write(Message* m, const param_type& p); | 126 static void Write(Message* m, const param_type& p); |
127 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 127 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
128 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
129 }; | 129 }; |
130 | 130 |
131 template <> | 131 template <> |
132 struct IPC_EXPORT ParamTraits<unsigned short> { | 132 struct IPC_EXPORT ParamTraits<unsigned short> { |
133 typedef unsigned short param_type; | 133 typedef unsigned short param_type; |
134 static void Write(Message* m, const param_type& p); | 134 static void Write(Message* m, const param_type& p); |
135 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 135 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 template<typename TA, typename TB, typename TC, typename TD, typename TE> | 874 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) { | 875 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { |
876 ReplyParam p(a, b, c, d, e); | 876 ReplyParam p(a, b, c, d, e); |
877 WriteParam(reply, p); | 877 WriteParam(reply, p); |
878 } | 878 } |
879 }; | 879 }; |
880 | 880 |
881 } // namespace IPC | 881 } // namespace IPC |
882 | 882 |
883 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 883 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
OLD | NEW |