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


#include "mozilla/layers/PCompositorBridgeTypes.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 RecordedFrameData|
//
namespace mozilla {
namespace layers {
} // namespace layers
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::layers::RecordedFrameData>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).timeOffset());
    // Sentinel = 'timeOffset'
    (aWriter)->WriteSentinel(376767511);
    (aWriter)->WriteBytes((&((aVar).length())), 4);
    // Sentinel = 'length'
    (aWriter)->WriteSentinel(147063427);
}

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

    }
    auto& _timeOffset = *maybe___timeOffset;
    // Sentinel = 'timeOffset'
    if ((!((aReader)->ReadSentinel(376767511)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'timeOffset' (TimeStamp) member of 'RecordedFrameData'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_timeOffset),
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->length())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'length'
    if ((!((aReader)->ReadSentinel(147063427)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

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

namespace IPC {
auto ParamTraits<::mozilla::layers::FrameRecording>::Write(
        IPC::MessageWriter* aWriter,
        paramType&& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).startTime());
    // Sentinel = 'startTime'
    (aWriter)->WriteSentinel(320144318);
    IPC::WriteParam(aWriter, (aVar).frames());
    // Sentinel = 'frames'
    (aWriter)->WriteSentinel(145490559);
    IPC::WriteParam(aWriter, std::move((aVar).bytes()));
    // Sentinel = 'bytes'
    (aWriter)->WriteSentinel(107741736);
}

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

    }
    auto& _startTime = *maybe___startTime;
    // Sentinel = 'startTime'
    if ((!((aReader)->ReadSentinel(320144318)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'startTime' (TimeStamp) member of 'FrameRecording'");
        return {};
    }
    auto maybe___frames = IPC::ReadParam<nsTArray<::mozilla::layers::RecordedFrameData>>(aReader);
    if (!maybe___frames) {
        aReader->FatalError("Error deserializing 'frames' (RecordedFrameData[]) member of 'FrameRecording'");
        return {};

    }
    auto& _frames = *maybe___frames;
    // Sentinel = 'frames'
    if ((!((aReader)->ReadSentinel(145490559)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'frames' (RecordedFrameData[]) member of 'FrameRecording'");
        return {};
    }
    auto maybe___bytes = IPC::ReadParam<::mozilla::ipc::BigBuffer>(aReader);
    if (!maybe___bytes) {
        aReader->FatalError("Error deserializing 'bytes' (BigBuffer) member of 'FrameRecording'");
        return {};

    }
    auto& _bytes = *maybe___bytes;
    // Sentinel = 'bytes'
    if ((!((aReader)->ReadSentinel(107741736)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'bytes' (BigBuffer) member of 'FrameRecording'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_startTime),
            std::move(_frames),
            std::move(_bytes)};
    return result__;
}

} // namespace IPC
