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


#include "mozilla/ipc/ProtocolTypes.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 ProtocolFdMapping|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::ProtocolFdMapping>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).fd());
    // Sentinel = 'fd'
    (aWriter)->WriteSentinel(20054219);
    (aWriter)->WriteBytes((&((aVar).protocolId())), 4);
    // Sentinel = 'protocolId'
    (aWriter)->WriteSentinel(395248672);
}

auto ParamTraits<::mozilla::ipc::ProtocolFdMapping>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___fd = IPC::ReadParam<::mozilla::ipc::FileDescriptor>(aReader);
    if (!maybe___fd) {
        aReader->FatalError("Error deserializing 'fd' (FileDescriptor) member of 'ProtocolFdMapping'");
        return {};

    }
    auto& _fd = *maybe___fd;
    // Sentinel = 'fd'
    if ((!((aReader)->ReadSentinel(20054219)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'fd' (FileDescriptor) member of 'ProtocolFdMapping'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            ::uint32_t{0},
            std::move(_fd)};
    if ((!((aReader)->ReadBytesInto((&((result__)->protocolId())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'protocolId'
    if ((!((aReader)->ReadSentinel(395248672)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC
