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


#include "mozilla/dom/FileSystemTaskBase.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/dom/PFileSystemRequest.h"
#include "mozilla/dom/PFileSystemRequestParent.h"
#include "mozilla/dom/PFileSystemRequestChild.h"

#include "ipc/IPCMessageUtils.h"
#include "ipc/IPCMessageUtilsSpecializations.h"
#include "nsIFile.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/ProtocolMessageUtils.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/ShmemMessageUtils.h"
#include "mozilla/ipc/TaintingIPCUtils.h"

namespace mozilla {
namespace dom {
namespace PFileSystemRequest {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::PFileSystemRequestParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::PFileSystemRequestChild>* aChild)
{
    return mozilla::ipc::CreateEndpoints(
        mozilla::ipc::PrivateIPDLInterface(),
        aParentDestInfo, aChildDestInfo, aParent, aChild);
}
mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Msg___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::NOT_REPLY));
}
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId)
{
    return IPC::Message::IPDLMessage(routingId, Reply___delete____ID, 0, IPC::Message::HeaderFlags(IPC::Message::NOT_NESTED, IPC::Message::NORMAL_PRIORITY, IPC::Message::COMPRESSION_NONE, IPC::Message::EAGER_SEND, IPC::Message::NOT_CONSTRUCTOR, IPC::Message::ASYNC, IPC::Message::REPLY));
}

} // namespace PFileSystemRequest
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemFileResponse|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemFileResponse>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).blob());
    // Sentinel = 'blob'
    (aWriter)->WriteSentinel(68157856);
}

auto ParamTraits<::mozilla::dom::FileSystemFileResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___blob = IPC::ReadParam<::mozilla::dom::IPCBlob>(aReader);
    if (!maybe___blob) {
        aReader->FatalError("Error deserializing 'blob' (IPCBlob) member of 'FileSystemFileResponse'");
        return {};

    }
    auto& _blob = *maybe___blob;
    // Sentinel = 'blob'
    if ((!((aReader)->ReadSentinel(68157856)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'blob' (IPCBlob) member of 'FileSystemFileResponse'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_blob)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemDirectoryResponse|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemDirectoryResponse>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).realPath());
    // Sentinel = 'realPath'
    (aWriter)->WriteSentinel(242221874);
}

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

    }
    auto& _realPath = *maybe___realPath;
    // Sentinel = 'realPath'
    if ((!((aReader)->ReadSentinel(242221874)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'realPath' (nsString) member of 'FileSystemDirectoryResponse'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_realPath)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemDirectoryListingResponseFile|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemDirectoryListingResponseFile>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).blob());
    // Sentinel = 'blob'
    (aWriter)->WriteSentinel(68157856);
}

auto ParamTraits<::mozilla::dom::FileSystemDirectoryListingResponseFile>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___blob = IPC::ReadParam<::mozilla::dom::IPCBlob>(aReader);
    if (!maybe___blob) {
        aReader->FatalError("Error deserializing 'blob' (IPCBlob) member of 'FileSystemDirectoryListingResponseFile'");
        return {};

    }
    auto& _blob = *maybe___blob;
    // Sentinel = 'blob'
    if ((!((aReader)->ReadSentinel(68157856)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'blob' (IPCBlob) member of 'FileSystemDirectoryListingResponseFile'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_blob)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemDirectoryListingResponseDirectory|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemDirectoryListingResponseDirectory>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).directoryRealPath());
    // Sentinel = 'directoryRealPath'
    (aWriter)->WriteSentinel(1053951719);
}

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

    }
    auto& _directoryRealPath = *maybe___directoryRealPath;
    // Sentinel = 'directoryRealPath'
    if ((!((aReader)->ReadSentinel(1053951719)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'directoryRealPath' (nsString) member of 'FileSystemDirectoryListingResponseDirectory'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_directoryRealPath)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union FileSystemDirectoryListingResponseData|
//
namespace mozilla {
namespace dom {
auto FileSystemDirectoryListingResponseData::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TFileSystemDirectoryListingResponseFile:
        {
            (ptr_FileSystemDirectoryListingResponseFile())->~FileSystemDirectoryListingResponseFile__tdef();
            break;
        }
    case TFileSystemDirectoryListingResponseDirectory:
        {
            (ptr_FileSystemDirectoryListingResponseDirectory())->~FileSystemDirectoryListingResponseDirectory__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(const FileSystemDirectoryListingResponseFile& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(aOther);
    mType = TFileSystemDirectoryListingResponseFile;
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(FileSystemDirectoryListingResponseFile&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(std::move(aOther));
    mType = TFileSystemDirectoryListingResponseFile;
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(const FileSystemDirectoryListingResponseDirectory& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(aOther);
    mType = TFileSystemDirectoryListingResponseDirectory;
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(FileSystemDirectoryListingResponseDirectory&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(std::move(aOther));
    mType = TFileSystemDirectoryListingResponseDirectory;
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(const FileSystemDirectoryListingResponseData& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TFileSystemDirectoryListingResponseFile:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile((aOther).get_FileSystemDirectoryListingResponseFile());
            break;
        }
    case TFileSystemDirectoryListingResponseDirectory:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory((aOther).get_FileSystemDirectoryListingResponseDirectory());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT FileSystemDirectoryListingResponseData::FileSystemDirectoryListingResponseData(FileSystemDirectoryListingResponseData&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TFileSystemDirectoryListingResponseFile:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(std::move((aOther).get_FileSystemDirectoryListingResponseFile()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileSystemDirectoryListingResponseDirectory:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(std::move((aOther).get_FileSystemDirectoryListingResponseDirectory()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

auto FileSystemDirectoryListingResponseData::operator=(const FileSystemDirectoryListingResponseFile& aRhs) -> FileSystemDirectoryListingResponseData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(aRhs);
    mType = TFileSystemDirectoryListingResponseFile;
    return (*(this));
}

auto FileSystemDirectoryListingResponseData::operator=(FileSystemDirectoryListingResponseFile&& aRhs) -> FileSystemDirectoryListingResponseData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(std::move(aRhs));
    mType = TFileSystemDirectoryListingResponseFile;
    return (*(this));
}

auto FileSystemDirectoryListingResponseData::operator=(const FileSystemDirectoryListingResponseDirectory& aRhs) -> FileSystemDirectoryListingResponseData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(aRhs);
    mType = TFileSystemDirectoryListingResponseDirectory;
    return (*(this));
}

auto FileSystemDirectoryListingResponseData::operator=(FileSystemDirectoryListingResponseDirectory&& aRhs) -> FileSystemDirectoryListingResponseData&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(std::move(aRhs));
    mType = TFileSystemDirectoryListingResponseDirectory;
    return (*(this));
}

auto FileSystemDirectoryListingResponseData::operator=(const FileSystemDirectoryListingResponseData& aRhs) -> FileSystemDirectoryListingResponseData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TFileSystemDirectoryListingResponseFile:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile((aRhs).get_FileSystemDirectoryListingResponseFile());
            break;
        }
    case TFileSystemDirectoryListingResponseDirectory:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory((aRhs).get_FileSystemDirectoryListingResponseDirectory());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto FileSystemDirectoryListingResponseData::operator=(FileSystemDirectoryListingResponseData&& aRhs) -> FileSystemDirectoryListingResponseData&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TFileSystemDirectoryListingResponseFile:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseFile()) FileSystemDirectoryListingResponseFile(std::move((aRhs).get_FileSystemDirectoryListingResponseFile()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileSystemDirectoryListingResponseDirectory:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponseDirectory()) FileSystemDirectoryListingResponseDirectory(std::move((aRhs).get_FileSystemDirectoryListingResponseDirectory()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace dom
} // namespace mozilla

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

    switch (type) {
    case union__::TFileSystemDirectoryListingResponseFile:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemDirectoryListingResponseFile());
            // Sentinel = 'TFileSystemDirectoryListingResponseFile'
            (aWriter)->WriteSentinel(929894328);
            return;
        }
    case union__::TFileSystemDirectoryListingResponseDirectory:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemDirectoryListingResponseDirectory());
            // Sentinel = 'TFileSystemDirectoryListingResponseDirectory'
            (aWriter)->WriteSentinel(2357596653);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union FileSystemDirectoryListingResponseData");
            return;
        }
    }
}

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

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

    switch (type) {
    case union__::TFileSystemDirectoryListingResponseFile:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemDirectoryListingResponseFile>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemDirectoryListingResponseFile of union FileSystemDirectoryListingResponseData");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileSystemDirectoryListingResponseFile'
            if ((!((aReader)->ReadSentinel(929894328)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemDirectoryListingResponseFile of union FileSystemDirectoryListingResponseData");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileSystemDirectoryListingResponseDirectory:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemDirectoryListingResponseDirectory>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemDirectoryListingResponseDirectory of union FileSystemDirectoryListingResponseData");
                return {};

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemDirectoryListingResponse|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::FileSystemDirectoryListingResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___data = IPC::ReadParam<nsTArray<::mozilla::dom::FileSystemDirectoryListingResponseData>>(aReader);
    if (!maybe___data) {
        aReader->FatalError("Error deserializing 'data' (FileSystemDirectoryListingResponseData[]) member of 'FileSystemDirectoryListingResponse'");
        return {};

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemFilesResponse|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

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

auto ParamTraits<::mozilla::dom::FileSystemFilesResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___data = IPC::ReadParam<nsTArray<::mozilla::dom::FileSystemFileResponse>>(aReader);
    if (!maybe___data) {
        aReader->FatalError("Error deserializing 'data' (FileSystemFileResponse[]) member of 'FileSystemFilesResponse'");
        return {};

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

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |struct FileSystemErrorResponse|
//
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla

namespace IPC {
auto ParamTraits<::mozilla::dom::FileSystemErrorResponse>::Write(
        IPC::MessageWriter* aWriter,
        const paramType& aVar) -> void
{
    IPC::WriteParam(aWriter, (aVar).error());
    // Sentinel = 'error'
    (aWriter)->WriteSentinel(107741739);
}

auto ParamTraits<::mozilla::dom::FileSystemErrorResponse>::Read(IPC::MessageReader* aReader) -> IPC::ReadResult<paramType>
{
    auto maybe___error = IPC::ReadParam<::nsresult>(aReader);
    if (!maybe___error) {
        aReader->FatalError("Error deserializing 'error' (nsresult) member of 'FileSystemErrorResponse'");
        return {};

    }
    auto& _error = *maybe___error;
    // Sentinel = 'error'
    if ((!((aReader)->ReadSentinel(107741739)))) {
        mozilla::ipc::SentinelReadError("Error deserializing 'error' (nsresult) member of 'FileSystemErrorResponse'");
        return {};
    }
    IPC::ReadResult<paramType> result__{
            std::in_place,
            std::move(_error)};
    return result__;
}

} // namespace IPC

//-----------------------------------------------------------------------------
// Method definitions for the IPDL type |union FileSystemResponseValue|
//
namespace mozilla {
namespace dom {
auto FileSystemResponseValue::MaybeDestroy() -> void
{
    if ((mType) == (T__None)) {
        return;
    }
    switch (mType) {
    case TFileSystemDirectoryResponse:
        {
            (ptr_FileSystemDirectoryResponse())->~FileSystemDirectoryResponse__tdef();
            break;
        }
    case TFileSystemDirectoryListingResponse:
        {
            (ptr_FileSystemDirectoryListingResponse())->~FileSystemDirectoryListingResponse__tdef();
            break;
        }
    case TFileSystemFileResponse:
        {
            (ptr_FileSystemFileResponse())->~FileSystemFileResponse__tdef();
            break;
        }
    case TFileSystemFilesResponse:
        {
            (ptr_FileSystemFilesResponse())->~FileSystemFilesResponse__tdef();
            break;
        }
    case TFileSystemErrorResponse:
        {
            (ptr_FileSystemErrorResponse())->~FileSystemErrorResponse__tdef();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("not reached");
            break;
        }
    }
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemDirectoryResponse& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(aOther);
    mType = TFileSystemDirectoryResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemDirectoryResponse&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(std::move(aOther));
    mType = TFileSystemDirectoryResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemDirectoryListingResponse& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(aOther);
    mType = TFileSystemDirectoryListingResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemDirectoryListingResponse&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(std::move(aOther));
    mType = TFileSystemDirectoryListingResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemFileResponse& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(aOther);
    mType = TFileSystemFileResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemFileResponse&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(std::move(aOther));
    mType = TFileSystemFileResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemFilesResponse& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(aOther);
    mType = TFileSystemFilesResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemFilesResponse&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(std::move(aOther));
    mType = TFileSystemFilesResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemErrorResponse& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(aOther);
    mType = TFileSystemErrorResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemErrorResponse&& aOther)
{
    new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(std::move(aOther));
    mType = TFileSystemErrorResponse;
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(const FileSystemResponseValue& aOther)
{
    (aOther).AssertSanity();
    switch ((aOther).type()) {
    case TFileSystemDirectoryResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse((aOther).get_FileSystemDirectoryResponse());
            break;
        }
    case TFileSystemDirectoryListingResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse((aOther).get_FileSystemDirectoryListingResponse());
            break;
        }
    case TFileSystemFileResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse((aOther).get_FileSystemFileResponse());
            break;
        }
    case TFileSystemFilesResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse((aOther).get_FileSystemFilesResponse());
            break;
        }
    case TFileSystemErrorResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse((aOther).get_FileSystemErrorResponse());
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    mType = (aOther).type();
}

MOZ_IMPLICIT FileSystemResponseValue::FileSystemResponseValue(FileSystemResponseValue&& aOther)
{
    (aOther).AssertSanity();
    Type t = (aOther).type();
    switch (t) {
    case TFileSystemDirectoryResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(std::move((aOther).get_FileSystemDirectoryResponse()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileSystemDirectoryListingResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(std::move((aOther).get_FileSystemDirectoryListingResponse()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileSystemFileResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(std::move((aOther).get_FileSystemFileResponse()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileSystemFilesResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(std::move((aOther).get_FileSystemFilesResponse()));
            (aOther).MaybeDestroy();
            break;
        }
    case TFileSystemErrorResponse:
        {
            new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(std::move((aOther).get_FileSystemErrorResponse()));
            (aOther).MaybeDestroy();
            break;
        }
    case T__None:
        {
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            return;
        }
    }
    (aOther).mType = T__None;
    mType = t;
}

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

auto FileSystemResponseValue::operator=(const FileSystemDirectoryResponse& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(aRhs);
    mType = TFileSystemDirectoryResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemDirectoryResponse&& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(std::move(aRhs));
    mType = TFileSystemDirectoryResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(const FileSystemDirectoryListingResponse& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(aRhs);
    mType = TFileSystemDirectoryListingResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemDirectoryListingResponse&& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(std::move(aRhs));
    mType = TFileSystemDirectoryListingResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(const FileSystemFileResponse& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(aRhs);
    mType = TFileSystemFileResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemFileResponse&& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(std::move(aRhs));
    mType = TFileSystemFileResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(const FileSystemFilesResponse& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(aRhs);
    mType = TFileSystemFilesResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemFilesResponse&& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(std::move(aRhs));
    mType = TFileSystemFilesResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(const FileSystemErrorResponse& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(aRhs);
    mType = TFileSystemErrorResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemErrorResponse&& aRhs) -> FileSystemResponseValue&
{
    MaybeDestroy();
    new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(std::move(aRhs));
    mType = TFileSystemErrorResponse;
    return (*(this));
}

auto FileSystemResponseValue::operator=(const FileSystemResponseValue& aRhs) -> FileSystemResponseValue&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TFileSystemDirectoryResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse((aRhs).get_FileSystemDirectoryResponse());
            break;
        }
    case TFileSystemDirectoryListingResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse((aRhs).get_FileSystemDirectoryListingResponse());
            break;
        }
    case TFileSystemFileResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse((aRhs).get_FileSystemFileResponse());
            break;
        }
    case TFileSystemFilesResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse((aRhs).get_FileSystemFilesResponse());
            break;
        }
    case TFileSystemErrorResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse((aRhs).get_FileSystemErrorResponse());
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    mType = t;
    return (*(this));
}

auto FileSystemResponseValue::operator=(FileSystemResponseValue&& aRhs) -> FileSystemResponseValue&
{
    (aRhs).AssertSanity();
    Type t = (aRhs).type();
    switch (t) {
    case TFileSystemDirectoryResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryResponse()) FileSystemDirectoryResponse(std::move((aRhs).get_FileSystemDirectoryResponse()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileSystemDirectoryListingResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemDirectoryListingResponse()) FileSystemDirectoryListingResponse(std::move((aRhs).get_FileSystemDirectoryListingResponse()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileSystemFileResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemFileResponse()) FileSystemFileResponse(std::move((aRhs).get_FileSystemFileResponse()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileSystemFilesResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemFilesResponse()) FileSystemFilesResponse(std::move((aRhs).get_FileSystemFilesResponse()));
            (aRhs).MaybeDestroy();
            break;
        }
    case TFileSystemErrorResponse:
        {
            MaybeDestroy();
            new (mozilla::KnownNotNull, ptr_FileSystemErrorResponse()) FileSystemErrorResponse(std::move((aRhs).get_FileSystemErrorResponse()));
            (aRhs).MaybeDestroy();
            break;
        }
    case T__None:
        {
            MaybeDestroy();
            break;
        }
    default:
        {
            mozilla::ipc::LogicError("unreached");
            break;
        }
    }
    (aRhs).mType = T__None;
    mType = t;
    return (*(this));
}

} // namespace dom
} // namespace mozilla

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

    switch (type) {
    case union__::TFileSystemDirectoryResponse:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemDirectoryResponse());
            // Sentinel = 'TFileSystemDirectoryResponse'
            (aWriter)->WriteSentinel(2694712158);
            return;
        }
    case union__::TFileSystemDirectoryListingResponse:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemDirectoryListingResponse());
            // Sentinel = 'TFileSystemDirectoryListingResponse'
            (aWriter)->WriteSentinel(4209905208);
            return;
        }
    case union__::TFileSystemFileResponse:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemFileResponse());
            // Sentinel = 'TFileSystemFileResponse'
            (aWriter)->WriteSentinel(1798506793);
            return;
        }
    case union__::TFileSystemFilesResponse:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemFilesResponse());
            // Sentinel = 'TFileSystemFilesResponse'
            (aWriter)->WriteSentinel(1964509596);
            return;
        }
    case union__::TFileSystemErrorResponse:
        {
            IPC::WriteParam(aWriter, (aVar).get_FileSystemErrorResponse());
            // Sentinel = 'TFileSystemErrorResponse'
            (aWriter)->WriteSentinel(1981024691);
            return;
        }
    default:
        {
            aWriter->FatalError("unknown variant of union FileSystemResponseValue");
            return;
        }
    }
}

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

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

    switch (type) {
    case union__::TFileSystemDirectoryResponse:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemDirectoryResponse>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemDirectoryResponse of union FileSystemResponseValue");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileSystemDirectoryResponse'
            if ((!((aReader)->ReadSentinel(2694712158)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemDirectoryResponse of union FileSystemResponseValue");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileSystemDirectoryListingResponse:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemDirectoryListingResponse>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemDirectoryListingResponse of union FileSystemResponseValue");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileSystemDirectoryListingResponse'
            if ((!((aReader)->ReadSentinel(4209905208)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemDirectoryListingResponse of union FileSystemResponseValue");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileSystemFileResponse:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemFileResponse>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemFileResponse of union FileSystemResponseValue");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileSystemFileResponse'
            if ((!((aReader)->ReadSentinel(1798506793)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemFileResponse of union FileSystemResponseValue");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileSystemFilesResponse:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemFilesResponse>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemFilesResponse of union FileSystemResponseValue");
                return {};

            }
            auto& tmp = *maybe__tmp;
            // Sentinel = 'TFileSystemFilesResponse'
            if ((!((aReader)->ReadSentinel(1964509596)))) {
                mozilla::ipc::SentinelReadError("Error deserializing variant TFileSystemFilesResponse of union FileSystemResponseValue");
                return {};
            }
            return std::move(tmp);
        }
    case union__::TFileSystemErrorResponse:
        {
            auto maybe__tmp = IPC::ReadParam<::mozilla::dom::FileSystemErrorResponse>(aReader);
            if (!maybe__tmp) {
                aReader->FatalError("Error deserializing variant TFileSystemErrorResponse of union FileSystemResponseValue");
                return {};

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

} // namespace IPC
