//
// Automatically generated by ipdlc.
// Edit at your own risk
//


#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/dom/network/TCPSocketParent.h"
#include "mozilla/dom/network/TCPSocketChild.h"
#include "mozilla/net/PNeckoParent.h"
#include "mozilla/net/PNeckoChild.h"
#include "mozilla/net/PTCPSocket.h"
#include "mozilla/net/PTCPSocketParent.h"
#include "mozilla/net/PTCPSocketChild.h"

#include "ipc/IPCMessageUtils.h"
#include "ipc/IPCMessageUtilsSpecializations.h"
#include "nsIFile.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/ProtocolMessageUtils.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/ShmemMessageUtils.h"
#include "mozilla/ipc/TaintingIPCUtils.h"

namespace mozilla {
namespace net {
namespace PTCPSocket {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::net::PTCPSocketParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::net::PTCPSocketChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_Open(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Open__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Data(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Data__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_StartTLS(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_StartTLS__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Suspend(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Suspend__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Resume(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Resume__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Close(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Close__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_Callback(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_Callback__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_UpdateBufferedAmount(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_UpdateBufferedAmount__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_RequestDelete(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_RequestDelete__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::REPLY));
}

} // namespace PTCPSocket
} // namespace net
} // namespace mozilla

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct TCPError|
//

namespace IPC {
auto ParamTraits<::TCPError>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).message());
    // Sentinel = 'message'
    (aWriter)->WriteSentinel(197198566);
    IPC::WriteParam(aWriter, (aVar).errorCode());
    // Sentinel = 'errorCode'
    (aWriter)->WriteSentinel(312345510);
}

auto ParamTraits<::TCPError>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___name = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___name) {
        aReader->FatalError("Error deserializing 'name' (nsString) member of 'TCPError'");
        return {};

    }
    auto& _name = *maybe___name;
    // Sentinel = 'name'
    if ((!((aReader)->ReadSentinel(69075362)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsString) member of 'TCPError'");
        return {};
    }
    auto maybe___message = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___message) {
        aReader->FatalError("Error deserializing 'message' (nsString) member of 'TCPError'");
        return {};

    }
    auto& _message = *maybe___message;
    // Sentinel = 'message'
    if ((!((aReader)->ReadSentinel(197198566)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'message' (nsString) member of 'TCPError'");
        return {};
    }
    auto maybe___errorCode = IPC::ReadParam<::nsresult>(aReader);
    if (!maybe___errorCode) {
        aReader->FatalError("Error deserializing 'errorCode' (nsresult) member of 'TCPError'");
        return {};

    }
    auto& _errorCode = *maybe___errorCode;
    // Sentinel = 'errorCode'
    if ((!((aReader)->ReadSentinel(312345510)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'errorCode' (nsresult) member of 'TCPError'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_message),
            std::move(_errorCode)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union SendableData|
//
auto SendableData::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TArrayOfuint8_t:
        {
            (ptr_ArrayOfuint8_t())->~ArrayOfuint8_t__tdef();
            break;
        }
    case TnsCString:
        {
            (ptr_nsCString())->~nsCString__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT SendableData::SendableData(const nsTArray<uint8_t>& aOther)
{
    new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aOther).Clone());
    mType = TArrayOfuint8_t;
}

MOZ_IMPLICIT SendableData::SendableData(nsTArray<uint8_t>&& aOther)
{
    new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move(aOther));
    mType = TArrayOfuint8_t;
}

MOZ_IMPLICIT SendableData::SendableData(const nsCString& aOther)
{
    new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(aOther);
    mType = TnsCString;
}

MOZ_IMPLICIT SendableData::SendableData(nsCString&& aOther)
{
    new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move(aOther));
    mType = TnsCString;
}

MOZ_IMPLICIT SendableData::SendableData(const SendableData& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TArrayOfuint8_t:
        {
            new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(((aOther).get_ArrayOfuint8_t()).Clone());
            break;
        }
    case TnsCString:
        {
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT SendableData::SendableData(SendableData&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TArrayOfuint8_t:
        {
            new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move((aOther).get_ArrayOfuint8_t()));
            (aOther).MaybeDestroy();
            break;
        }
    case TnsCString:
        {
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move((aOther).get_nsCString()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

SendableData::~SendableData()
{
    MaybeDestroy();
}

auto SendableData::operator=(const nsTArray<uint8_t>& aRhs) -> SendableData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>((aRhs).Clone());
    mType = TArrayOfuint8_t;
    return (*(this));
}

auto SendableData::operator=(nsTArray<uint8_t>&& aRhs) -> SendableData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move(aRhs));
    mType = TArrayOfuint8_t;
    return (*(this));
}

auto SendableData::operator=(const nsCString& aRhs) -> SendableData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(aRhs);
    mType = TnsCString;
    return (*(this));
}

auto SendableData::operator=(nsCString&& aRhs) -> SendableData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move(aRhs));
    mType = TnsCString;
    return (*(this));
}

auto SendableData::operator=(const SendableData& aRhs) -> SendableData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TArrayOfuint8_t:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(((aRhs).get_ArrayOfuint8_t()).Clone());
            break;
        }
    case TnsCString:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aRhs).get_nsCString());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto SendableData::operator=(SendableData&& aRhs) -> SendableData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TArrayOfuint8_t:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_ArrayOfuint8_t()) nsTArray<uint8_t>(std::move((aRhs).get_ArrayOfuint8_t()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TnsCString:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move((aRhs).get_nsCString()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}


namespace IPC {
auto ParamTraits<::SendableData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    typedef ::SendableData union__;
    int type = (aVar).type();
    IPC::WriteParam(aWriter, type);
    // Sentinel = 'SendableData'
    (aWriter)->WriteSentinel(499778713);

    switch (type) {
    case union__::TArrayOfuint8_t:
        {
            IPC::WriteParam(aWriter, (aVar).get_ArrayOfuint8_t());
            // Sentinel = 'TArrayOfuint8_t'
            (aWriter)->WriteSentinel(771753428);
            return;
        }
    case union__::TnsCString:
        {
            IPC::WriteParam(aWriter, (aVar).get_nsCString());
            // Sentinel = 'TnsCString'
            (aWriter)->WriteSentinel(353960944);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union SendableData");
            return;
        }
    }
}

auto ParamTraits<::SendableData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    typedef ::SendableData union__;
    auto maybe__type = IPC::ReadParam<int>(aReader);
    if (!maybe__type) {
        aReader->FatalError("Error deserializing type of union SendableData");
        return {};

    }
    auto& type = *maybe__type;
    // Sentinel = 'SendableData'
    if ((!((aReader)->ReadSentinel(499778713)))) {
        mozilla::ipc::SentinelReadError("Error deserializing type of union SendableData");
        return {};
    }

    switch (type) {
    case union__::TArrayOfuint8_t:
        {
            auto maybe__tmp = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TArrayOfuint8_t of union SendableData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TArrayOfuint8_t'
            if ((!((aReader)->ReadSentinel(771753428)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TArrayOfuint8_t of union SendableData");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TnsCString:
        {
            auto maybe__tmp = IPC::ReadParam<::nsCString>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TnsCString of union SendableData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TnsCString'
            if ((!((aReader)->ReadSentinel(353960944)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TnsCString of union SendableData");
                return {};
            }
            return std::move(tmp);
        }
    default:
        {
            aReader->FatalError("unknown variant of union SendableData");
            return {};
        }
    }
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union CallbackData|
//
auto CallbackData::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case Tvoid_t:
        {
            (ptr_void_t())->~void_t__tdef();
            break;
        }
    case TSendableData:
        {
            (ptr_SendableData())->~SendableData__tdef();
            break;
        }
    case TTCPError:
        {
            (ptr_TCPError())->~TCPError__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT CallbackData::CallbackData(const void_t& aOther)
{
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(aOther);
    mType = Tvoid_t;
}

MOZ_IMPLICIT CallbackData::CallbackData(void_t&& aOther)
{
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aOther));
    mType = Tvoid_t;
}

MOZ_IMPLICIT CallbackData::CallbackData(const SendableData& aOther)
{
    new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(aOther);
    mType = TSendableData;
}

MOZ_IMPLICIT CallbackData::CallbackData(SendableData&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(std::move(aOther));
    mType = TSendableData;
}

MOZ_IMPLICIT CallbackData::CallbackData(const TCPError& aOther)
{
    new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(aOther);
    mType = TTCPError;
}

MOZ_IMPLICIT CallbackData::CallbackData(TCPError&& aOther)
{
    new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(std::move(aOther));
    mType = TTCPError;
}

MOZ_IMPLICIT CallbackData::CallbackData(const CallbackData& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case Tvoid_t:
        {
            new (mozilla::KnownNotNull, ptr_void_t()) void_t((aOther).get_void_t());
            break;
        }
    case TSendableData:
        {
            new (mozilla::KnownNotNull, ptr_SendableData()) SendableData((aOther).get_SendableData());
            break;
        }
    case TTCPError:
        {
            new (mozilla::KnownNotNull, ptr_TCPError()) TCPError((aOther).get_TCPError());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT CallbackData::CallbackData(CallbackData&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case Tvoid_t:
        {
            new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aOther).get_void_t()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSendableData:
        {
            new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(std::move((aOther).get_SendableData()));
            (aOther).MaybeDestroy();
            break;
        }
    case TTCPError:
        {
            new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(std::move((aOther).get_TCPError()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

CallbackData::~CallbackData()
{
    MaybeDestroy();
}

auto CallbackData::operator=(const void_t& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(aRhs);
    mType = Tvoid_t;
    return (*(this));
}

auto CallbackData::operator=(void_t&& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move(aRhs));
    mType = Tvoid_t;
    return (*(this));
}

auto CallbackData::operator=(const SendableData& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(aRhs);
    mType = TSendableData;
    return (*(this));
}

auto CallbackData::operator=(SendableData&& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(std::move(aRhs));
    mType = TSendableData;
    return (*(this));
}

auto CallbackData::operator=(const TCPError& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(aRhs);
    mType = TTCPError;
    return (*(this));
}

auto CallbackData::operator=(TCPError&& aRhs) -> CallbackData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(std::move(aRhs));
    mType = TTCPError;
    return (*(this));
}

auto CallbackData::operator=(const CallbackData& aRhs) -> CallbackData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case Tvoid_t:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_void_t()) void_t((aRhs).get_void_t());
            break;
        }
    case TSendableData:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SendableData()) SendableData((aRhs).get_SendableData());
            break;
        }
    case TTCPError:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_TCPError()) TCPError((aRhs).get_TCPError());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto CallbackData::operator=(CallbackData&& aRhs) -> CallbackData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case Tvoid_t:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_void_t()) void_t(std::move((aRhs).get_void_t()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSendableData:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SendableData()) SendableData(std::move((aRhs).get_SendableData()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TTCPError:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_TCPError()) TCPError(std::move((aRhs).get_TCPError()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}


namespace IPC {
auto ParamTraits<::CallbackData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    typedef ::CallbackData union__;
    int type = (aVar).type();
    IPC::WriteParam(aWriter, type);
    // Sentinel = 'CallbackData'
    (aWriter)->WriteSentinel(486212744);

    switch (type) {
    case union__::Tvoid_t:
        {
            IPC::WriteParam(aWriter, (aVar).get_void_t());
            // Sentinel = 'Tvoid_t'
            (aWriter)->WriteSentinel(189006554);
            return;
        }
    case union__::TSendableData:
        {
            IPC::WriteParam(aWriter, (aVar).get_SendableData());
            // Sentinel = 'TSendableData'
            (aWriter)->WriteSentinel(571409645);
            return;
        }
    case union__::TTCPError:
        {
            IPC::WriteParam(aWriter, (aVar).get_TCPError());
            // Sentinel = 'TTCPError'
            (aWriter)->WriteSentinel(253297478);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union CallbackData");
            return;
        }
    }
}

auto ParamTraits<::CallbackData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    typedef ::CallbackData union__;
    auto maybe__type = IPC::ReadParam<int>(aReader);
    if (!maybe__type) {
        aReader->FatalError("Error deserializing type of union CallbackData");
        return {};

    }
    auto& type = *maybe__type;
    // Sentinel = 'CallbackData'
    if ((!((aReader)->ReadSentinel(486212744)))) {
        mozilla::ipc::SentinelReadError("Error deserializing type of union CallbackData");
        return {};
    }

    switch (type) {
    case union__::Tvoid_t:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::void_t>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant Tvoid_t of union CallbackData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'Tvoid_t'
            if ((!((aReader)->ReadSentinel(189006554)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant Tvoid_t of union CallbackData");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSendableData:
        {
            auto maybe__tmp = IPC::ReadParam<::SendableData>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSendableData of union CallbackData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSendableData'
            if ((!((aReader)->ReadSentinel(571409645)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSendableData of union CallbackData");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TTCPError:
        {
            auto maybe__tmp = IPC::ReadParam<::TCPError>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TTCPError of union CallbackData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TTCPError'
            if ((!((aReader)->ReadSentinel(253297478)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TTCPError of union CallbackData");
                return {};
            }
            return std::move(tmp);
        }
    default:
        {
            aReader->FatalError("unknown variant of union CallbackData");
            return {};
        }
    }
}

} // namespace IPC
