Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: ipc/ipc_message_utils.h

Issue 19023006: Fix ParamTraits::param_type for unsigned char (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698