Bug 1401111 - Use ContiguousEnumSerializer for EventMessage ParamTraits; r=botond

This commit is contained in:
Julian Hector 2017-12-01 13:00:56 -05:00
parent bcc8e2d1f7
commit 465eaf30eb

View File

@ -21,23 +21,11 @@ namespace IPC
{
template<>
struct ParamTraits<mozilla::EventMessage>
{
typedef mozilla::EventMessage paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<const mozilla::EventMessageType&>(aParam));
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
{
mozilla::EventMessageType eventMessage = 0;
bool ret = ReadParam(aMsg, aIter, &eventMessage);
*aResult = static_cast<paramType>(eventMessage);
return ret;
}
};
struct ParamTraits<mozilla::EventMessage> :
public ContiguousEnumSerializer<mozilla::EventMessage,
mozilla::EventMessage(0),
mozilla::EventMessage::eEventMessage_MaxValue>
{};
template<>
struct ParamTraits<mozilla::BaseEventFlags>