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


#include "GMPMessageUtils.h"
#include "mozilla/gmp/GMPTypes.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 NodeIdParts|
//
namespace mozilla {
namespace gmp {
} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::NodeIdParts>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mOrigin());
    // Sentinel = 'mOrigin'
    (aWriter)->WriteSentinel(187630294);
    IPC::WriteParam(aWriter, (aVar).mTopLevelOrigin());
    // Sentinel = 'mTopLevelOrigin'
    (aWriter)->WriteSentinel(798098945);
    IPC::WriteParam(aWriter, (aVar).mGMPName());
    // Sentinel = 'mGMPName'
    (aWriter)->WriteSentinel(207160019);
}

auto ParamTraits<::mozilla::gmp::NodeIdParts>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mOrigin = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___mOrigin) {
        aReader->FatalError("Error deserializing 'mOrigin' (nsString) member of 'NodeIdParts'");
        return {};

    }
    auto& _mOrigin = *maybe___mOrigin;
    // Sentinel = 'mOrigin'
    if ((!((aReader)->ReadSentinel(187630294)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mOrigin' (nsString) member of 'NodeIdParts'");
        return {};
    }
    auto maybe___mTopLevelOrigin = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___mTopLevelOrigin) {
        aReader->FatalError("Error deserializing 'mTopLevelOrigin' (nsString) member of 'NodeIdParts'");
        return {};

    }
    auto& _mTopLevelOrigin = *maybe___mTopLevelOrigin;
    // Sentinel = 'mTopLevelOrigin'
    if ((!((aReader)->ReadSentinel(798098945)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mTopLevelOrigin' (nsString) member of 'NodeIdParts'");
        return {};
    }
    auto maybe___mGMPName = IPC::ReadParam<::nsString>(aReader);
    if (!maybe___mGMPName) {
        aReader->FatalError("Error deserializing 'mGMPName' (nsString) member of 'NodeIdParts'");
        return {};

    }
    auto& _mGMPName = *maybe___mGMPName;
    // Sentinel = 'mGMPName'
    if ((!((aReader)->ReadSentinel(207160019)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mGMPName' (nsString) member of 'NodeIdParts'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_mOrigin),
            std::move(_mTopLevelOrigin),
            std::move(_mGMPName)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union NodeIdVariant|
//
namespace mozilla {
namespace gmp {
auto NodeIdVariant::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TnsCString:
        {
            (ptr_nsCString())->~nsCString__tdef();
            break;
        }
    case TNodeIdParts:
        {
            (ptr_NodeIdParts())->~NodeIdParts__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

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

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

MOZ_IMPLICIT NodeIdVariant::NodeIdVariant(const NodeIdParts& aOther)
{
    new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(aOther);
    mType = TNodeIdParts;
}

MOZ_IMPLICIT NodeIdVariant::NodeIdVariant(NodeIdParts&& aOther)
{
    new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(std::move(aOther));
    mType = TNodeIdParts;
}

MOZ_IMPLICIT NodeIdVariant::NodeIdVariant(const NodeIdVariant& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TnsCString:
        {
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aOther).get_nsCString());
            break;
        }
    case TNodeIdParts:
        {
            new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts((aOther).get_NodeIdParts());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT NodeIdVariant::NodeIdVariant(NodeIdVariant&& 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 TNodeIdParts:
        {
            new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(std::move((aOther).get_NodeIdParts()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

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

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

auto NodeIdVariant::operator=(const NodeIdParts& aRhs) -> NodeIdVariant&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(aRhs);
    mType = TNodeIdParts;
    return (*(this));
}

auto NodeIdVariant::operator=(NodeIdParts&& aRhs) -> NodeIdVariant&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(std::move(aRhs));
    mType = TNodeIdParts;
    return (*(this));
}

auto NodeIdVariant::operator=(const NodeIdVariant& aRhs) -> NodeIdVariant&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TnsCString:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_nsCString()) nsCString((aRhs).get_nsCString());
            break;
        }
    case TNodeIdParts:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts((aRhs).get_NodeIdParts());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto NodeIdVariant::operator=(NodeIdVariant&& aRhs) -> NodeIdVariant&
{
    (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 TNodeIdParts:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_NodeIdParts()) NodeIdParts(std::move((aRhs).get_NodeIdParts()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace gmp
} // namespace mozilla

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

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

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

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

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

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

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct GMPVideoEncodedFrameData|
//
namespace mozilla {
namespace gmp {
auto GMPVideoEncodedFrameData::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(GMPVideoEncodedFrameData, mDuration_) - offsetof(GMPVideoEncodedFrameData, mTimestamp_)) == 8,
        "Bad assumptions about field layout!");
    static_assert(
        (offsetof(GMPVideoEncodedFrameData, mTemporalLayerId_) - offsetof(GMPVideoEncodedFrameData, mEncodedWidth_)) == 16,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::GMPVideoEncodedFrameData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mBufferType());
    // Sentinel = 'mBufferType'
    (aWriter)->WriteSentinel(436012138);
    IPC::WriteParam(aWriter, (aVar).mCompleteFrame());
    // Sentinel = 'mCompleteFrame'
    (aWriter)->WriteSentinel(699663762);
    (aWriter)->WriteBytes((&((aVar).mTimestamp())), 16);
    // Sentinel = 'mTimestamp | mDuration'
    (aWriter)->WriteSentinel(1645807761);
    (aWriter)->WriteBytes((&((aVar).mEncodedWidth())), 20);
    // Sentinel = 'mEncodedWidth | mEncodedHeight | mFrameType | mSize | mTemporalLayerId'
    (aWriter)->WriteSentinel(2499090917);
}

auto ParamTraits<::mozilla::gmp::GMPVideoEncodedFrameData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mBufferType = IPC::ReadParam<::GMPBufferType>(aReader);
    if (!maybe___mBufferType) {
        aReader->FatalError("Error deserializing 'mBufferType' (GMPBufferType) member of 'GMPVideoEncodedFrameData'");
        return {};

    }
    auto& _mBufferType = *maybe___mBufferType;
    // Sentinel = 'mBufferType'
    if ((!((aReader)->ReadSentinel(436012138)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mBufferType' (GMPBufferType) member of 'GMPVideoEncodedFrameData'");
        return {};
    }
    auto maybe___mCompleteFrame = IPC::ReadParam<bool>(aReader);
    if (!maybe___mCompleteFrame) {
        aReader->FatalError("Error deserializing 'mCompleteFrame' (bool) member of 'GMPVideoEncodedFrameData'");
        return {};

    }
    auto& _mCompleteFrame = *maybe___mCompleteFrame;
    // Sentinel = 'mCompleteFrame'
    if ((!((aReader)->ReadSentinel(699663762)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mCompleteFrame' (bool) member of 'GMPVideoEncodedFrameData'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            ::uint32_t{0},
            ::uint64_t{0},
            ::uint64_t{0},
            ::uint32_t{0},
            ::uint32_t{0},
            ::int32_t{0},
            std::move(_mBufferType),
            std::move(_mCompleteFrame)};
    if ((!((aReader)->ReadBytesInto((&((result__)->mTimestamp())), 16)))) {
        aReader->FatalError("Error bulk reading fields from uint64_t");
        return {};
    }
    // Sentinel = 'mTimestamp | mDuration'
    if ((!((aReader)->ReadSentinel(1645807761)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
        return {};
    }
    if ((!((aReader)->ReadBytesInto((&((result__)->mEncodedWidth())), 20)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'mEncodedWidth | mEncodedHeight | mFrameType | mSize | mTemporalLayerId'
    if ((!((aReader)->ReadSentinel(2499090917)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct GMPPlaneData|
//
namespace mozilla {
namespace gmp {
auto GMPPlaneData::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(GMPPlaneData, mStride_) - offsetof(GMPPlaneData, mOffset_)) == 8,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::GMPPlaneData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).mOffset())), 12);
    // Sentinel = 'mOffset | mSize | mStride'
    (aWriter)->WriteSentinel(1993148717);
}

auto ParamTraits<::mozilla::gmp::GMPPlaneData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::int32_t{0},
            ::int32_t{0},
            ::int32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->mOffset())), 12)))) {
        aReader->FatalError("Error bulk reading fields from int32_t");
        return {};
    }
    // Sentinel = 'mOffset | mSize | mStride'
    if ((!((aReader)->ReadSentinel(1993148717)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct GMPVideoi420FrameData|
//
namespace mozilla {
namespace gmp {
auto GMPVideoi420FrameData::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(GMPVideoi420FrameData, mDuration_) - offsetof(GMPVideoi420FrameData, mTimestamp_)) == 8,
        "Bad assumptions about field layout!");
    static_assert(
        (offsetof(GMPVideoi420FrameData, mHeight_) - offsetof(GMPVideoi420FrameData, mWidth_)) == 4,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::GMPVideoi420FrameData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mYPlane());
    // Sentinel = 'mYPlane'
    (aWriter)->WriteSentinel(180093623);
    IPC::WriteParam(aWriter, (aVar).mUPlane());
    // Sentinel = 'mUPlane'
    (aWriter)->WriteSentinel(178520755);
    IPC::WriteParam(aWriter, (aVar).mVPlane());
    // Sentinel = 'mVPlane'
    (aWriter)->WriteSentinel(178913972);
    IPC::WriteParam(aWriter, (aVar).mUpdatedTimestamp());
    // Sentinel = 'mUpdatedTimestamp'
    (aWriter)->WriteSentinel(1028851433);
    (aWriter)->WriteBytes((&((aVar).mTimestamp())), 16);
    // Sentinel = 'mTimestamp | mDuration'
    (aWriter)->WriteSentinel(1645807761);
    (aWriter)->WriteBytes((&((aVar).mWidth())), 8);
    // Sentinel = 'mWidth | mHeight'
    (aWriter)->WriteSentinel(839910896);
}

auto ParamTraits<::mozilla::gmp::GMPVideoi420FrameData>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mYPlane = IPC::ReadParam<::mozilla::gmp::GMPPlaneData>(aReader);
    if (!maybe___mYPlane) {
        aReader->FatalError("Error deserializing 'mYPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};

    }
    auto& _mYPlane = *maybe___mYPlane;
    // Sentinel = 'mYPlane'
    if ((!((aReader)->ReadSentinel(180093623)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mYPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};
    }
    auto maybe___mUPlane = IPC::ReadParam<::mozilla::gmp::GMPPlaneData>(aReader);
    if (!maybe___mUPlane) {
        aReader->FatalError("Error deserializing 'mUPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};

    }
    auto& _mUPlane = *maybe___mUPlane;
    // Sentinel = 'mUPlane'
    if ((!((aReader)->ReadSentinel(178520755)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mUPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};
    }
    auto maybe___mVPlane = IPC::ReadParam<::mozilla::gmp::GMPPlaneData>(aReader);
    if (!maybe___mVPlane) {
        aReader->FatalError("Error deserializing 'mVPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};

    }
    auto& _mVPlane = *maybe___mVPlane;
    // Sentinel = 'mVPlane'
    if ((!((aReader)->ReadSentinel(178913972)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mVPlane' (GMPPlaneData) member of 'GMPVideoi420FrameData'");
        return {};
    }
    auto maybe___mUpdatedTimestamp = IPC::ReadParam<mozilla::Maybe<::uint64_t>>(aReader);
    if (!maybe___mUpdatedTimestamp) {
        aReader->FatalError("Error deserializing 'mUpdatedTimestamp' (uint64_t?) member of 'GMPVideoi420FrameData'");
        return {};

    }
    auto& _mUpdatedTimestamp = *maybe___mUpdatedTimestamp;
    // Sentinel = 'mUpdatedTimestamp'
    if ((!((aReader)->ReadSentinel(1028851433)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mUpdatedTimestamp' (uint64_t?) member of 'GMPVideoi420FrameData'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_mYPlane),
            std::move(_mUPlane),
            std::move(_mVPlane),
            ::int32_t{0},
            ::int32_t{0},
            ::uint64_t{0},
            std::move(_mUpdatedTimestamp),
            ::uint64_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->mTimestamp())), 16)))) {
        aReader->FatalError("Error bulk reading fields from uint64_t");
        return {};
    }
    // Sentinel = 'mTimestamp | mDuration'
    if ((!((aReader)->ReadSentinel(1645807761)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
        return {};
    }
    if ((!((aReader)->ReadBytesInto((&((result__)->mWidth())), 8)))) {
        aReader->FatalError("Error bulk reading fields from int32_t");
        return {};
    }
    // Sentinel = 'mWidth | mHeight'
    if ((!((aReader)->ReadSentinel(839910896)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct CDMInputBuffer|
//
namespace mozilla {
namespace gmp {
auto CDMInputBuffer::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(CDMInputBuffer, mDuration_) - offsetof(CDMInputBuffer, mTimestamp_)) == 8,
        "Bad assumptions about field layout!");
    static_assert(
        (offsetof(CDMInputBuffer, mSkipByteBlock_) - offsetof(CDMInputBuffer, mCryptByteBlock_)) == 1,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::CDMInputBuffer>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, std::move((aVar).mData()));
    // Sentinel = 'mData'
    (aWriter)->WriteSentinel(94503400);
    IPC::WriteParam(aWriter, (aVar).mKeyId());
    // Sentinel = 'mKeyId'
    (aWriter)->WriteSentinel(134218308);
    IPC::WriteParam(aWriter, (aVar).mIV());
    // Sentinel = 'mIV'
    (aWriter)->WriteSentinel(36831501);
    IPC::WriteParam(aWriter, (aVar).mClearBytes());
    // Sentinel = 'mClearBytes'
    (aWriter)->WriteSentinel(426116188);
    IPC::WriteParam(aWriter, (aVar).mCipherBytes());
    // Sentinel = 'mCipherBytes'
    (aWriter)->WriteSentinel(512296144);
    IPC::WriteParam(aWriter, (aVar).mEncryptionScheme());
    // Sentinel = 'mEncryptionScheme'
    (aWriter)->WriteSentinel(1046611694);
    (aWriter)->WriteBytes((&((aVar).mTimestamp())), 16);
    // Sentinel = 'mTimestamp | mDuration'
    (aWriter)->WriteSentinel(1645807761);
    (aWriter)->WriteBytes((&((aVar).mCryptByteBlock())), 2);
    // Sentinel = 'mCryptByteBlock | mSkipByteBlock'
    (aWriter)->WriteSentinel(3404008510);
}

auto ParamTraits<::mozilla::gmp::CDMInputBuffer>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mData = IPC::ReadParam<::mozilla::ipc::Shmem>(aReader);
    if (!maybe___mData) {
        aReader->FatalError("Error deserializing 'mData' (Shmem) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mData = *maybe___mData;
    // Sentinel = 'mData'
    if ((!((aReader)->ReadSentinel(94503400)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mData' (Shmem) member of 'CDMInputBuffer'");
        return {};
    }
    auto maybe___mKeyId = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
    if (!maybe___mKeyId) {
        aReader->FatalError("Error deserializing 'mKeyId' (uint8_t[]) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mKeyId = *maybe___mKeyId;
    // Sentinel = 'mKeyId'
    if ((!((aReader)->ReadSentinel(134218308)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mKeyId' (uint8_t[]) member of 'CDMInputBuffer'");
        return {};
    }
    auto maybe___mIV = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
    if (!maybe___mIV) {
        aReader->FatalError("Error deserializing 'mIV' (uint8_t[]) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mIV = *maybe___mIV;
    // Sentinel = 'mIV'
    if ((!((aReader)->ReadSentinel(36831501)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mIV' (uint8_t[]) member of 'CDMInputBuffer'");
        return {};
    }
    auto maybe___mClearBytes = IPC::ReadParam<nsTArray<::uint32_t>>(aReader);
    if (!maybe___mClearBytes) {
        aReader->FatalError("Error deserializing 'mClearBytes' (uint32_t[]) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mClearBytes = *maybe___mClearBytes;
    // Sentinel = 'mClearBytes'
    if ((!((aReader)->ReadSentinel(426116188)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mClearBytes' (uint32_t[]) member of 'CDMInputBuffer'");
        return {};
    }
    auto maybe___mCipherBytes = IPC::ReadParam<nsTArray<::uint32_t>>(aReader);
    if (!maybe___mCipherBytes) {
        aReader->FatalError("Error deserializing 'mCipherBytes' (uint32_t[]) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mCipherBytes = *maybe___mCipherBytes;
    // Sentinel = 'mCipherBytes'
    if ((!((aReader)->ReadSentinel(512296144)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mCipherBytes' (uint32_t[]) member of 'CDMInputBuffer'");
        return {};
    }
    auto maybe___mEncryptionScheme = IPC::ReadParam<::cdm::EncryptionScheme>(aReader);
    if (!maybe___mEncryptionScheme) {
        aReader->FatalError("Error deserializing 'mEncryptionScheme' (EncryptionScheme) member of 'CDMInputBuffer'");
        return {};

    }
    auto& _mEncryptionScheme = *maybe___mEncryptionScheme;
    // Sentinel = 'mEncryptionScheme'
    if ((!((aReader)->ReadSentinel(1046611694)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mEncryptionScheme' (EncryptionScheme) member of 'CDMInputBuffer'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_mData),
            std::move(_mKeyId),
            std::move(_mIV),
            ::int64_t{0},
            ::int64_t{0},
            std::move(_mClearBytes),
            std::move(_mCipherBytes),
            ::uint8_t{0},
            ::uint8_t{0},
            std::move(_mEncryptionScheme)};
    if ((!((aReader)->ReadBytesInto((&((result__)->mTimestamp())), 16)))) {
        aReader->FatalError("Error bulk reading fields from int64_t");
        return {};
    }
    // Sentinel = 'mTimestamp | mDuration'
    if ((!((aReader)->ReadSentinel(1645807761)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int64_t");
        return {};
    }
    if ((!((aReader)->ReadBytesInto((&((result__)->mCryptByteBlock())), 2)))) {
        aReader->FatalError("Error bulk reading fields from uint8_t");
        return {};
    }
    // Sentinel = 'mCryptByteBlock | mSkipByteBlock'
    if ((!((aReader)->ReadSentinel(3404008510)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint8_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct CDMVideoDecoderConfig|
//
namespace mozilla {
namespace gmp {
auto CDMVideoDecoderConfig::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(CDMVideoDecoderConfig, mImageHeight_) - offsetof(CDMVideoDecoderConfig, mCodec_)) == 16,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::CDMVideoDecoderConfig>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mExtraData());
    // Sentinel = 'mExtraData'
    (aWriter)->WriteSentinel(363987948);
    IPC::WriteParam(aWriter, (aVar).mEncryptionScheme());
    // Sentinel = 'mEncryptionScheme'
    (aWriter)->WriteSentinel(1046611694);
    (aWriter)->WriteBytes((&((aVar).mCodec())), 20);
    // Sentinel = 'mCodec | mProfile | mFormat | mImageWidth | mImageHeight'
    (aWriter)->WriteSentinel(1001067593);
}

auto ParamTraits<::mozilla::gmp::CDMVideoDecoderConfig>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mExtraData = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
    if (!maybe___mExtraData) {
        aReader->FatalError("Error deserializing 'mExtraData' (uint8_t[]) member of 'CDMVideoDecoderConfig'");
        return {};

    }
    auto& _mExtraData = *maybe___mExtraData;
    // Sentinel = 'mExtraData'
    if ((!((aReader)->ReadSentinel(363987948)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mExtraData' (uint8_t[]) member of 'CDMVideoDecoderConfig'");
        return {};
    }
    auto maybe___mEncryptionScheme = IPC::ReadParam<::cdm::EncryptionScheme>(aReader);
    if (!maybe___mEncryptionScheme) {
        aReader->FatalError("Error deserializing 'mEncryptionScheme' (EncryptionScheme) member of 'CDMVideoDecoderConfig'");
        return {};

    }
    auto& _mEncryptionScheme = *maybe___mEncryptionScheme;
    // Sentinel = 'mEncryptionScheme'
    if ((!((aReader)->ReadSentinel(1046611694)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mEncryptionScheme' (EncryptionScheme) member of 'CDMVideoDecoderConfig'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            ::uint32_t{0},
            ::uint32_t{0},
            ::int32_t{0},
            ::int32_t{0},
            std::move(_mExtraData),
            std::move(_mEncryptionScheme)};
    if ((!((aReader)->ReadBytesInto((&((result__)->mCodec())), 20)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'mCodec | mProfile | mFormat | mImageWidth | mImageHeight'
    if ((!((aReader)->ReadSentinel(1001067593)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

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

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::CDMKeyInformation>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mKeyId());
    // Sentinel = 'mKeyId'
    (aWriter)->WriteSentinel(134218308);
    (aWriter)->WriteBytes((&((aVar).mStatus())), 8);
    // Sentinel = 'mStatus | mSystemCode'
    (aWriter)->WriteSentinel(1496582171);
}

auto ParamTraits<::mozilla::gmp::CDMKeyInformation>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mKeyId = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
    if (!maybe___mKeyId) {
        aReader->FatalError("Error deserializing 'mKeyId' (uint8_t[]) member of 'CDMKeyInformation'");
        return {};

    }
    auto& _mKeyId = *maybe___mKeyId;
    // Sentinel = 'mKeyId'
    if ((!((aReader)->ReadSentinel(134218308)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mKeyId' (uint8_t[]) member of 'CDMKeyInformation'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_mKeyId),
            ::uint32_t{0},
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->mStatus())), 8)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'mStatus | mSystemCode'
    if ((!((aReader)->ReadSentinel(1496582171)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

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

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::CDMVideoPlane>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    (aWriter)->WriteBytes((&((aVar).mPlaneOffset())), 8);
    // Sentinel = 'mPlaneOffset | mStride'
    (aWriter)->WriteSentinel(1612843097);
}

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct CDMVideoFrame|
//
namespace mozilla {
namespace gmp {
auto CDMVideoFrame::StaticAssertions() const -> void
{
    static_assert(
        (offsetof(CDMVideoFrame, mDuration_) - offsetof(CDMVideoFrame, mTimestamp_)) == 8,
        "Bad assumptions about field layout!");
    static_assert(
        (offsetof(CDMVideoFrame, mImageHeight_) - offsetof(CDMVideoFrame, mFormat_)) == 8,
        "Bad assumptions about field layout!");
}

} // namespace gmp
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::gmp::CDMVideoFrame>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).mYPlane());
    // Sentinel = 'mYPlane'
    (aWriter)->WriteSentinel(180093623);
    IPC::WriteParam(aWriter, (aVar).mUPlane());
    // Sentinel = 'mUPlane'
    (aWriter)->WriteSentinel(178520755);
    IPC::WriteParam(aWriter, (aVar).mVPlane());
    // Sentinel = 'mVPlane'
    (aWriter)->WriteSentinel(178913972);
    (aWriter)->WriteBytes((&((aVar).mTimestamp())), 16);
    // Sentinel = 'mTimestamp | mDuration'
    (aWriter)->WriteSentinel(1645807761);
    (aWriter)->WriteBytes((&((aVar).mFormat())), 12);
    // Sentinel = 'mFormat | mImageWidth | mImageHeight'
    (aWriter)->WriteSentinel(4094430536);
}

auto ParamTraits<::mozilla::gmp::CDMVideoFrame>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___mYPlane = IPC::ReadParam<::mozilla::gmp::CDMVideoPlane>(aReader);
    if (!maybe___mYPlane) {
        aReader->FatalError("Error deserializing 'mYPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};

    }
    auto& _mYPlane = *maybe___mYPlane;
    // Sentinel = 'mYPlane'
    if ((!((aReader)->ReadSentinel(180093623)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mYPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};
    }
    auto maybe___mUPlane = IPC::ReadParam<::mozilla::gmp::CDMVideoPlane>(aReader);
    if (!maybe___mUPlane) {
        aReader->FatalError("Error deserializing 'mUPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};

    }
    auto& _mUPlane = *maybe___mUPlane;
    // Sentinel = 'mUPlane'
    if ((!((aReader)->ReadSentinel(178520755)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mUPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};
    }
    auto maybe___mVPlane = IPC::ReadParam<::mozilla::gmp::CDMVideoPlane>(aReader);
    if (!maybe___mVPlane) {
        aReader->FatalError("Error deserializing 'mVPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};

    }
    auto& _mVPlane = *maybe___mVPlane;
    // Sentinel = 'mVPlane'
    if ((!((aReader)->ReadSentinel(178913972)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'mVPlane' (CDMVideoPlane) member of 'CDMVideoFrame'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            ::int32_t{0},
            ::int32_t{0},
            std::move(_mYPlane),
            std::move(_mUPlane),
            std::move(_mVPlane),
            ::int64_t{0},
            ::int64_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->mTimestamp())), 16)))) {
        aReader->FatalError("Error bulk reading fields from int64_t");
        return {};
    }
    // Sentinel = 'mTimestamp | mDuration'
    if ((!((aReader)->ReadSentinel(1645807761)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int64_t");
        return {};
    }
    if ((!((aReader)->ReadBytesInto((&((result__)->mFormat())), 12)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'mFormat | mImageWidth | mImageHeight'
    if ((!((aReader)->ReadSentinel(4094430536)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC
