// Copyright (c) 2012 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 a few IPC unit tests. #ifndef IPC_IPC_MESSAGE_UTILS_IMPL_H_ #define IPC_IPC_MESSAGE_UTILS_IMPL_H_ namespace IPC { template void MessageSchema::Write(Message* msg, const RefParam& p) { WriteParam(msg, p); } template bool MessageSchema::Read(const Message* msg, Param* p) { PickleIterator iter(*msg); if (ReadParam(msg, &iter, p)) return true; NOTREACHED() << "Error deserializing message " << msg->type(); return false; } template void SyncMessageSchema::Write( Message* msg, const RefSendParam& send) { WriteParam(msg, send); } template bool SyncMessageSchema::ReadSendParam( const Message* msg, SendParam* p) { PickleIterator iter = SyncMessage::GetDataIterator(msg); return ReadParam(msg, &iter, p); } template bool SyncMessageSchema::ReadReplyParam( const Message* msg, typename TupleTypes::ValueTuple* p) { PickleIterator iter = SyncMessage::GetDataIterator(msg); return ReadParam(msg, &iter, p); } } // namespace IPC #endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_