summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 05:43:53 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 05:43:53 +0000
commit7b291f9c1394495724ddd81306e982e840075c08 (patch)
treefa2a2ef45f1b17018e716101395300da731d8599 /ipc/ipc_message_utils.h
parentcc4219ad7dd27008da3db5f0e23da9a6ab2f0387 (diff)
downloadchromium_src-7b291f9c1394495724ddd81306e982e840075c08.zip
chromium_src-7b291f9c1394495724ddd81306e982e840075c08.tar.gz
chromium_src-7b291f9c1394495724ddd81306e982e840075c08.tar.bz2
Implementation of getBackgroundPage(), getToolstrips(), and
getTabContentses(). This lands http://codereview.chromium.org/159067. Raf, the only thing you need to look at is the changes to extensions_process_bindings.js and extension_api.json. BUG=13577 TEST=Browser tests added Review URL: http://codereview.chromium.org/164458 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_utils.h')
-rw-r--r--ipc/ipc_message_utils.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index f337814..5ec80a7 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) {