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

Unified Diff: ipc/ipc_message_utils.h

Issue 164458: Land http://codereview.chromium.org/159067: (Closed)
Patch Set: undo docs Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.h
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index f3378143e20f769182907132506c502d75c89c10..5ec80a76c796fe9d0172fcc6ce772a67b7dee588 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -100,22 +100,31 @@ class MessageIterator {
//-----------------------------------------------------------------------------
// ParamTraits specializations, etc.
-template <class P> struct ParamTraits {};
+template <class P> struct ParamTraits {
+};
+
+template <class P>
+struct SimilarTypeTraits {
+ typedef P Type;
+};
template <class P>
static inline void WriteParam(Message* m, const P& p) {
- ParamTraits<P>::Write(m, p);
+ typedef typename SimilarTypeTraits<P>::Type Type;
+ ParamTraits<Type>::Write(m, static_cast<const Type& >(p));
}
template <class P>
static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter,
P* p) {
- return ParamTraits<P>::Read(m, iter, p);
+ typedef typename SimilarTypeTraits<P>::Type Type;
+ return ParamTraits<Type>::Read(m, iter, reinterpret_cast<Type* >(p));
}
template <class P>
static inline void LogParam(const P& p, std::wstring* l) {
- ParamTraits<P>::Log(p, l);
+ typedef typename SimilarTypeTraits<P>::Type Type;
+ ParamTraits<Type>::Log(static_cast<const Type& >(p), l);
}
template <>
@@ -788,7 +797,6 @@ struct ParamTraits<LogData> {
}
};
-
template <>
struct ParamTraits<Message> {
static void Write(Message* m, const Message& p) {
« no previous file with comments | « chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698