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

#ifndef PBackgroundIDBFactoryRequest_h
#define PBackgroundIDBFactoryRequest_h

#include "mozilla/Attributes.h"
#include "IPCMessageStart.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/MozPromise.h"
#include "mozilla/OperatorNewExtensions.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/ipc/IPCForwards.h"
#include "mozilla/ipc/Shmem.h"

// Headers for typedefs
#include "mozilla/ipc/IPDLStructMember.h"
#include "mozilla/ipc/SideVariant.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBDatabaseParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBDatabaseChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct OpenDatabaseRequestResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class OpenDatabaseRequestResponse final
{
private:
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseParent PBackgroundIDBDatabaseParent;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseChild PBackgroundIDBDatabaseChild;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    OpenDatabaseRequestResponse() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT OpenDatabaseRequestResponse(const mozilla::NotNull<::mozilla::ipc::SideVariant<PBackgroundIDBDatabaseParent*, PBackgroundIDBDatabaseChild*>>& _database) :
        database_(_database)
    {
    }

    MOZ_IMPLICIT OpenDatabaseRequestResponse(mozilla::NotNull<::mozilla::ipc::SideVariant<PBackgroundIDBDatabaseParent*, PBackgroundIDBDatabaseChild*>>&& _database) :
        database_(std::move(_database))
    {
    }

    mozilla::NotNull<::mozilla::ipc::SideVariant<PBackgroundIDBDatabaseParent*, PBackgroundIDBDatabaseChild*>>&
    database()
    {
        return database_;
    }
    const mozilla::NotNull<::mozilla::ipc::SideVariant<PBackgroundIDBDatabaseParent*, PBackgroundIDBDatabaseChild*>>&
    database() const
    {
        return database_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<mozilla::NotNull<::mozilla::ipc::SideVariant<PBackgroundIDBDatabaseParent*, PBackgroundIDBDatabaseChild*>>> database_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::OpenDatabaseRequestResponse>
{
    typedef ::mozilla::dom::indexedDB::OpenDatabaseRequestResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeleteDatabaseRequestResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class DeleteDatabaseRequestResponse final
{
private:
    typedef ::uint64_t uint64_t;

public:
#ifdef __clang__
#  pragma clang diagnostic push
#  if __has_warning("-Wdefaulted-function-deleted")
#    pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#  endif
#endif
    DeleteDatabaseRequestResponse() = default;
#ifdef __clang__
#  pragma clang diagnostic pop
#endif

    MOZ_IMPLICIT DeleteDatabaseRequestResponse(const uint64_t& _previousVersion) :
        previousVersion_(_previousVersion)
    {
    }

    MOZ_IMPLICIT DeleteDatabaseRequestResponse(uint64_t&& _previousVersion) :
        previousVersion_(std::move(_previousVersion))
    {
    }

    uint64_t&
    previousVersion()
    {
        return previousVersion_;
    }
    const uint64_t&
    previousVersion() const
    {
        return previousVersion_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<uint64_t> previousVersion_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::DeleteDatabaseRequestResponse>
{
    typedef ::mozilla::dom::indexedDB::DeleteDatabaseRequestResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union FactoryRequestResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class FactoryRequestResponse final
{
public:
    enum Type {
        T__None,
        Tnsresult = 1,
        TOpenDatabaseRequestResponse,
        TDeleteDatabaseRequestResponse,
        T__Last = TDeleteDatabaseRequestResponse
    };

private:
    typedef ::nsresult nsresult;
    typedef ::mozilla::dom::indexedDB::OpenDatabaseRequestResponse OpenDatabaseRequestResponse;
    typedef ::mozilla::dom::indexedDB::DeleteDatabaseRequestResponse DeleteDatabaseRequestResponse;
    typedef nsresult nsresult__tdef;
    typedef OpenDatabaseRequestResponse OpenDatabaseRequestResponse__tdef;
    typedef DeleteDatabaseRequestResponse DeleteDatabaseRequestResponse__tdef;

    nsresult*
    ptr_nsresult()
    {
        return (&(mVnsresult));
    }
    const nsresult*
    constptr_nsresult() const
    {
        return (&(mVnsresult));
    }
    OpenDatabaseRequestResponse*
    ptr_OpenDatabaseRequestResponse()
    {
        return (&(mVOpenDatabaseRequestResponse));
    }
    const OpenDatabaseRequestResponse*
    constptr_OpenDatabaseRequestResponse() const
    {
        return (&(mVOpenDatabaseRequestResponse));
    }
    DeleteDatabaseRequestResponse*
    ptr_DeleteDatabaseRequestResponse()
    {
        return (&(mVDeleteDatabaseRequestResponse));
    }
    const DeleteDatabaseRequestResponse*
    constptr_DeleteDatabaseRequestResponse() const
    {
        return (&(mVDeleteDatabaseRequestResponse));
    }

    void
    MaybeDestroy();

    void
    AssertSanity() const
    {
        MOZ_RELEASE_ASSERT((T__None) <= (mType), "invalid type tag");
        MOZ_RELEASE_ASSERT((mType) <= (T__Last), "invalid type tag");
    }
    void
    AssertSanity(Type aType) const
    {
        AssertSanity();
        MOZ_RELEASE_ASSERT((mType) == (aType), "unexpected type tag");
    }

public:
    MOZ_IMPLICIT FactoryRequestResponse() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT FactoryRequestResponse(const nsresult& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(nsresult&& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(const OpenDatabaseRequestResponse& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(OpenDatabaseRequestResponse&& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(const DeleteDatabaseRequestResponse& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(DeleteDatabaseRequestResponse&& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(const FactoryRequestResponse& aOther);

    MOZ_IMPLICIT FactoryRequestResponse(FactoryRequestResponse&& aOther);

    ~FactoryRequestResponse();

    Type
    type() const
    {
        return mType;
    }

    FactoryRequestResponse&
    operator=(const nsresult& aRhs);

    FactoryRequestResponse&
    operator=(nsresult&& aRhs);

    FactoryRequestResponse&
    operator=(const OpenDatabaseRequestResponse& aRhs);

    FactoryRequestResponse&
    operator=(OpenDatabaseRequestResponse&& aRhs);

    FactoryRequestResponse&
    operator=(const DeleteDatabaseRequestResponse& aRhs);

    FactoryRequestResponse&
    operator=(DeleteDatabaseRequestResponse&& aRhs);

    FactoryRequestResponse&
    operator=(const FactoryRequestResponse& aRhs);

    FactoryRequestResponse&
    operator=(FactoryRequestResponse&& aRhs);

    nsresult&
    get_nsresult()
    {
        AssertSanity(Tnsresult);
        return (*(ptr_nsresult()));
    }
    const nsresult&
    get_nsresult() const
    {
        AssertSanity(Tnsresult);
        return (*(constptr_nsresult()));
    }
    operator nsresult&()
    {
        return get_nsresult();
    }
    operator const nsresult&() const
    {
        return get_nsresult();
    }

    OpenDatabaseRequestResponse&
    get_OpenDatabaseRequestResponse()
    {
        AssertSanity(TOpenDatabaseRequestResponse);
        return (*(ptr_OpenDatabaseRequestResponse()));
    }
    const OpenDatabaseRequestResponse&
    get_OpenDatabaseRequestResponse() const
    {
        AssertSanity(TOpenDatabaseRequestResponse);
        return (*(constptr_OpenDatabaseRequestResponse()));
    }
    operator OpenDatabaseRequestResponse&()
    {
        return get_OpenDatabaseRequestResponse();
    }
    operator const OpenDatabaseRequestResponse&() const
    {
        return get_OpenDatabaseRequestResponse();
    }

    DeleteDatabaseRequestResponse&
    get_DeleteDatabaseRequestResponse()
    {
        AssertSanity(TDeleteDatabaseRequestResponse);
        return (*(ptr_DeleteDatabaseRequestResponse()));
    }
    const DeleteDatabaseRequestResponse&
    get_DeleteDatabaseRequestResponse() const
    {
        AssertSanity(TDeleteDatabaseRequestResponse);
        return (*(constptr_DeleteDatabaseRequestResponse()));
    }
    operator DeleteDatabaseRequestResponse&()
    {
        return get_DeleteDatabaseRequestResponse();
    }
    operator const DeleteDatabaseRequestResponse&() const
    {
        return get_DeleteDatabaseRequestResponse();
    }

private:
    union {
        nsresult mVnsresult;
        OpenDatabaseRequestResponse mVOpenDatabaseRequestResponse;
        DeleteDatabaseRequestResponse mVDeleteDatabaseRequestResponse;
    };
    Type mType;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::FactoryRequestResponse>
{
    typedef ::mozilla::dom::indexedDB::FactoryRequestResponse paramType;
    static void
    Write(
            IPC::MessageWriter* aWriter,
            const paramType& aVar);
    static IPC::ReadResult<paramType>
    Read(IPC::MessageReader* aReader);
};
} // namespace IPC

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBFactoryRequestParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBFactoryRequestChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundIDBFactoryRequestChild and PBackgroundIDBFactoryRequestParent
//
namespace mozilla {
namespace dom {
namespace indexedDB {
namespace PBackgroundIDBFactoryRequest {

nsresult
CreateEndpoints(
        mozilla::ipc::EndpointProcInfo aParentDestInfo,
        mozilla::ipc::EndpointProcInfo aChildDestInfo,
        mozilla::ipc::Endpoint<::mozilla::dom::indexedDB::PBackgroundIDBFactoryRequestParent>* aParent,
        mozilla::ipc::Endpoint<::mozilla::dom::indexedDB::PBackgroundIDBFactoryRequestChild>* aChild);

enum MessageType {
    PBackgroundIDBFactoryRequestStart = PBackgroundIDBFactoryRequestMsgStart << 16,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_Blocked__ID,
    PBackgroundIDBFactoryRequestEnd
};

mozilla::UniquePtr<IPC::Message>
Msg___delete__(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply___delete__(IPC::Message::routeid_t routingId);

mozilla::UniquePtr<IPC::Message>
Msg_Blocked(IPC::Message::routeid_t routingId);



} // namespace PBackgroundIDBFactoryRequest
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundIDBFactoryRequest_h
