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


#include "mozilla/HangTypes.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"


//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryBufOffset|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryBufOffset>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).index())), 4);
    // Sentinel = 'index'
    (aWriter)->WriteSentinel(104333849);
}

auto ParamTraits<::mozilla::HangEntryBufOffset>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->index())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'index'
    if ((!((aReader)->ReadSentinel(104333849)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryModOffset|
//
namespace mozilla {
auto HangEntryModOffset::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(HangEntryModOffset, offset_) - offsetof(HangEntryModOffset, module_)) == 4,
        "Bad assumptions about field layout!");
}

} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryModOffset>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).module())), 8);
    // Sentinel = 'module | offset'
    (aWriter)->WriteSentinel(777061834);
}

auto ParamTraits<::mozilla::HangEntryModOffset>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->module())), 8)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'module | offset'
    if ((!((aReader)->ReadSentinel(777061834)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryProgCounter|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryProgCounter>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).pc());
    // Sentinel = 'pc'
    (aWriter)->WriteSentinel(21299412);
}

auto ParamTraits<::mozilla::HangEntryProgCounter>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___pc = IPC::ReadParam<::uintptr_t>(aReader);
    if (!maybe___pc) {
        aReader->FatalError("Error deserializing 'pc' (uintptr_t) member of 'HangEntryProgCounter'");
        return {};

    }
    auto& _pc = *maybe___pc;
    // Sentinel = 'pc'
    if ((!((aReader)->ReadSentinel(21299412)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'pc' (uintptr_t) member of 'HangEntryProgCounter'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_pc)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryContent|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryContent>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
}

auto ParamTraits<::mozilla::HangEntryContent>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{std::in_place};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryJit|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryJit>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
}

auto ParamTraits<::mozilla::HangEntryJit>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{std::in_place};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryWasm|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryWasm>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
}

auto ParamTraits<::mozilla::HangEntryWasm>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{std::in_place};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntryChromeScript|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntryChromeScript>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
}

auto ParamTraits<::mozilla::HangEntryChromeScript>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{std::in_place};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangEntrySuppressed|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangEntrySuppressed>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
}

auto ParamTraits<::mozilla::HangEntrySuppressed>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{std::in_place};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union HangEntry|
//
namespace mozilla {
auto HangEntry::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TnsCString:
        {
            (ptr_nsCString())->~nsCString__tdef();
            break;
        }
    case THangEntryBufOffset:
        {
            (ptr_HangEntryBufOffset())->~HangEntryBufOffset__tdef();
            break;
        }
    case THangEntryModOffset:
        {
            (ptr_HangEntryModOffset())->~HangEntryModOffset__tdef();
            break;
        }
    case THangEntryProgCounter:
        {
            (ptr_HangEntryProgCounter())->~HangEntryProgCounter__tdef();
            break;
        }
    case THangEntryContent:
        {
            (ptr_HangEntryContent())->~HangEntryContent__tdef();
            break;
        }
    case THangEntryJit:
        {
            (ptr_HangEntryJit())->~HangEntryJit__tdef();
            break;
        }
    case THangEntryWasm:
        {
            (ptr_HangEntryWasm())->~HangEntryWasm__tdef();
            break;
        }
    case THangEntryChromeScript:
        {
            (ptr_HangEntryChromeScript())->~HangEntryChromeScript__tdef();
            break;
        }
    case THangEntrySuppressed:
        {
            (ptr_HangEntrySuppressed())->~HangEntrySuppressed__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

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

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

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryBufOffset& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(aOther);
    mType = THangEntryBufOffset;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryBufOffset&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(std::move(aOther));
    mType = THangEntryBufOffset;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryModOffset& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(aOther);
    mType = THangEntryModOffset;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryModOffset&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(std::move(aOther));
    mType = THangEntryModOffset;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryProgCounter& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(aOther);
    mType = THangEntryProgCounter;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryProgCounter&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(std::move(aOther));
    mType = THangEntryProgCounter;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryContent& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(aOther);
    mType = THangEntryContent;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryContent&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(std::move(aOther));
    mType = THangEntryContent;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryJit& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(aOther);
    mType = THangEntryJit;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryJit&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(std::move(aOther));
    mType = THangEntryJit;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryWasm& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(aOther);
    mType = THangEntryWasm;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryWasm&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(std::move(aOther));
    mType = THangEntryWasm;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntryChromeScript& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(aOther);
    mType = THangEntryChromeScript;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntryChromeScript&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(std::move(aOther));
    mType = THangEntryChromeScript;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntrySuppressed& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(aOther);
    mType = THangEntrySuppressed;
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntrySuppressed&& aOther)
{
    new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(std::move(aOther));
    mType = THangEntrySuppressed;
}

MOZ_IMPLICIT HangEntry::HangEntry(const HangEntry& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TnsCString:
        {
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString());
            break;
        }
    case THangEntryBufOffset:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset((aOther).get_HangEntryBufOffset());
            break;
        }
    case THangEntryModOffset:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset((aOther).get_HangEntryModOffset());
            break;
        }
    case THangEntryProgCounter:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter((aOther).get_HangEntryProgCounter());
            break;
        }
    case THangEntryContent:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent((aOther).get_HangEntryContent());
            break;
        }
    case THangEntryJit:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit((aOther).get_HangEntryJit());
            break;
        }
    case THangEntryWasm:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm((aOther).get_HangEntryWasm());
            break;
        }
    case THangEntryChromeScript:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript((aOther).get_HangEntryChromeScript());
            break;
        }
    case THangEntrySuppressed:
        {
            new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed((aOther).get_HangEntrySuppressed());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT HangEntry::HangEntry(HangEntry&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TnsCString:
        {
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move((aOther).get_nsCString()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryBufOffset:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(std::move((aOther).get_HangEntryBufOffset()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryModOffset:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(std::move((aOther).get_HangEntryModOffset()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryProgCounter:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(std::move((aOther).get_HangEntryProgCounter()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryContent:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(std::move((aOther).get_HangEntryContent()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryJit:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(std::move((aOther).get_HangEntryJit()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryWasm:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(std::move((aOther).get_HangEntryWasm()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntryChromeScript:
        {
            new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(std::move((aOther).get_HangEntryChromeScript()));
            (aOther).MaybeDestroy();
            break;
        }
    case THangEntrySuppressed:
        {
            new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(std::move((aOther).get_HangEntrySuppressed()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

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

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

auto HangEntry::operator=(const HangEntryBufOffset& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(aRhs);
    mType = THangEntryBufOffset;
    return (*(this));
}

auto HangEntry::operator=(HangEntryBufOffset&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(std::move(aRhs));
    mType = THangEntryBufOffset;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryModOffset& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(aRhs);
    mType = THangEntryModOffset;
    return (*(this));
}

auto HangEntry::operator=(HangEntryModOffset&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(std::move(aRhs));
    mType = THangEntryModOffset;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryProgCounter& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(aRhs);
    mType = THangEntryProgCounter;
    return (*(this));
}

auto HangEntry::operator=(HangEntryProgCounter&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(std::move(aRhs));
    mType = THangEntryProgCounter;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryContent& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(aRhs);
    mType = THangEntryContent;
    return (*(this));
}

auto HangEntry::operator=(HangEntryContent&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(std::move(aRhs));
    mType = THangEntryContent;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryJit& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(aRhs);
    mType = THangEntryJit;
    return (*(this));
}

auto HangEntry::operator=(HangEntryJit&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(std::move(aRhs));
    mType = THangEntryJit;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryWasm& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(aRhs);
    mType = THangEntryWasm;
    return (*(this));
}

auto HangEntry::operator=(HangEntryWasm&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(std::move(aRhs));
    mType = THangEntryWasm;
    return (*(this));
}

auto HangEntry::operator=(const HangEntryChromeScript& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(aRhs);
    mType = THangEntryChromeScript;
    return (*(this));
}

auto HangEntry::operator=(HangEntryChromeScript&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(std::move(aRhs));
    mType = THangEntryChromeScript;
    return (*(this));
}

auto HangEntry::operator=(const HangEntrySuppressed& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(aRhs);
    mType = THangEntrySuppressed;
    return (*(this));
}

auto HangEntry::operator=(HangEntrySuppressed&& aRhs) -> HangEntry&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(std::move(aRhs));
    mType = THangEntrySuppressed;
    return (*(this));
}

auto HangEntry::operator=(const HangEntry& aRhs) -> HangEntry&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TnsCString:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aRhs).get_nsCString());
            break;
        }
    case THangEntryBufOffset:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset((aRhs).get_HangEntryBufOffset());
            break;
        }
    case THangEntryModOffset:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset((aRhs).get_HangEntryModOffset());
            break;
        }
    case THangEntryProgCounter:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter((aRhs).get_HangEntryProgCounter());
            break;
        }
    case THangEntryContent:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent((aRhs).get_HangEntryContent());
            break;
        }
    case THangEntryJit:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit((aRhs).get_HangEntryJit());
            break;
        }
    case THangEntryWasm:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm((aRhs).get_HangEntryWasm());
            break;
        }
    case THangEntryChromeScript:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript((aRhs).get_HangEntryChromeScript());
            break;
        }
    case THangEntrySuppressed:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed((aRhs).get_HangEntrySuppressed());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto HangEntry::operator=(HangEntry&& aRhs) -> HangEntry&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TnsCString:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString(std::move((aRhs).get_nsCString()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryBufOffset:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryBufOffset()) HangEntryBufOffset(std::move((aRhs).get_HangEntryBufOffset()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryModOffset:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryModOffset()) HangEntryModOffset(std::move((aRhs).get_HangEntryModOffset()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryProgCounter:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryProgCounter()) HangEntryProgCounter(std::move((aRhs).get_HangEntryProgCounter()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryContent:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryContent()) HangEntryContent(std::move((aRhs).get_HangEntryContent()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryJit:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryJit()) HangEntryJit(std::move((aRhs).get_HangEntryJit()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryWasm:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryWasm()) HangEntryWasm(std::move((aRhs).get_HangEntryWasm()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntryChromeScript:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntryChromeScript()) HangEntryChromeScript(std::move((aRhs).get_HangEntryChromeScript()));
            (aRhs).MaybeDestroy();
            break;
        }
    case THangEntrySuppressed:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_HangEntrySuppressed()) HangEntrySuppressed(std::move((aRhs).get_HangEntrySuppressed()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace mozilla

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

    switch (type) {
    case union__::TnsCString:
        {
            IPC::WriteParam(aWriter, (aVar).get_nsCString());
            // Sentinel = 'TnsCString'
            (aWriter)->WriteSentinel(353960944);
            return;
        }
    case union__::THangEntryBufOffset:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryBufOffset());
            // Sentinel = 'THangEntryBufOffset'
            (aWriter)->WriteSentinel(1206912873);
            return;
        }
    case union__::THangEntryModOffset:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryModOffset());
            // Sentinel = 'THangEntryModOffset'
            (aWriter)->WriteSentinel(1209337708);
            return;
        }
    case union__::THangEntryProgCounter:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryProgCounter());
            // Sentinel = 'THangEntryProgCounter'
            (aWriter)->WriteSentinel(1492781149);
            return;
        }
    case union__::THangEntryContent:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryContent());
            // Sentinel = 'THangEntryContent'
            (aWriter)->WriteSentinel(977209024);
            return;
        }
    case union__::THangEntryJit:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryJit());
            // Sentinel = 'THangEntryJit'
            (aWriter)->WriteSentinel(569050380);
            return;
        }
    case union__::THangEntryWasm:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryWasm());
            // Sentinel = 'THangEntryWasm'
            (aWriter)->WriteSentinel(662570365);
            return;
        }
    case union__::THangEntryChromeScript:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntryChromeScript());
            // Sentinel = 'THangEntryChromeScript'
            (aWriter)->WriteSentinel(1630406840);
            return;
        }
    case union__::THangEntrySuppressed:
        {
            IPC::WriteParam(aWriter, (aVar).get_HangEntrySuppressed());
            // Sentinel = 'THangEntrySuppressed'
            (aWriter)->WriteSentinel(1374488595);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union HangEntry");
            return;
        }
    }
}

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

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

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

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

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryBufOffset'
            if ((!((aReader)->ReadSentinel(1206912873)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryBufOffset of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryModOffset:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryModOffset>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryModOffset of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryModOffset'
            if ((!((aReader)->ReadSentinel(1209337708)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryModOffset of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryProgCounter:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryProgCounter>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryProgCounter of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryProgCounter'
            if ((!((aReader)->ReadSentinel(1492781149)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryProgCounter of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryContent:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryContent>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryContent of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryContent'
            if ((!((aReader)->ReadSentinel(977209024)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryContent of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryJit:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryJit>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryJit of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryJit'
            if ((!((aReader)->ReadSentinel(569050380)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryJit of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryWasm:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryWasm>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryWasm of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryWasm'
            if ((!((aReader)->ReadSentinel(662570365)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryWasm of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntryChromeScript:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntryChromeScript>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntryChromeScript of union HangEntry");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'THangEntryChromeScript'
            if ((!((aReader)->ReadSentinel(1630406840)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant THangEntryChromeScript of union HangEntry");
                return {};
            }
            return std::move(tmp);
        }
    case union__::THangEntrySuppressed:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::HangEntrySuppressed>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant THangEntrySuppressed of union HangEntry");
                return {};

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangModule|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangModule>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).breakpadId());
    // Sentinel = 'breakpadId'
    (aWriter)->WriteSentinel(369558504);
}

auto ParamTraits<::mozilla::HangModule>::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 'HangModule'");
        return {};

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

    }
    auto& _breakpadId = *maybe___breakpadId;
    // Sentinel = 'breakpadId'
    if ((!((aReader)->ReadSentinel(369558504)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'breakpadId' (nsCString) member of 'HangModule'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_breakpadId)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangStack|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangStack>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).stack());
    // Sentinel = 'stack'
    (aWriter)->WriteSentinel(107479575);
    IPC::WriteParam(aWriter, (aVar).strbuffer());
    // Sentinel = 'strbuffer'
    (aWriter)->WriteSentinel(325911508);
    IPC::WriteParam(aWriter, (aVar).modules());
    // Sentinel = 'modules'
    (aWriter)->WriteSentinel(199557882);
}

auto ParamTraits<::mozilla::HangStack>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___stack = IPC::ReadParam<nsTArray<::mozilla::HangEntry>>(aReader);
    if (!maybe___stack) {
        aReader->FatalError("Error deserializing 'stack' (HangEntry[]) member of 'HangStack'");
        return {};

    }
    auto& _stack = *maybe___stack;
    // Sentinel = 'stack'
    if ((!((aReader)->ReadSentinel(107479575)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'stack' (HangEntry[]) member of 'HangStack'");
        return {};
    }
    auto maybe___strbuffer = IPC::ReadParam<nsTArray<::int8_t>>(aReader);
    if (!maybe___strbuffer) {
        aReader->FatalError("Error deserializing 'strbuffer' (int8_t[]) member of 'HangStack'");
        return {};

    }
    auto& _strbuffer = *maybe___strbuffer;
    // Sentinel = 'strbuffer'
    if ((!((aReader)->ReadSentinel(325911508)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'strbuffer' (int8_t[]) member of 'HangStack'");
        return {};
    }
    auto maybe___modules = IPC::ReadParam<nsTArray<::mozilla::HangModule>>(aReader);
    if (!maybe___modules) {
        aReader->FatalError("Error deserializing 'modules' (HangModule[]) member of 'HangStack'");
        return {};

    }
    auto& _modules = *maybe___modules;
    // Sentinel = 'modules'
    if ((!((aReader)->ReadSentinel(199557882)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'modules' (HangModule[]) member of 'HangStack'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_stack),
            std::move(_strbuffer),
            std::move(_modules)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangAnnotation|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangAnnotation>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).value());
    // Sentinel = 'value'
    (aWriter)->WriteSentinel(107610654);
}

auto ParamTraits<::mozilla::HangAnnotation>::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 'HangAnnotation'");
        return {};

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

    }
    auto& _value = *maybe___value;
    // Sentinel = 'value'
    if ((!((aReader)->ReadSentinel(107610654)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'value' (nsString) member of 'HangAnnotation'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_value)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct HangDetails|
//
namespace mozilla {
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::HangDetails>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).duration());
    // Sentinel = 'duration'
    (aWriter)->WriteSentinel(256050023);
    IPC::WriteParam(aWriter, (aVar).process());
    // Sentinel = 'process'
    (aWriter)->WriteSentinel(201458432);
    IPC::WriteParam(aWriter, (aVar).remoteType());
    // Sentinel = 'remoteType'
    (aWriter)->WriteSentinel(388826159);
    IPC::WriteParam(aWriter, (aVar).threadName());
    // Sentinel = 'threadName'
    (aWriter)->WriteSentinel(375456762);
    IPC::WriteParam(aWriter, (aVar).runnableName());
    // Sentinel = 'runnableName'
    (aWriter)->WriteSentinel(543556825);
    IPC::WriteParam(aWriter, (aVar).stack());
    // Sentinel = 'stack'
    (aWriter)->WriteSentinel(107479575);
    IPC::WriteParam(aWriter, (aVar).annotations());
    // Sentinel = 'annotations'
    (aWriter)->WriteSentinel(466486447);
}

auto ParamTraits<::mozilla::HangDetails>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___duration = IPC::ReadParam<::mozilla::TimeDuration>(aReader);
    if (!maybe___duration) {
        aReader->FatalError("Error deserializing 'duration' (TimeDuration) member of 'HangDetails'");
        return {};

    }
    auto& _duration = *maybe___duration;
    // Sentinel = 'duration'
    if ((!((aReader)->ReadSentinel(256050023)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'duration' (TimeDuration) member of 'HangDetails'");
        return {};
    }
    auto maybe___process = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___process) {
        aReader->FatalError("Error deserializing 'process' (nsCString) member of 'HangDetails'");
        return {};

    }
    auto& _process = *maybe___process;
    // Sentinel = 'process'
    if ((!((aReader)->ReadSentinel(201458432)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'process' (nsCString) member of 'HangDetails'");
        return {};
    }
    auto maybe___remoteType = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___remoteType) {
        aReader->FatalError("Error deserializing 'remoteType' (nsCString) member of 'HangDetails'");
        return {};

    }
    auto& _remoteType = *maybe___remoteType;
    // Sentinel = 'remoteType'
    if ((!((aReader)->ReadSentinel(388826159)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'remoteType' (nsCString) member of 'HangDetails'");
        return {};
    }
    auto maybe___threadName = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___threadName) {
        aReader->FatalError("Error deserializing 'threadName' (nsCString) member of 'HangDetails'");
        return {};

    }
    auto& _threadName = *maybe___threadName;
    // Sentinel = 'threadName'
    if ((!((aReader)->ReadSentinel(375456762)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'threadName' (nsCString) member of 'HangDetails'");
        return {};
    }
    auto maybe___runnableName = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___runnableName) {
        aReader->FatalError("Error deserializing 'runnableName' (nsCString) member of 'HangDetails'");
        return {};

    }
    auto& _runnableName = *maybe___runnableName;
    // Sentinel = 'runnableName'
    if ((!((aReader)->ReadSentinel(543556825)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'runnableName' (nsCString) member of 'HangDetails'");
        return {};
    }
    auto maybe___stack = IPC::ReadParam<::mozilla::HangStack>(aReader);
    if (!maybe___stack) {
        aReader->FatalError("Error deserializing 'stack' (HangStack) member of 'HangDetails'");
        return {};

    }
    auto& _stack = *maybe___stack;
    // Sentinel = 'stack'
    if ((!((aReader)->ReadSentinel(107479575)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'stack' (HangStack) member of 'HangDetails'");
        return {};
    }
    auto maybe___annotations = IPC::ReadParam<nsTArray<::mozilla::HangAnnotation>>(aReader);
    if (!maybe___annotations) {
        aReader->FatalError("Error deserializing 'annotations' (HangAnnotation[]) member of 'HangDetails'");
        return {};

    }
    auto& _annotations = *maybe___annotations;
    // Sentinel = 'annotations'
    if ((!((aReader)->ReadSentinel(466486447)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'annotations' (HangAnnotation[]) member of 'HangDetails'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_duration),
            std::move(_process),
            std::move(_remoteType),
            std::move(_threadName),
            std::move(_runnableName),
            std::move(_stack),
            std::move(_annotations)};
    return result__;
}

} // namespace IPC
