summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils_impl.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 18:38:24 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 18:38:24 +0000
commit7a4de7a6cefa6c56d42e6abe17f815b048269354 (patch)
treeee80ec60dfb6853c323238e714cc970297ee70ab /ipc/ipc_message_utils_impl.h
parent17e5f7d53a09582719e9e0a942643463944fb749 (diff)
downloadchromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.zip
chromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.tar.gz
chromium_src-7a4de7a6cefa6c56d42e6abe17f815b048269354.tar.bz2
Reapplies all the IPC system work (reverts the revert r56272).
That patch wasn't what caused the regression in the page cycler. BUG=51411,52103 TEST=still compiles Review URL: http://codereview.chromium.org/3106018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_utils_impl.h')
-rw-r--r--ipc/ipc_message_utils_impl.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h
new file mode 100644
index 0000000..715df8f
--- /dev/null
+++ b/ipc/ipc_message_utils_impl.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// This file contains templates forward declared (but not defined) in
+// ipc_message_utils.h so that they are only instantiated in certain files,
+// notably ipc_message_impl_macros.h and a few IPC unit tests.
+
+#ifndef IPC_IPC_MESSAGE_UTILS_IMPL_H_
+#define IPC_IPC_MESSAGE_UTILS_IMPL_H_
+
+namespace IPC {
+
+template <class ParamType>
+MessageWithTuple<ParamType>::MessageWithTuple(
+ int32 routing_id, uint32 type, const RefParam& p)
+ : Message(routing_id, type, PRIORITY_NORMAL) {
+ WriteParam(this, p);
+}
+
+template <class ParamType>
+bool MessageWithTuple<ParamType>::Read(const Message* msg, Param* p) {
+ void* iter = NULL;
+ if (ReadParam(msg, &iter, p))
+ return true;
+ NOTREACHED() << "Error deserializing message " << msg->type();
+ return false;
+}
+
+// We can't migrate the template for Log() to MessageWithTuple, because each
+// subclass needs to have Log() to call Read(), which instantiates the above
+// template.
+
+template <class SendParamType, class ReplyParamType>
+MessageWithReply<SendParamType, ReplyParamType>::MessageWithReply(
+ int32 routing_id, uint32 type,
+ const RefSendParam& send,
+ const ReplyParam& reply)
+ : SyncMessage(routing_id, type, PRIORITY_NORMAL,
+ new ParamDeserializer<ReplyParam>(reply)) {
+ WriteParam(this, send);
+}
+
+template <class SendParamType, class ReplyParamType>
+bool MessageWithReply<SendParamType, ReplyParamType>::ReadSendParam(
+ const Message* msg, SendParam* p) {
+ void* iter = SyncMessage::GetDataIterator(msg);
+ return ReadParam(msg, &iter, p);
+}
+
+template <class SendParamType, class ReplyParamType>
+bool MessageWithReply<SendParamType, ReplyParamType>::ReadReplyParam(
+ const Message* msg, typename TupleTypes<ReplyParam>::ValueTuple* p) {
+ void* iter = SyncMessage::GetDataIterator(msg);
+ return ReadParam(msg, &iter, p);
+}
+
+} // namespace IPC
+
+#endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_