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


#include "mozilla/dom/DomSecurityIPCUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/dom/CSPMessageUtils.h"
#include "mozilla/dom/PolicyContainerMessageUtils.h"
#include "mozilla/dom/DocShellMessageUtils.h"
#include "mozilla/dom/NavigationAPIIPCUtils.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/PropertyBagUtils.h"
#include "mozilla/dom/ReferrerInfoUtils.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "mozilla/dom/notification/IPCUtils.h"
#include "mozilla/ipc/URIUtils.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/URLClassifierIPCUtils.h"
#include "mozilla/dom/SharedWorkerOpArgs.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 SharedWorkerSuspendOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerSuspendOpArgs>::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 SharedWorkerResumeOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerResumeOpArgs>::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 SharedWorkerFreezeOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerFreezeOpArgs>::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 SharedWorkerThawOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerThawOpArgs>::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 SharedWorkerTerminateOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerTerminateOpArgs>::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 SharedWorkerPortIdentifierOpArgs|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::SharedWorkerPortIdentifierOpArgs>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___portIdentifier = IPC::ReadParam<::mozilla::dom::MessagePortIdentifier>(aReader);
    if (!maybe___portIdentifier) {
        aReader->FatalError("Error deserializing 'portIdentifier' (MessagePortIdentifier) member of 'SharedWorkerPortIdentifierOpArgs'");
        return {};

    }
    auto& _portIdentifier = *maybe___portIdentifier;
    // Sentinel = 'portIdentifier'
    if ((!((aReader)->ReadSentinel(729875913)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'portIdentifier' (MessagePortIdentifier) member of 'SharedWorkerPortIdentifierOpArgs'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_portIdentifier)};
    return result__;
}

} // namespace IPC

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

namespace IPC {
auto ParamTraits<::mozilla::dom::SharedWorkerAddWindowIDOpArgs>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).windowID())), 8);
    // Sentinel = 'windowID'
    (aWriter)->WriteSentinel(253625126);
}

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

} // namespace IPC

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

namespace IPC {
auto ParamTraits<::mozilla::dom::SharedWorkerRemoveWindowIDOpArgs>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).windowID())), 8);
    // Sentinel = 'windowID'
    (aWriter)->WriteSentinel(253625126);
}

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union SharedWorkerOpArgs|
//
namespace mozilla {
namespace dom {
auto SharedWorkerOpArgs::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TSharedWorkerSuspendOpArgs:
        {
            (ptr_SharedWorkerSuspendOpArgs())->~SharedWorkerSuspendOpArgs__tdef();
            break;
        }
    case TSharedWorkerResumeOpArgs:
        {
            (ptr_SharedWorkerResumeOpArgs())->~SharedWorkerResumeOpArgs__tdef();
            break;
        }
    case TSharedWorkerFreezeOpArgs:
        {
            (ptr_SharedWorkerFreezeOpArgs())->~SharedWorkerFreezeOpArgs__tdef();
            break;
        }
    case TSharedWorkerThawOpArgs:
        {
            (ptr_SharedWorkerThawOpArgs())->~SharedWorkerThawOpArgs__tdef();
            break;
        }
    case TSharedWorkerTerminateOpArgs:
        {
            (ptr_SharedWorkerTerminateOpArgs())->~SharedWorkerTerminateOpArgs__tdef();
            break;
        }
    case TSharedWorkerPortIdentifierOpArgs:
        {
            (ptr_SharedWorkerPortIdentifierOpArgs())->~SharedWorkerPortIdentifierOpArgs__tdef();
            break;
        }
    case TSharedWorkerAddWindowIDOpArgs:
        {
            (ptr_SharedWorkerAddWindowIDOpArgs())->~SharedWorkerAddWindowIDOpArgs__tdef();
            break;
        }
    case TSharedWorkerRemoveWindowIDOpArgs:
        {
            (ptr_SharedWorkerRemoveWindowIDOpArgs())->~SharedWorkerRemoveWindowIDOpArgs__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerSuspendOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(aOther);
    mType = TSharedWorkerSuspendOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerSuspendOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(std::move(aOther));
    mType = TSharedWorkerSuspendOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerResumeOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(aOther);
    mType = TSharedWorkerResumeOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerResumeOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(std::move(aOther));
    mType = TSharedWorkerResumeOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerFreezeOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(aOther);
    mType = TSharedWorkerFreezeOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerFreezeOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(std::move(aOther));
    mType = TSharedWorkerFreezeOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerThawOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(aOther);
    mType = TSharedWorkerThawOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerThawOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(std::move(aOther));
    mType = TSharedWorkerThawOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerTerminateOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(aOther);
    mType = TSharedWorkerTerminateOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerTerminateOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(std::move(aOther));
    mType = TSharedWorkerTerminateOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerPortIdentifierOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(aOther);
    mType = TSharedWorkerPortIdentifierOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerPortIdentifierOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(std::move(aOther));
    mType = TSharedWorkerPortIdentifierOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerAddWindowIDOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(aOther);
    mType = TSharedWorkerAddWindowIDOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerAddWindowIDOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(std::move(aOther));
    mType = TSharedWorkerAddWindowIDOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerRemoveWindowIDOpArgs& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(aOther);
    mType = TSharedWorkerRemoveWindowIDOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerRemoveWindowIDOpArgs&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(std::move(aOther));
    mType = TSharedWorkerRemoveWindowIDOpArgs;
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(const SharedWorkerOpArgs& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TSharedWorkerSuspendOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs((aOther).get_SharedWorkerSuspendOpArgs());
            break;
        }
    case TSharedWorkerResumeOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs((aOther).get_SharedWorkerResumeOpArgs());
            break;
        }
    case TSharedWorkerFreezeOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs((aOther).get_SharedWorkerFreezeOpArgs());
            break;
        }
    case TSharedWorkerThawOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs((aOther).get_SharedWorkerThawOpArgs());
            break;
        }
    case TSharedWorkerTerminateOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs((aOther).get_SharedWorkerTerminateOpArgs());
            break;
        }
    case TSharedWorkerPortIdentifierOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs((aOther).get_SharedWorkerPortIdentifierOpArgs());
            break;
        }
    case TSharedWorkerAddWindowIDOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs((aOther).get_SharedWorkerAddWindowIDOpArgs());
            break;
        }
    case TSharedWorkerRemoveWindowIDOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs((aOther).get_SharedWorkerRemoveWindowIDOpArgs());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT SharedWorkerOpArgs::SharedWorkerOpArgs(SharedWorkerOpArgs&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TSharedWorkerSuspendOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(std::move((aOther).get_SharedWorkerSuspendOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerResumeOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(std::move((aOther).get_SharedWorkerResumeOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerFreezeOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(std::move((aOther).get_SharedWorkerFreezeOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerThawOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(std::move((aOther).get_SharedWorkerThawOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerTerminateOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(std::move((aOther).get_SharedWorkerTerminateOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerPortIdentifierOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(std::move((aOther).get_SharedWorkerPortIdentifierOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerAddWindowIDOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(std::move((aOther).get_SharedWorkerAddWindowIDOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSharedWorkerRemoveWindowIDOpArgs:
        {
            new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(std::move((aOther).get_SharedWorkerRemoveWindowIDOpArgs()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

auto SharedWorkerOpArgs::operator=(const SharedWorkerSuspendOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(aRhs);
    mType = TSharedWorkerSuspendOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerSuspendOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(std::move(aRhs));
    mType = TSharedWorkerSuspendOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerResumeOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(aRhs);
    mType = TSharedWorkerResumeOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerResumeOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(std::move(aRhs));
    mType = TSharedWorkerResumeOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerFreezeOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(aRhs);
    mType = TSharedWorkerFreezeOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerFreezeOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(std::move(aRhs));
    mType = TSharedWorkerFreezeOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerThawOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(aRhs);
    mType = TSharedWorkerThawOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerThawOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(std::move(aRhs));
    mType = TSharedWorkerThawOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerTerminateOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(aRhs);
    mType = TSharedWorkerTerminateOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerTerminateOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(std::move(aRhs));
    mType = TSharedWorkerTerminateOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerPortIdentifierOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(aRhs);
    mType = TSharedWorkerPortIdentifierOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerPortIdentifierOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(std::move(aRhs));
    mType = TSharedWorkerPortIdentifierOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerAddWindowIDOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(aRhs);
    mType = TSharedWorkerAddWindowIDOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerAddWindowIDOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(std::move(aRhs));
    mType = TSharedWorkerAddWindowIDOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerRemoveWindowIDOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(aRhs);
    mType = TSharedWorkerRemoveWindowIDOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerRemoveWindowIDOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(std::move(aRhs));
    mType = TSharedWorkerRemoveWindowIDOpArgs;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(const SharedWorkerOpArgs& aRhs) -> SharedWorkerOpArgs&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TSharedWorkerSuspendOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs((aRhs).get_SharedWorkerSuspendOpArgs());
            break;
        }
    case TSharedWorkerResumeOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs((aRhs).get_SharedWorkerResumeOpArgs());
            break;
        }
    case TSharedWorkerFreezeOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs((aRhs).get_SharedWorkerFreezeOpArgs());
            break;
        }
    case TSharedWorkerThawOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs((aRhs).get_SharedWorkerThawOpArgs());
            break;
        }
    case TSharedWorkerTerminateOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs((aRhs).get_SharedWorkerTerminateOpArgs());
            break;
        }
    case TSharedWorkerPortIdentifierOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs((aRhs).get_SharedWorkerPortIdentifierOpArgs());
            break;
        }
    case TSharedWorkerAddWindowIDOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs((aRhs).get_SharedWorkerAddWindowIDOpArgs());
            break;
        }
    case TSharedWorkerRemoveWindowIDOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs((aRhs).get_SharedWorkerRemoveWindowIDOpArgs());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto SharedWorkerOpArgs::operator=(SharedWorkerOpArgs&& aRhs) -> SharedWorkerOpArgs&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TSharedWorkerSuspendOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerSuspendOpArgs()) SharedWorkerSuspendOpArgs(std::move((aRhs).get_SharedWorkerSuspendOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerResumeOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerResumeOpArgs()) SharedWorkerResumeOpArgs(std::move((aRhs).get_SharedWorkerResumeOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerFreezeOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerFreezeOpArgs()) SharedWorkerFreezeOpArgs(std::move((aRhs).get_SharedWorkerFreezeOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerThawOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerThawOpArgs()) SharedWorkerThawOpArgs(std::move((aRhs).get_SharedWorkerThawOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerTerminateOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerTerminateOpArgs()) SharedWorkerTerminateOpArgs(std::move((aRhs).get_SharedWorkerTerminateOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerPortIdentifierOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerPortIdentifierOpArgs()) SharedWorkerPortIdentifierOpArgs(std::move((aRhs).get_SharedWorkerPortIdentifierOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerAddWindowIDOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerAddWindowIDOpArgs()) SharedWorkerAddWindowIDOpArgs(std::move((aRhs).get_SharedWorkerAddWindowIDOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSharedWorkerRemoveWindowIDOpArgs:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SharedWorkerRemoveWindowIDOpArgs()) SharedWorkerRemoveWindowIDOpArgs(std::move((aRhs).get_SharedWorkerRemoveWindowIDOpArgs()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace dom
} // namespace mozilla

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

    switch (type) {
    case union__::TSharedWorkerSuspendOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerSuspendOpArgs());
            // Sentinel = 'TSharedWorkerSuspendOpArgs'
            (aWriter)->WriteSentinel(2317814356);
            return;
        }
    case union__::TSharedWorkerResumeOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerResumeOpArgs());
            // Sentinel = 'TSharedWorkerResumeOpArgs'
            (aWriter)->WriteSentinel(2134444515);
            return;
        }
    case union__::TSharedWorkerFreezeOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerFreezeOpArgs());
            // Sentinel = 'TSharedWorkerFreezeOpArgs'
            (aWriter)->WriteSentinel(2122582483);
            return;
        }
    case union__::TSharedWorkerThawOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerThawOpArgs());
            // Sentinel = 'TSharedWorkerThawOpArgs'
            (aWriter)->WriteSentinel(1798375686);
            return;
        }
    case union__::TSharedWorkerTerminateOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerTerminateOpArgs());
            // Sentinel = 'TSharedWorkerTerminateOpArgs'
            (aWriter)->WriteSentinel(2678655771);
            return;
        }
    case union__::TSharedWorkerPortIdentifierOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerPortIdentifierOpArgs());
            // Sentinel = 'TSharedWorkerPortIdentifierOpArgs'
            (aWriter)->WriteSentinel(3709275418);
            return;
        }
    case union__::TSharedWorkerAddWindowIDOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerAddWindowIDOpArgs());
            // Sentinel = 'TSharedWorkerAddWindowIDOpArgs'
            (aWriter)->WriteSentinel(2997029760);
            return;
        }
    case union__::TSharedWorkerRemoveWindowIDOpArgs:
        {
            IPC::WriteParam(aWriter, (aVar).get_SharedWorkerRemoveWindowIDOpArgs());
            // Sentinel = 'TSharedWorkerRemoveWindowIDOpArgs'
            (aWriter)->WriteSentinel(3689090277);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union SharedWorkerOpArgs");
            return;
        }
    }
}

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

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

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

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerSuspendOpArgs'
            if ((!((aReader)->ReadSentinel(2317814356)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerSuspendOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerResumeOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerResumeOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerResumeOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerResumeOpArgs'
            if ((!((aReader)->ReadSentinel(2134444515)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerResumeOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerFreezeOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerFreezeOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerFreezeOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerFreezeOpArgs'
            if ((!((aReader)->ReadSentinel(2122582483)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerFreezeOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerThawOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerThawOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerThawOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerThawOpArgs'
            if ((!((aReader)->ReadSentinel(1798375686)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerThawOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerTerminateOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerTerminateOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerTerminateOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerTerminateOpArgs'
            if ((!((aReader)->ReadSentinel(2678655771)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerTerminateOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerPortIdentifierOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerPortIdentifierOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerPortIdentifierOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerPortIdentifierOpArgs'
            if ((!((aReader)->ReadSentinel(3709275418)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerPortIdentifierOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerAddWindowIDOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerAddWindowIDOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerAddWindowIDOpArgs of union SharedWorkerOpArgs");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSharedWorkerAddWindowIDOpArgs'
            if ((!((aReader)->ReadSentinel(2997029760)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSharedWorkerAddWindowIDOpArgs of union SharedWorkerOpArgs");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSharedWorkerRemoveWindowIDOpArgs:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::SharedWorkerRemoveWindowIDOpArgs>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSharedWorkerRemoveWindowIDOpArgs of union SharedWorkerOpArgs");
                return {};

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

} // namespace IPC
