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
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 void MessageSchema
<ParamType
>::Write(Message
* msg
, const RefParam
& p
) {
19 template <class ParamType
>
20 bool MessageSchema
<ParamType
>::Read(const Message
* msg
, Param
* p
) {
21 PickleIterator
iter(*msg
);
22 if (ReadParam(msg
, &iter
, p
))
24 NOTREACHED() << "Error deserializing message " << msg
->type();
28 template <class SendParamType
, class ReplyParamType
>
29 void SyncMessageSchema
<SendParamType
, ReplyParamType
>::Write(
31 const RefSendParam
& send
) {
32 WriteParam(msg
, send
);
35 template <class SendParamType
, class ReplyParamType
>
36 bool SyncMessageSchema
<SendParamType
, ReplyParamType
>::ReadSendParam(
37 const Message
* msg
, SendParam
* p
) {
38 PickleIterator iter
= SyncMessage::GetDataIterator(msg
);
39 return ReadParam(msg
, &iter
, p
);
42 template <class SendParamType
, class ReplyParamType
>
43 bool SyncMessageSchema
<SendParamType
, ReplyParamType
>::ReadReplyParam(
44 const Message
* msg
, typename TupleTypes
<ReplyParam
>::ValueTuple
* p
) {
45 PickleIterator iter
= SyncMessage::GetDataIterator(msg
);
46 return ReadParam(msg
, &iter
, p
);
51 #endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_