ipc_channel_proxy_unittest_messages.h revision cedac228d2dd51db4b79ea1e72c7f249408ee061
1// Copyright 2014 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. 4 5#include "ipc/ipc_message_macros.h" 6 7// Singly-included section for enums and custom IPC traits. 8#ifndef IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_ 9#define IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_ 10 11class BadType { 12 public: 13 BadType() {} 14}; 15 16namespace IPC { 17 18template <> 19struct ParamTraits<BadType> { 20 static void Write(Message* m, const BadType& p) {} 21 static bool Read(const Message* m, PickleIterator* iter, BadType* r) { 22 return false; 23 } 24 static void Log(const BadType& p, std::string* l) {} 25}; 26 27} 28 29#endif // IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_ 30 31 32#define IPC_MESSAGE_START TestMsgStart 33IPC_MESSAGE_CONTROL0(TestMsg_Bounce) 34IPC_MESSAGE_CONTROL0(TestMsg_SendBadMessage) 35IPC_MESSAGE_CONTROL1(TestMsg_BadMessage, BadType) 36 37#undef IPC_MESSAGE_START 38#define IPC_MESSAGE_START UtilityMsgStart 39IPC_MESSAGE_CONTROL0(UtilityMsg_Bounce) 40 41#undef IPC_MESSAGE_START 42#define IPC_MESSAGE_START WorkerMsgStart 43IPC_MESSAGE_CONTROL0(WorkerMsg_Bounce) 44IPC_MESSAGE_CONTROL0(WorkerMsg_Quit) 45