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


#include "mozilla/GfxMessageUtils.h"
#include "mozilla/layers/WebRenderMessageUtils.h"
#include "mozilla/gfx/PCanvasManagerParent.h"
#include "mozilla/gfx/PCanvasManagerChild.h"
#include "mozilla/layers/PCompositorBridgeParent.h"
#include "mozilla/layers/PCompositorBridgeChild.h"
#include "gfxipc/ShadowLayerUtils.h"
#include "mozilla/GfxMessageUtils.h"
#include "mozilla/layers/LayersMessageUtils.h"
#include "mozilla/layers/WebRenderMessageUtils.h"
#include "mozilla/layers/PCompositorManager.h"
#include "mozilla/layers/PCompositorManagerParent.h"
#include "mozilla/layers/PCompositorManagerChild.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 layers {
namespace PCompositorManager {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::layers::PCompositorManagerParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::layers::PCompositorManagerChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg_PCompositorBridgeConstructor(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_PCompositorBridgeConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply_PCompositorBridgeConstructor(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_PCompositorBridgeConstructor__ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::REPLY));
}
mozilla::UniquePtr<IPC::Message>
Msg_AddSharedSurface(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_AddSharedSurface__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_RemoveSharedSurface(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_RemoveSharedSurface__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_ReportSharedSurfacesMemory(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_ReportSharedSurfacesMemory__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_ReportSharedSurfacesMemory(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_ReportSharedSurfacesMemory__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));
}
mozilla::UniquePtr<IPC::Message>
Msg_NotifyMemoryPressure(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_NotifyMemoryPressure__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_ReportMemory(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_ReportMemory__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_ReportMemory(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply_ReportMemory__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));
}
mozilla::UniquePtr<IPC::Message>
Msg_InitCanvasManager(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_InitCanvasManager__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_NotifyWebRenderError(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg_NotifyWebRenderError__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));
}

} // namespace PCompositorManager
} // namespace layers
} // namespace mozilla

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

namespace IPC {
auto ParamTraits<::mozilla::layers::WidgetCompositorOptions>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).scale());
    // Sentinel = 'scale'
    (aWriter)->WriteSentinel(103809545);
    IPC::WriteParam(aWriter, (aVar).vsyncRate());
    // Sentinel = 'vsyncRate'
    (aWriter)->WriteSentinel(324076480);
    IPC::WriteParam(aWriter, (aVar).options());
    // Sentinel = 'options'
    (aWriter)->WriteSentinel(204735245);
    IPC::WriteParam(aWriter, (aVar).useExternalSurfaceSize());
    // Sentinel = 'useExternalSurfaceSize'
    (aWriter)->WriteSentinel(1742735605);
    IPC::WriteParam(aWriter, (aVar).surfaceSize());
    // Sentinel = 'surfaceSize'
    (aWriter)->WriteSentinel(462554245);
    (aWriter)->WriteBytes((&((aVar).innerWindowId())), 8);
    // Sentinel = 'innerWindowId'
    (aWriter)->WriteSentinel(627967298);
}

auto ParamTraits<::mozilla::layers::WidgetCompositorOptions>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___scale = IPC::ReadParam<::mozilla::CSSToLayoutDeviceScale>(aReader);
    if (!maybe___scale) {
        aReader->FatalError("Error deserializing 'scale' (CSSToLayoutDeviceScale) member of 'WidgetCompositorOptions'");
        return {};

    }
    auto& _scale = *maybe___scale;
    // Sentinel = 'scale'
    if ((!((aReader)->ReadSentinel(103809545)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'scale' (CSSToLayoutDeviceScale) member of 'WidgetCompositorOptions'");
        return {};
    }
    auto maybe___vsyncRate = IPC::ReadParam<::mozilla::TimeDuration>(aReader);
    if (!maybe___vsyncRate) {
        aReader->FatalError("Error deserializing 'vsyncRate' (TimeDuration) member of 'WidgetCompositorOptions'");
        return {};

    }
    auto& _vsyncRate = *maybe___vsyncRate;
    // Sentinel = 'vsyncRate'
    if ((!((aReader)->ReadSentinel(324076480)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'vsyncRate' (TimeDuration) member of 'WidgetCompositorOptions'");
        return {};
    }
    auto maybe___options = IPC::ReadParam<::mozilla::layers::CompositorOptions>(aReader);
    if (!maybe___options) {
        aReader->FatalError("Error deserializing 'options' (CompositorOptions) member of 'WidgetCompositorOptions'");
        return {};

    }
    auto& _options = *maybe___options;
    // Sentinel = 'options'
    if ((!((aReader)->ReadSentinel(204735245)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'options' (CompositorOptions) member of 'WidgetCompositorOptions'");
        return {};
    }
    auto maybe___useExternalSurfaceSize = IPC::ReadParam<bool>(aReader);
    if (!maybe___useExternalSurfaceSize) {
        aReader->FatalError("Error deserializing 'useExternalSurfaceSize' (bool) member of 'WidgetCompositorOptions'");
        return {};

    }
    auto& _useExternalSurfaceSize = *maybe___useExternalSurfaceSize;
    // Sentinel = 'useExternalSurfaceSize'
    if ((!((aReader)->ReadSentinel(1742735605)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'useExternalSurfaceSize' (bool) member of 'WidgetCompositorOptions'");
        return {};
    }
    auto maybe___surfaceSize = IPC::ReadParam<::mozilla::gfx::IntSize>(aReader);
    if (!maybe___surfaceSize) {
        aReader->FatalError("Error deserializing 'surfaceSize' (IntSize) member of 'WidgetCompositorOptions'");
        return {};

    }
    auto& _surfaceSize = *maybe___surfaceSize;
    // Sentinel = 'surfaceSize'
    if ((!((aReader)->ReadSentinel(462554245)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'surfaceSize' (IntSize) member of 'WidgetCompositorOptions'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_scale),
            std::move(_vsyncRate),
            std::move(_options),
            std::move(_useExternalSurfaceSize),
            std::move(_surfaceSize),
            ::uint64_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->innerWindowId())), 8)))) {
        aReader->FatalError("Error bulk reading fields from uint64_t");
        return {};
    }
    // Sentinel = 'innerWindowId'
    if ((!((aReader)->ReadSentinel(627967298)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
        return {};
    }
    return result__;
}

} // namespace IPC

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

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

auto ParamTraits<::mozilla::layers::ContentCompositorOptions>::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 SameProcessWidgetCompositorOptions|
//
namespace mozilla {
namespace layers {
} // namespace layers
} // namespace mozilla

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

auto ParamTraits<::mozilla::layers::SameProcessWidgetCompositorOptions>::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 CompositorBridgeOptions|
//
namespace mozilla {
namespace layers {
auto CompositorBridgeOptions::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TContentCompositorOptions:
        {
            (ptr_ContentCompositorOptions())->~ContentCompositorOptions__tdef();
            break;
        }
    case TWidgetCompositorOptions:
        {
            (ptr_WidgetCompositorOptions())->~WidgetCompositorOptions__tdef();
            break;
        }
    case TSameProcessWidgetCompositorOptions:
        {
            (ptr_SameProcessWidgetCompositorOptions())->~SameProcessWidgetCompositorOptions__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(const ContentCompositorOptions& aOther)
{
    new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(aOther);
    mType = TContentCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(ContentCompositorOptions&& aOther)
{
    new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(std::move(aOther));
    mType = TContentCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(const WidgetCompositorOptions& aOther)
{
    new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(aOther);
    mType = TWidgetCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(WidgetCompositorOptions&& aOther)
{
    new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(std::move(aOther));
    mType = TWidgetCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(const SameProcessWidgetCompositorOptions& aOther)
{
    new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(aOther);
    mType = TSameProcessWidgetCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(SameProcessWidgetCompositorOptions&& aOther)
{
    new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(std::move(aOther));
    mType = TSameProcessWidgetCompositorOptions;
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(const CompositorBridgeOptions& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TContentCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions((aOther).get_ContentCompositorOptions());
            break;
        }
    case TWidgetCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions((aOther).get_WidgetCompositorOptions());
            break;
        }
    case TSameProcessWidgetCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions((aOther).get_SameProcessWidgetCompositorOptions());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT CompositorBridgeOptions::CompositorBridgeOptions(CompositorBridgeOptions&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TContentCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(std::move((aOther).get_ContentCompositorOptions()));
            (aOther).MaybeDestroy();
            break;
        }
    case TWidgetCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(std::move((aOther).get_WidgetCompositorOptions()));
            (aOther).MaybeDestroy();
            break;
        }
    case TSameProcessWidgetCompositorOptions:
        {
            new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(std::move((aOther).get_SameProcessWidgetCompositorOptions()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

auto CompositorBridgeOptions::operator=(const ContentCompositorOptions& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(aRhs);
    mType = TContentCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(ContentCompositorOptions&& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(std::move(aRhs));
    mType = TContentCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(const WidgetCompositorOptions& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(aRhs);
    mType = TWidgetCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(WidgetCompositorOptions&& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(std::move(aRhs));
    mType = TWidgetCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(const SameProcessWidgetCompositorOptions& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(aRhs);
    mType = TSameProcessWidgetCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(SameProcessWidgetCompositorOptions&& aRhs) -> CompositorBridgeOptions&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(std::move(aRhs));
    mType = TSameProcessWidgetCompositorOptions;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(const CompositorBridgeOptions& aRhs) -> CompositorBridgeOptions&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TContentCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions((aRhs).get_ContentCompositorOptions());
            break;
        }
    case TWidgetCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions((aRhs).get_WidgetCompositorOptions());
            break;
        }
    case TSameProcessWidgetCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions((aRhs).get_SameProcessWidgetCompositorOptions());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto CompositorBridgeOptions::operator=(CompositorBridgeOptions&& aRhs) -> CompositorBridgeOptions&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TContentCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_ContentCompositorOptions()) ContentCompositorOptions(std::move((aRhs).get_ContentCompositorOptions()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TWidgetCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_WidgetCompositorOptions()) WidgetCompositorOptions(std::move((aRhs).get_WidgetCompositorOptions()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TSameProcessWidgetCompositorOptions:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_SameProcessWidgetCompositorOptions()) SameProcessWidgetCompositorOptions(std::move((aRhs).get_SameProcessWidgetCompositorOptions()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace layers
} // namespace mozilla

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

    switch (type) {
    case union__::TContentCompositorOptions:
        {
            IPC::WriteParam(aWriter, (aVar).get_ContentCompositorOptions());
            // Sentinel = 'TContentCompositorOptions'
            (aWriter)->WriteSentinel(2188905035);
            return;
        }
    case union__::TWidgetCompositorOptions:
        {
            IPC::WriteParam(aWriter, (aVar).get_WidgetCompositorOptions());
            // Sentinel = 'TWidgetCompositorOptions'
            (aWriter)->WriteSentinel(2003962324);
            return;
        }
    case union__::TSameProcessWidgetCompositorOptions:
        {
            IPC::WriteParam(aWriter, (aVar).get_SameProcessWidgetCompositorOptions());
            // Sentinel = 'TSameProcessWidgetCompositorOptions'
            (aWriter)->WriteSentinel(4187950649);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union CompositorBridgeOptions");
            return;
        }
    }
}

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

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

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

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TContentCompositorOptions'
            if ((!((aReader)->ReadSentinel(2188905035)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TContentCompositorOptions of union CompositorBridgeOptions");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TWidgetCompositorOptions:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::layers::WidgetCompositorOptions>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TWidgetCompositorOptions of union CompositorBridgeOptions");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TWidgetCompositorOptions'
            if ((!((aReader)->ReadSentinel(2003962324)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TWidgetCompositorOptions of union CompositorBridgeOptions");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSameProcessWidgetCompositorOptions:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::layers::SameProcessWidgetCompositorOptions>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSameProcessWidgetCompositorOptions of union CompositorBridgeOptions");
                return {};

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

} // namespace IPC
