1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains templates forward declared (but not defined) in
6 // ipc_message_utils.h so that they are only instantiated in certain files,
7 // notably a few IPC unit tests.
9 #ifndef IPC_IPC_MESSAGE_UTILS_IMPL_H_
10 #define IPC_IPC_MESSAGE_UTILS_IMPL_H_
14 template <class ParamType>
15 MessageWithTuple<ParamType>::MessageWithTuple(
16 int32 routing_id, uint32 type, const RefParam& p)
17 : Message(routing_id, type, PRIORITY_NORMAL) {
21 // We can't migrate the template for Log() to MessageWithTuple, because each
22 // subclass needs to have Log() to call Read(), which instantiates the above
25 template <class SendParamType, class ReplyParamType>
26 MessageWithReply<SendParamType, ReplyParamType>::MessageWithReply(
27 int32 routing_id, uint32 type,
28 const RefSendParam& send,
29 const ReplyParam& reply)
30 : SyncMessage(routing_id, type, PRIORITY_NORMAL,
31 new ParamDeserializer<ReplyParam>(reply))
33 WriteParam(this, send);
36 template <class SendParamType, class ReplyParamType>
37 bool MessageWithReply<SendParamType, ReplyParamType>::ReadReplyParam(
38 const Message* msg, typename TupleTypes<ReplyParam>::ValueTuple* p) {
39 void* iter = SyncMessage::GetDataIterator(msg);
40 return ReadParam(msg, &iter, p);
45 #endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_