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


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

namespace IPC {
auto ParamTraits<::mozilla::ipc::HeaderEntry>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).name());
    // Sentinel = 'name'
    (aWriter)->WriteSentinel(69075362);
    IPC::WriteParam(aWriter, (aVar).value());
    // Sentinel = 'value'
    (aWriter)->WriteSentinel(107610654);
}

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

    }
    auto& _name = *maybe___name;
    // Sentinel = 'name'
    if ((!((aReader)->ReadSentinel(69075362)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'name' (nsCString) member of 'HeaderEntry'");
        return {};
    }
    auto maybe___value = IPC::ReadParam<::nsCString>(aReader);
    if (!maybe___value) {
        aReader->FatalError("Error deserializing 'value' (nsCString) member of 'HeaderEntry'");
        return {};

    }
    auto& _value = *maybe___value;
    // Sentinel = 'value'
    if ((!((aReader)->ReadSentinel(107610654)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'value' (nsCString) member of 'HeaderEntry'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_name),
            std::move(_value)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct StringInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::StringInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).data());
    // Sentinel = 'data'
    (aWriter)->WriteSentinel(67109275);
}

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

    }
    auto& _data = *maybe___data;
    // Sentinel = 'data'
    if ((!((aReader)->ReadSentinel(67109275)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'data' (nsCString) member of 'StringInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_data)};
    return result__;
}

} // namespace IPC

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

} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::FileInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).fileDescriptor());
    // Sentinel = 'fileDescriptor'
    (aWriter)->WriteSentinel(704972224);
    (aWriter)->WriteBytes((&((aVar).behaviorFlags())), 8);
    // Sentinel = 'behaviorFlags | ioFlags'
    (aWriter)->WriteSentinel(1787627711);
}

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

    }
    auto& _fileDescriptor = *maybe___fileDescriptor;
    // Sentinel = 'fileDescriptor'
    if ((!((aReader)->ReadSentinel(704972224)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'fileDescriptor' (FileDescriptor) member of 'FileInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_fileDescriptor),
            ::int32_t{0},
            ::int32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->behaviorFlags())), 8)))) {
        aReader->FatalError("Error bulk reading fields from int32_t");
        return {};
    }
    // Sentinel = 'behaviorFlags | ioFlags'
    if ((!((aReader)->ReadSentinel(1787627711)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct MultiplexInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::MultiplexInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).streams());
    // Sentinel = 'streams'
    (aWriter)->WriteSentinel(203555584);
    IPC::WriteParam(aWriter, (aVar).status());
    // Sentinel = 'status'
    (aWriter)->WriteSentinel(154731173);
    IPC::WriteParam(aWriter, (aVar).startedReadingCurrent());
    // Sentinel = 'startedReadingCurrent'
    (aWriter)->WriteSentinel(1583614101);
    (aWriter)->WriteBytes((&((aVar).currentStream())), 4);
    // Sentinel = 'currentStream'
    (aWriter)->WriteSentinel(644810096);
}

auto ParamTraits<::mozilla::ipc::MultiplexInputStreamParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___streams = IPC::ReadParam<nsTArray<::mozilla::ipc::InputStreamParams>>(aReader);
    if (!maybe___streams) {
        aReader->FatalError("Error deserializing 'streams' (InputStreamParams[]) member of 'MultiplexInputStreamParams'");
        return {};

    }
    auto& _streams = *maybe___streams;
    // Sentinel = 'streams'
    if ((!((aReader)->ReadSentinel(203555584)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'streams' (InputStreamParams[]) member of 'MultiplexInputStreamParams'");
        return {};
    }
    auto maybe___status = IPC::ReadParam<::nsresult>(aReader);
    if (!maybe___status) {
        aReader->FatalError("Error deserializing 'status' (nsresult) member of 'MultiplexInputStreamParams'");
        return {};

    }
    auto& _status = *maybe___status;
    // Sentinel = 'status'
    if ((!((aReader)->ReadSentinel(154731173)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'status' (nsresult) member of 'MultiplexInputStreamParams'");
        return {};
    }
    auto maybe___startedReadingCurrent = IPC::ReadParam<bool>(aReader);
    if (!maybe___startedReadingCurrent) {
        aReader->FatalError("Error deserializing 'startedReadingCurrent' (bool) member of 'MultiplexInputStreamParams'");
        return {};

    }
    auto& _startedReadingCurrent = *maybe___startedReadingCurrent;
    // Sentinel = 'startedReadingCurrent'
    if ((!((aReader)->ReadSentinel(1583614101)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'startedReadingCurrent' (bool) member of 'MultiplexInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_streams),
            ::uint32_t{0},
            std::move(_status),
            std::move(_startedReadingCurrent)};
    if ((!((aReader)->ReadBytesInto((&((result__)->currentStream())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'currentStream'
    if ((!((aReader)->ReadSentinel(644810096)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

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

} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::SlicedInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).stream());
    // Sentinel = 'stream'
    (aWriter)->WriteSentinel(153223821);
    IPC::WriteParam(aWriter, (aVar).closed());
    // Sentinel = 'closed'
    (aWriter)->WriteSentinel(146211451);
    (aWriter)->WriteBytes((&((aVar).start())), 24);
    // Sentinel = 'start | length | curPos'
    (aWriter)->WriteSentinel(1747781797);
}

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

    }
    auto& _stream = *maybe___stream;
    // Sentinel = 'stream'
    if ((!((aReader)->ReadSentinel(153223821)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'stream' (InputStreamParams) member of 'SlicedInputStreamParams'");
        return {};
    }
    auto maybe___closed = IPC::ReadParam<bool>(aReader);
    if (!maybe___closed) {
        aReader->FatalError("Error deserializing 'closed' (bool) member of 'SlicedInputStreamParams'");
        return {};

    }
    auto& _closed = *maybe___closed;
    // Sentinel = 'closed'
    if ((!((aReader)->ReadSentinel(146211451)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'closed' (bool) member of 'SlicedInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_stream),
            ::uint64_t{0},
            ::uint64_t{0},
            ::uint64_t{0},
            std::move(_closed)};
    if ((!((aReader)->ReadBytesInto((&((result__)->start())), 24)))) {
        aReader->FatalError("Error bulk reading fields from uint64_t");
        return {};
    }
    // Sentinel = 'start | length | curPos'
    if ((!((aReader)->ReadSentinel(1747781797)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint64_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct RemoteLazyInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::RemoteLazyInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).stream());
    // Sentinel = 'stream'
    (aWriter)->WriteSentinel(153223821);
}

auto ParamTraits<::mozilla::ipc::RemoteLazyInputStreamParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___stream = IPC::ReadParam<mozilla::NotNull<RefPtr<::mozilla::RemoteLazyInputStream>>>(aReader);
    if (!maybe___stream) {
        aReader->FatalError("Error deserializing 'stream' (NotNull<RemoteLazyInputStream>) member of 'RemoteLazyInputStreamParams'");
        return {};

    }
    auto& _stream = *maybe___stream;
    // Sentinel = 'stream'
    if ((!((aReader)->ReadSentinel(153223821)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'stream' (NotNull<RemoteLazyInputStream>) member of 'RemoteLazyInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_stream)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct DataPipeReceiverStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::DataPipeReceiverStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).pipe());
    // Sentinel = 'pipe'
    (aWriter)->WriteSentinel(71565743);
}

auto ParamTraits<::mozilla::ipc::DataPipeReceiverStreamParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___pipe = IPC::ReadParam<mozilla::NotNull<RefPtr<::mozilla::ipc::DataPipeReceiver>>>(aReader);
    if (!maybe___pipe) {
        aReader->FatalError("Error deserializing 'pipe' (NotNull<DataPipeReceiver>) member of 'DataPipeReceiverStreamParams'");
        return {};

    }
    auto& _pipe = *maybe___pipe;
    // Sentinel = 'pipe'
    if ((!((aReader)->ReadSentinel(71565743)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'pipe' (NotNull<DataPipeReceiver>) member of 'DataPipeReceiverStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_pipe)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union InputStreamParams|
//
namespace mozilla {
namespace ipc {
auto InputStreamParams::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TStringInputStreamParams:
        {
            (ptr_StringInputStreamParams())->~StringInputStreamParams__tdef();
            break;
        }
    case TFileInputStreamParams:
        {
            (ptr_FileInputStreamParams())->~FileInputStreamParams__tdef();
            break;
        }
    case TBufferedInputStreamParams:
        {
            delete ptr_BufferedInputStreamParams();
            break;
        }
    case TMIMEInputStreamParams:
        {
            delete ptr_MIMEInputStreamParams();
            break;
        }
    case TMultiplexInputStreamParams:
        {
            delete ptr_MultiplexInputStreamParams();
            break;
        }
    case TSlicedInputStreamParams:
        {
            delete ptr_SlicedInputStreamParams();
            break;
        }
    case TRemoteLazyInputStreamParams:
        {
            (ptr_RemoteLazyInputStreamParams())->~RemoteLazyInputStreamParams__tdef();
            break;
        }
    case TInputStreamLengthWrapperParams:
        {
            delete ptr_InputStreamLengthWrapperParams();
            break;
        }
    case TEncryptedFileInputStreamParams:
        {
            delete ptr_EncryptedFileInputStreamParams();
            break;
        }
    case TDataPipeReceiverStreamParams:
        {
            (ptr_DataPipeReceiverStreamParams())->~DataPipeReceiverStreamParams__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const StringInputStreamParams& aOther)
{
    new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(aOther);
    mType = TStringInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(StringInputStreamParams&& aOther)
{
    new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(std::move(aOther));
    mType = TStringInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const FileInputStreamParams& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(aOther);
    mType = TFileInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(FileInputStreamParams&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(std::move(aOther));
    mType = TFileInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const BufferedInputStreamParams& aOther)
{
    ptr_BufferedInputStreamParams() = new BufferedInputStreamParams(aOther);
    mType = TBufferedInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(BufferedInputStreamParams&& aOther)
{
    ptr_BufferedInputStreamParams() = new BufferedInputStreamParams(std::move(aOther));
    mType = TBufferedInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const MIMEInputStreamParams& aOther)
{
    ptr_MIMEInputStreamParams() = new MIMEInputStreamParams(aOther);
    mType = TMIMEInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(MIMEInputStreamParams&& aOther)
{
    ptr_MIMEInputStreamParams() = new MIMEInputStreamParams(std::move(aOther));
    mType = TMIMEInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const MultiplexInputStreamParams& aOther)
{
    ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams(aOther);
    mType = TMultiplexInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(MultiplexInputStreamParams&& aOther)
{
    ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams(std::move(aOther));
    mType = TMultiplexInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const SlicedInputStreamParams& aOther)
{
    ptr_SlicedInputStreamParams() = new SlicedInputStreamParams(aOther);
    mType = TSlicedInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(SlicedInputStreamParams&& aOther)
{
    ptr_SlicedInputStreamParams() = new SlicedInputStreamParams(std::move(aOther));
    mType = TSlicedInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const RemoteLazyInputStreamParams& aOther)
{
    new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(aOther);
    mType = TRemoteLazyInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(RemoteLazyInputStreamParams&& aOther)
{
    new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(std::move(aOther));
    mType = TRemoteLazyInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const InputStreamLengthWrapperParams& aOther)
{
    ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams(aOther);
    mType = TInputStreamLengthWrapperParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(InputStreamLengthWrapperParams&& aOther)
{
    ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams(std::move(aOther));
    mType = TInputStreamLengthWrapperParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const EncryptedFileInputStreamParams& aOther)
{
    ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams(aOther);
    mType = TEncryptedFileInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(EncryptedFileInputStreamParams&& aOther)
{
    ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams(std::move(aOther));
    mType = TEncryptedFileInputStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const DataPipeReceiverStreamParams& aOther)
{
    new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(aOther);
    mType = TDataPipeReceiverStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(DataPipeReceiverStreamParams&& aOther)
{
    new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(std::move(aOther));
    mType = TDataPipeReceiverStreamParams;
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(const InputStreamParams& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TStringInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams((aOther).get_StringInputStreamParams());
            break;
        }
    case TFileInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams((aOther).get_FileInputStreamParams());
            break;
        }
    case TBufferedInputStreamParams:
        {
            ptr_BufferedInputStreamParams() = new BufferedInputStreamParams((aOther).get_BufferedInputStreamParams());
            break;
        }
    case TMIMEInputStreamParams:
        {
            ptr_MIMEInputStreamParams() = new MIMEInputStreamParams((aOther).get_MIMEInputStreamParams());
            break;
        }
    case TMultiplexInputStreamParams:
        {
            ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams((aOther).get_MultiplexInputStreamParams());
            break;
        }
    case TSlicedInputStreamParams:
        {
            ptr_SlicedInputStreamParams() = new SlicedInputStreamParams((aOther).get_SlicedInputStreamParams());
            break;
        }
    case TRemoteLazyInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams((aOther).get_RemoteLazyInputStreamParams());
            break;
        }
    case TInputStreamLengthWrapperParams:
        {
            ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams((aOther).get_InputStreamLengthWrapperParams());
            break;
        }
    case TEncryptedFileInputStreamParams:
        {
            ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams((aOther).get_EncryptedFileInputStreamParams());
            break;
        }
    case TDataPipeReceiverStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams((aOther).get_DataPipeReceiverStreamParams());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT InputStreamParams::InputStreamParams(InputStreamParams&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TStringInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(std::move((aOther).get_StringInputStreamParams()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(std::move((aOther).get_FileInputStreamParams()));
            (aOther).MaybeDestroy();
            break;
        }
    case TBufferedInputStreamParams:
        {
            ptr_BufferedInputStreamParams() = (aOther).ptr_BufferedInputStreamParams();
            break;
        }
    case TMIMEInputStreamParams:
        {
            ptr_MIMEInputStreamParams() = (aOther).ptr_MIMEInputStreamParams();
            break;
        }
    case TMultiplexInputStreamParams:
        {
            ptr_MultiplexInputStreamParams() = (aOther).ptr_MultiplexInputStreamParams();
            break;
        }
    case TSlicedInputStreamParams:
        {
            ptr_SlicedInputStreamParams() = (aOther).ptr_SlicedInputStreamParams();
            break;
        }
    case TRemoteLazyInputStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(std::move((aOther).get_RemoteLazyInputStreamParams()));
            (aOther).MaybeDestroy();
            break;
        }
    case TInputStreamLengthWrapperParams:
        {
            ptr_InputStreamLengthWrapperParams() = (aOther).ptr_InputStreamLengthWrapperParams();
            break;
        }
    case TEncryptedFileInputStreamParams:
        {
            ptr_EncryptedFileInputStreamParams() = (aOther).ptr_EncryptedFileInputStreamParams();
            break;
        }
    case TDataPipeReceiverStreamParams:
        {
            new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(std::move((aOther).get_DataPipeReceiverStreamParams()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

auto InputStreamParams::operator=(const StringInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(aRhs);
    mType = TStringInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(StringInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(std::move(aRhs));
    mType = TStringInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const FileInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(aRhs);
    mType = TFileInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(FileInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(std::move(aRhs));
    mType = TFileInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const BufferedInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_BufferedInputStreamParams() = new BufferedInputStreamParams(aRhs);
    mType = TBufferedInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(BufferedInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_BufferedInputStreamParams() = new BufferedInputStreamParams(std::move(aRhs));
    mType = TBufferedInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const MIMEInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_MIMEInputStreamParams() = new MIMEInputStreamParams(aRhs);
    mType = TMIMEInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(MIMEInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_MIMEInputStreamParams() = new MIMEInputStreamParams(std::move(aRhs));
    mType = TMIMEInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const MultiplexInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams(aRhs);
    mType = TMultiplexInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(MultiplexInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams(std::move(aRhs));
    mType = TMultiplexInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const SlicedInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_SlicedInputStreamParams() = new SlicedInputStreamParams(aRhs);
    mType = TSlicedInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(SlicedInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_SlicedInputStreamParams() = new SlicedInputStreamParams(std::move(aRhs));
    mType = TSlicedInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const RemoteLazyInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(aRhs);
    mType = TRemoteLazyInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(RemoteLazyInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(std::move(aRhs));
    mType = TRemoteLazyInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const InputStreamLengthWrapperParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams(aRhs);
    mType = TInputStreamLengthWrapperParams;
    return (*(this));
}

auto InputStreamParams::operator=(InputStreamLengthWrapperParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams(std::move(aRhs));
    mType = TInputStreamLengthWrapperParams;
    return (*(this));
}

auto InputStreamParams::operator=(const EncryptedFileInputStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams(aRhs);
    mType = TEncryptedFileInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(EncryptedFileInputStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams(std::move(aRhs));
    mType = TEncryptedFileInputStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const DataPipeReceiverStreamParams& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(aRhs);
    mType = TDataPipeReceiverStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(DataPipeReceiverStreamParams&& aRhs) -> InputStreamParams&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(std::move(aRhs));
    mType = TDataPipeReceiverStreamParams;
    return (*(this));
}

auto InputStreamParams::operator=(const InputStreamParams& aRhs) -> InputStreamParams&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TStringInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams((aRhs).get_StringInputStreamParams());
            break;
        }
    case TFileInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams((aRhs).get_FileInputStreamParams());
            break;
        }
    case TBufferedInputStreamParams:
        {
            MaybeDestroy();
            ptr_BufferedInputStreamParams() = new BufferedInputStreamParams((aRhs).get_BufferedInputStreamParams());
            break;
        }
    case TMIMEInputStreamParams:
        {
            MaybeDestroy();
            ptr_MIMEInputStreamParams() = new MIMEInputStreamParams((aRhs).get_MIMEInputStreamParams());
            break;
        }
    case TMultiplexInputStreamParams:
        {
            MaybeDestroy();
            ptr_MultiplexInputStreamParams() = new MultiplexInputStreamParams((aRhs).get_MultiplexInputStreamParams());
            break;
        }
    case TSlicedInputStreamParams:
        {
            MaybeDestroy();
            ptr_SlicedInputStreamParams() = new SlicedInputStreamParams((aRhs).get_SlicedInputStreamParams());
            break;
        }
    case TRemoteLazyInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams((aRhs).get_RemoteLazyInputStreamParams());
            break;
        }
    case TInputStreamLengthWrapperParams:
        {
            MaybeDestroy();
            ptr_InputStreamLengthWrapperParams() = new InputStreamLengthWrapperParams((aRhs).get_InputStreamLengthWrapperParams());
            break;
        }
    case TEncryptedFileInputStreamParams:
        {
            MaybeDestroy();
            ptr_EncryptedFileInputStreamParams() = new EncryptedFileInputStreamParams((aRhs).get_EncryptedFileInputStreamParams());
            break;
        }
    case TDataPipeReceiverStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams((aRhs).get_DataPipeReceiverStreamParams());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto InputStreamParams::operator=(InputStreamParams&& aRhs) -> InputStreamParams&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TStringInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_StringInputStreamParams()) StringInputStreamParams(std::move((aRhs).get_StringInputStreamParams()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileInputStreamParams()) FileInputStreamParams(std::move((aRhs).get_FileInputStreamParams()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TBufferedInputStreamParams:
        {
            MaybeDestroy();
            ptr_BufferedInputStreamParams() = (aRhs).ptr_BufferedInputStreamParams();
            break;
        }
    case TMIMEInputStreamParams:
        {
            MaybeDestroy();
            ptr_MIMEInputStreamParams() = (aRhs).ptr_MIMEInputStreamParams();
            break;
        }
    case TMultiplexInputStreamParams:
        {
            MaybeDestroy();
            ptr_MultiplexInputStreamParams() = (aRhs).ptr_MultiplexInputStreamParams();
            break;
        }
    case TSlicedInputStreamParams:
        {
            MaybeDestroy();
            ptr_SlicedInputStreamParams() = (aRhs).ptr_SlicedInputStreamParams();
            break;
        }
    case TRemoteLazyInputStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_RemoteLazyInputStreamParams()) RemoteLazyInputStreamParams(std::move((aRhs).get_RemoteLazyInputStreamParams()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TInputStreamLengthWrapperParams:
        {
            MaybeDestroy();
            ptr_InputStreamLengthWrapperParams() = (aRhs).ptr_InputStreamLengthWrapperParams();
            break;
        }
    case TEncryptedFileInputStreamParams:
        {
            MaybeDestroy();
            ptr_EncryptedFileInputStreamParams() = (aRhs).ptr_EncryptedFileInputStreamParams();
            break;
        }
    case TDataPipeReceiverStreamParams:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_DataPipeReceiverStreamParams()) DataPipeReceiverStreamParams(std::move((aRhs).get_DataPipeReceiverStreamParams()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace ipc
} // namespace mozilla

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

    switch (type) {
    case union__::TStringInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_StringInputStreamParams());
            // Sentinel = 'TStringInputStreamParams'
            (aWriter)->WriteSentinel(2010057132);
            return;
        }
    case union__::TFileInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileInputStreamParams());
            // Sentinel = 'TFileInputStreamParams'
            (aWriter)->WriteSentinel(1641154741);
            return;
        }
    case union__::TBufferedInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_BufferedInputStreamParams());
            // Sentinel = 'TBufferedInputStreamParams'
            (aWriter)->WriteSentinel(2300971608);
            return;
        }
    case union__::TMIMEInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_MIMEInputStreamParams());
            // Sentinel = 'TMIMEInputStreamParams'
            (aWriter)->WriteSentinel(1532495965);
            return;
        }
    case union__::TMultiplexInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_MultiplexInputStreamParams());
            // Sentinel = 'TMultiplexInputStreamParams'
            (aWriter)->WriteSentinel(2563443449);
            return;
        }
    case union__::TSlicedInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_SlicedInputStreamParams());
            // Sentinel = 'TSlicedInputStreamParams'
            (aWriter)->WriteSentinel(1963526537);
            return;
        }
    case union__::TRemoteLazyInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_RemoteLazyInputStreamParams());
            // Sentinel = 'TRemoteLazyInputStreamParams'
            (aWriter)->WriteSentinel(2704214849);
            return;
        }
    case union__::TInputStreamLengthWrapperParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_InputStreamLengthWrapperParams());
            // Sentinel = 'TInputStreamLengthWrapperParams'
            (aWriter)->WriteSentinel(3313962104);
            return;
        }
    case union__::TEncryptedFileInputStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_EncryptedFileInputStreamParams());
            // Sentinel = 'TEncryptedFileInputStreamParams'
            (aWriter)->WriteSentinel(3287944291);
            return;
        }
    case union__::TDataPipeReceiverStreamParams:
        {
            IPC::WriteParam(aWriter, (aVar).get_DataPipeReceiverStreamParams());
            // Sentinel = 'TDataPipeReceiverStreamParams'
            (aWriter)->WriteSentinel(2795637602);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union InputStreamParams");
            return;
        }
    }
}

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

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

    switch (type) {
    case union__::TStringInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::StringInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TStringInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TStringInputStreamParams'
            if ((!((aReader)->ReadSentinel(2010057132)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TStringInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::FileInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileInputStreamParams'
            if ((!((aReader)->ReadSentinel(1641154741)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TBufferedInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::BufferedInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TBufferedInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TBufferedInputStreamParams'
            if ((!((aReader)->ReadSentinel(2300971608)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TBufferedInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TMIMEInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::MIMEInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TMIMEInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TMIMEInputStreamParams'
            if ((!((aReader)->ReadSentinel(1532495965)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TMIMEInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TMultiplexInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::MultiplexInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TMultiplexInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TMultiplexInputStreamParams'
            if ((!((aReader)->ReadSentinel(2563443449)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TMultiplexInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TSlicedInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::SlicedInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TSlicedInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TSlicedInputStreamParams'
            if ((!((aReader)->ReadSentinel(1963526537)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TSlicedInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TRemoteLazyInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::RemoteLazyInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TRemoteLazyInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TRemoteLazyInputStreamParams'
            if ((!((aReader)->ReadSentinel(2704214849)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TRemoteLazyInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TInputStreamLengthWrapperParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::InputStreamLengthWrapperParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TInputStreamLengthWrapperParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TInputStreamLengthWrapperParams'
            if ((!((aReader)->ReadSentinel(3313962104)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TInputStreamLengthWrapperParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TEncryptedFileInputStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::EncryptedFileInputStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TEncryptedFileInputStreamParams of union InputStreamParams");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TEncryptedFileInputStreamParams'
            if ((!((aReader)->ReadSentinel(3287944291)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TEncryptedFileInputStreamParams of union InputStreamParams");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TDataPipeReceiverStreamParams:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::ipc::DataPipeReceiverStreamParams>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TDataPipeReceiverStreamParams of union InputStreamParams");
                return {};

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct EncryptedFileInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::EncryptedFileInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).inputStreamParams());
    // Sentinel = 'inputStreamParams'
    (aWriter)->WriteSentinel(1067779841);
    IPC::WriteParam(aWriter, (aVar).key());
    // Sentinel = 'key'
    (aWriter)->WriteSentinel(42402122);
    (aWriter)->WriteBytes((&((aVar).blockSize())), 4);
    // Sentinel = 'blockSize'
    (aWriter)->WriteSentinel(304939943);
}

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

    }
    auto& _inputStreamParams = *maybe___inputStreamParams;
    // Sentinel = 'inputStreamParams'
    if ((!((aReader)->ReadSentinel(1067779841)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'inputStreamParams' (InputStreamParams) member of 'EncryptedFileInputStreamParams'");
        return {};
    }
    auto maybe___key = IPC::ReadParam<nsTArray<::uint8_t>>(aReader);
    if (!maybe___key) {
        aReader->FatalError("Error deserializing 'key' (uint8_t[]) member of 'EncryptedFileInputStreamParams'");
        return {};

    }
    auto& _key = *maybe___key;
    // Sentinel = 'key'
    if ((!((aReader)->ReadSentinel(42402122)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'key' (uint8_t[]) member of 'EncryptedFileInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_inputStreamParams),
            std::move(_key),
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->blockSize())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'blockSize'
    if ((!((aReader)->ReadSentinel(304939943)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct BufferedInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::BufferedInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).optionalStream());
    // Sentinel = 'optionalStream'
    (aWriter)->WriteSentinel(743376339);
    (aWriter)->WriteBytes((&((aVar).bufferSize())), 4);
    // Sentinel = 'bufferSize'
    (aWriter)->WriteSentinel(376243222);
}

auto ParamTraits<::mozilla::ipc::BufferedInputStreamParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___optionalStream = IPC::ReadParam<mozilla::Maybe<::mozilla::ipc::InputStreamParams>>(aReader);
    if (!maybe___optionalStream) {
        aReader->FatalError("Error deserializing 'optionalStream' (InputStreamParams?) member of 'BufferedInputStreamParams'");
        return {};

    }
    auto& _optionalStream = *maybe___optionalStream;
    // Sentinel = 'optionalStream'
    if ((!((aReader)->ReadSentinel(743376339)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'optionalStream' (InputStreamParams?) member of 'BufferedInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_optionalStream),
            ::uint32_t{0}};
    if ((!((aReader)->ReadBytesInto((&((result__)->bufferSize())), 4)))) {
        aReader->FatalError("Error bulk reading fields from uint32_t");
        return {};
    }
    // Sentinel = 'bufferSize'
    if ((!((aReader)->ReadSentinel(376243222)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from uint32_t");
        return {};
    }
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct MIMEInputStreamParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::MIMEInputStreamParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).optionalStream());
    // Sentinel = 'optionalStream'
    (aWriter)->WriteSentinel(743376339);
    IPC::WriteParam(aWriter, (aVar).headers());
    // Sentinel = 'headers'
    (aWriter)->WriteSentinel(188220125);
    IPC::WriteParam(aWriter, (aVar).startedReading());
    // Sentinel = 'startedReading'
    (aWriter)->WriteSentinel(728892850);
}

auto ParamTraits<::mozilla::ipc::MIMEInputStreamParams>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___optionalStream = IPC::ReadParam<mozilla::Maybe<::mozilla::ipc::InputStreamParams>>(aReader);
    if (!maybe___optionalStream) {
        aReader->FatalError("Error deserializing 'optionalStream' (InputStreamParams?) member of 'MIMEInputStreamParams'");
        return {};

    }
    auto& _optionalStream = *maybe___optionalStream;
    // Sentinel = 'optionalStream'
    if ((!((aReader)->ReadSentinel(743376339)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'optionalStream' (InputStreamParams?) member of 'MIMEInputStreamParams'");
        return {};
    }
    auto maybe___headers = IPC::ReadParam<nsTArray<::mozilla::ipc::HeaderEntry>>(aReader);
    if (!maybe___headers) {
        aReader->FatalError("Error deserializing 'headers' (HeaderEntry[]) member of 'MIMEInputStreamParams'");
        return {};

    }
    auto& _headers = *maybe___headers;
    // Sentinel = 'headers'
    if ((!((aReader)->ReadSentinel(188220125)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'headers' (HeaderEntry[]) member of 'MIMEInputStreamParams'");
        return {};
    }
    auto maybe___startedReading = IPC::ReadParam<bool>(aReader);
    if (!maybe___startedReading) {
        aReader->FatalError("Error deserializing 'startedReading' (bool) member of 'MIMEInputStreamParams'");
        return {};

    }
    auto& _startedReading = *maybe___startedReading;
    // Sentinel = 'startedReading'
    if ((!((aReader)->ReadSentinel(728892850)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'startedReading' (bool) member of 'MIMEInputStreamParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_optionalStream),
            std::move(_headers),
            std::move(_startedReading)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct InputStreamLengthWrapperParams|
//
namespace mozilla {
namespace ipc {
} // namespace ipc
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::ipc::InputStreamLengthWrapperParams>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).stream());
    // Sentinel = 'stream'
    (aWriter)->WriteSentinel(153223821);
    IPC::WriteParam(aWriter, (aVar).consumed());
    // Sentinel = 'consumed'
    (aWriter)->WriteSentinel(256181087);
    (aWriter)->WriteBytes((&((aVar).length())), 8);
    // Sentinel = 'length'
    (aWriter)->WriteSentinel(147063427);
}

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

    }
    auto& _stream = *maybe___stream;
    // Sentinel = 'stream'
    if ((!((aReader)->ReadSentinel(153223821)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'stream' (InputStreamParams) member of 'InputStreamLengthWrapperParams'");
        return {};
    }
    auto maybe___consumed = IPC::ReadParam<bool>(aReader);
    if (!maybe___consumed) {
        aReader->FatalError("Error deserializing 'consumed' (bool) member of 'InputStreamLengthWrapperParams'");
        return {};

    }
    auto& _consumed = *maybe___consumed;
    // Sentinel = 'consumed'
    if ((!((aReader)->ReadSentinel(256181087)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'consumed' (bool) member of 'InputStreamLengthWrapperParams'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_stream),
            ::int64_t{0},
            std::move(_consumed)};
    if ((!((aReader)->ReadBytesInto((&((result__)->length())), 8)))) {
        aReader->FatalError("Error bulk reading fields from int64_t");
        return {};
    }
    // Sentinel = 'length'
    if ((!((aReader)->ReadSentinel(147063427)))) {
        mozilla::ipc::SentinelReadError("Error bulk reading fields from int64_t");
        return {};
    }
    return result__;
}

} // namespace IPC
