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

#ifndef PBackgroundIDBFactory_h
#define PBackgroundIDBFactory_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/dom/indexedDB/PBackgroundIDBSharedTypes.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CommonFactoryRequestParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class CommonFactoryRequestParams final
{
private:
    typedef ::mozilla::dom::indexedDB::DatabaseMetadata DatabaseMetadata;
    typedef ::mozilla::ipc::PrincipalInfo PrincipalInfo;

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

    MOZ_IMPLICIT CommonFactoryRequestParams(
            const DatabaseMetadata& _metadata,
            const PrincipalInfo& _principalInfo) :
        metadata_(_metadata),
        principalInfo_(_principalInfo)
    {
    }

    MOZ_IMPLICIT CommonFactoryRequestParams(
            DatabaseMetadata&& _metadata,
            PrincipalInfo&& _principalInfo) :
        metadata_(std::move(_metadata)),
        principalInfo_(std::move(_principalInfo))
    {
    }

    DatabaseMetadata&
    metadata()
    {
        return metadata_;
    }
    const DatabaseMetadata&
    metadata() const
    {
        return metadata_;
    }

    PrincipalInfo&
    principalInfo()
    {
        return principalInfo_;
    }
    const PrincipalInfo&
    principalInfo() const
    {
        return principalInfo_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<DatabaseMetadata> metadata_;
    ::mozilla::ipc::IPDLStructMember<PrincipalInfo> principalInfo_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::CommonFactoryRequestParams>
{
    typedef ::mozilla::dom::indexedDB::CommonFactoryRequestParams 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 OpenDatabaseRequestParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class OpenDatabaseRequestParams final
{
private:
    typedef ::mozilla::dom::indexedDB::CommonFactoryRequestParams CommonFactoryRequestParams;

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

    MOZ_IMPLICIT OpenDatabaseRequestParams(const CommonFactoryRequestParams& _commonParams) :
        commonParams_(_commonParams)
    {
    }

    MOZ_IMPLICIT OpenDatabaseRequestParams(CommonFactoryRequestParams&& _commonParams) :
        commonParams_(std::move(_commonParams))
    {
    }

    CommonFactoryRequestParams&
    commonParams()
    {
        return commonParams_;
    }
    const CommonFactoryRequestParams&
    commonParams() const
    {
        return commonParams_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<CommonFactoryRequestParams> commonParams_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::OpenDatabaseRequestParams>
{
    typedef ::mozilla::dom::indexedDB::OpenDatabaseRequestParams 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 DeleteDatabaseRequestParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class DeleteDatabaseRequestParams final
{
private:
    typedef ::mozilla::dom::indexedDB::CommonFactoryRequestParams CommonFactoryRequestParams;

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

    MOZ_IMPLICIT DeleteDatabaseRequestParams(const CommonFactoryRequestParams& _commonParams) :
        commonParams_(_commonParams)
    {
    }

    MOZ_IMPLICIT DeleteDatabaseRequestParams(CommonFactoryRequestParams&& _commonParams) :
        commonParams_(std::move(_commonParams))
    {
    }

    CommonFactoryRequestParams&
    commonParams()
    {
        return commonParams_;
    }
    const CommonFactoryRequestParams&
    commonParams() const
    {
        return commonParams_;
    }

private:
    ::mozilla::ipc::IPDLStructMember<CommonFactoryRequestParams> commonParams_;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::DeleteDatabaseRequestParams>
{
    typedef ::mozilla::dom::indexedDB::DeleteDatabaseRequestParams 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 FactoryRequestParams|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class FactoryRequestParams final
{
public:
    enum Type {
        T__None,
        TOpenDatabaseRequestParams = 1,
        TDeleteDatabaseRequestParams,
        T__Last = TDeleteDatabaseRequestParams
    };

private:
    typedef ::mozilla::dom::indexedDB::OpenDatabaseRequestParams OpenDatabaseRequestParams;
    typedef ::mozilla::dom::indexedDB::DeleteDatabaseRequestParams DeleteDatabaseRequestParams;
    typedef OpenDatabaseRequestParams OpenDatabaseRequestParams__tdef;
    typedef DeleteDatabaseRequestParams DeleteDatabaseRequestParams__tdef;

    OpenDatabaseRequestParams*
    ptr_OpenDatabaseRequestParams()
    {
        return (&(mVOpenDatabaseRequestParams));
    }
    const OpenDatabaseRequestParams*
    constptr_OpenDatabaseRequestParams() const
    {
        return (&(mVOpenDatabaseRequestParams));
    }
    DeleteDatabaseRequestParams*
    ptr_DeleteDatabaseRequestParams()
    {
        return (&(mVDeleteDatabaseRequestParams));
    }
    const DeleteDatabaseRequestParams*
    constptr_DeleteDatabaseRequestParams() const
    {
        return (&(mVDeleteDatabaseRequestParams));
    }

    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 FactoryRequestParams() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT FactoryRequestParams(const OpenDatabaseRequestParams& aOther);

    MOZ_IMPLICIT FactoryRequestParams(OpenDatabaseRequestParams&& aOther);

    MOZ_IMPLICIT FactoryRequestParams(const DeleteDatabaseRequestParams& aOther);

    MOZ_IMPLICIT FactoryRequestParams(DeleteDatabaseRequestParams&& aOther);

    MOZ_IMPLICIT FactoryRequestParams(const FactoryRequestParams& aOther);

    MOZ_IMPLICIT FactoryRequestParams(FactoryRequestParams&& aOther);

    ~FactoryRequestParams();

    Type
    type() const
    {
        return mType;
    }

    FactoryRequestParams&
    operator=(const OpenDatabaseRequestParams& aRhs);

    FactoryRequestParams&
    operator=(OpenDatabaseRequestParams&& aRhs);

    FactoryRequestParams&
    operator=(const DeleteDatabaseRequestParams& aRhs);

    FactoryRequestParams&
    operator=(DeleteDatabaseRequestParams&& aRhs);

    FactoryRequestParams&
    operator=(const FactoryRequestParams& aRhs);

    FactoryRequestParams&
    operator=(FactoryRequestParams&& aRhs);

    OpenDatabaseRequestParams&
    get_OpenDatabaseRequestParams()
    {
        AssertSanity(TOpenDatabaseRequestParams);
        return (*(ptr_OpenDatabaseRequestParams()));
    }
    const OpenDatabaseRequestParams&
    get_OpenDatabaseRequestParams() const
    {
        AssertSanity(TOpenDatabaseRequestParams);
        return (*(constptr_OpenDatabaseRequestParams()));
    }
    operator OpenDatabaseRequestParams&()
    {
        return get_OpenDatabaseRequestParams();
    }
    operator const OpenDatabaseRequestParams&() const
    {
        return get_OpenDatabaseRequestParams();
    }

    DeleteDatabaseRequestParams&
    get_DeleteDatabaseRequestParams()
    {
        AssertSanity(TDeleteDatabaseRequestParams);
        return (*(ptr_DeleteDatabaseRequestParams()));
    }
    const DeleteDatabaseRequestParams&
    get_DeleteDatabaseRequestParams() const
    {
        AssertSanity(TDeleteDatabaseRequestParams);
        return (*(constptr_DeleteDatabaseRequestParams()));
    }
    operator DeleteDatabaseRequestParams&()
    {
        return get_DeleteDatabaseRequestParams();
    }
    operator const DeleteDatabaseRequestParams&() const
    {
        return get_DeleteDatabaseRequestParams();
    }

private:
    union {
        OpenDatabaseRequestParams mVOpenDatabaseRequestParams;
        DeleteDatabaseRequestParams mVDeleteDatabaseRequestParams;
    };
    Type mType;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::FactoryRequestParams>
{
    typedef ::mozilla::dom::indexedDB::FactoryRequestParams 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 GetDatabasesResponse|
//
namespace mozilla {
namespace dom {
namespace indexedDB {
class GetDatabasesResponse final
{
public:
    enum Type {
        T__None,
        Tnsresult = 1,
        TArrayOfDatabaseMetadata,
        T__Last = TArrayOfDatabaseMetadata
    };

private:
    typedef ::nsresult nsresult;
    typedef ::mozilla::dom::indexedDB::DatabaseMetadata DatabaseMetadata;
    typedef nsresult nsresult__tdef;
    typedef nsTArray<DatabaseMetadata> ArrayOfDatabaseMetadata__tdef;

    nsresult*
    ptr_nsresult()
    {
        return (&(mVnsresult));
    }
    const nsresult*
    constptr_nsresult() const
    {
        return (&(mVnsresult));
    }
    nsTArray<DatabaseMetadata>*
    ptr_ArrayOfDatabaseMetadata()
    {
        return (&(mVArrayOfDatabaseMetadata));
    }
    const nsTArray<DatabaseMetadata>*
    constptr_ArrayOfDatabaseMetadata() const
    {
        return (&(mVArrayOfDatabaseMetadata));
    }

    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 GetDatabasesResponse() :
        mType(T__None)
    {
    }

    MOZ_IMPLICIT GetDatabasesResponse(const nsresult& aOther);

    MOZ_IMPLICIT GetDatabasesResponse(nsresult&& aOther);

    MOZ_IMPLICIT GetDatabasesResponse(const nsTArray<DatabaseMetadata>& aOther);

    MOZ_IMPLICIT GetDatabasesResponse(nsTArray<DatabaseMetadata>&& aOther);

    MOZ_IMPLICIT GetDatabasesResponse(const GetDatabasesResponse& aOther);

    MOZ_IMPLICIT GetDatabasesResponse(GetDatabasesResponse&& aOther);

    ~GetDatabasesResponse();

    Type
    type() const
    {
        return mType;
    }

    GetDatabasesResponse&
    operator=(const nsresult& aRhs);

    GetDatabasesResponse&
    operator=(nsresult&& aRhs);

    GetDatabasesResponse&
    operator=(const nsTArray<DatabaseMetadata>& aRhs);

    GetDatabasesResponse&
    operator=(nsTArray<DatabaseMetadata>&& aRhs);

    GetDatabasesResponse&
    operator=(const GetDatabasesResponse& aRhs);

    GetDatabasesResponse&
    operator=(GetDatabasesResponse&& 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();
    }

    nsTArray<DatabaseMetadata>&
    get_ArrayOfDatabaseMetadata()
    {
        AssertSanity(TArrayOfDatabaseMetadata);
        return (*(ptr_ArrayOfDatabaseMetadata()));
    }
    const nsTArray<DatabaseMetadata>&
    get_ArrayOfDatabaseMetadata() const
    {
        AssertSanity(TArrayOfDatabaseMetadata);
        return (*(constptr_ArrayOfDatabaseMetadata()));
    }
    operator nsTArray<DatabaseMetadata>&()
    {
        return get_ArrayOfDatabaseMetadata();
    }
    operator const nsTArray<DatabaseMetadata>&() const
    {
        return get_ArrayOfDatabaseMetadata();
    }

private:
    union {
        nsresult mVnsresult;
        nsTArray<DatabaseMetadata> mVArrayOfDatabaseMetadata;
    };
    Type mType;
};
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace IPC {
template<>
struct ParamTraits <::mozilla::dom::indexedDB::GetDatabasesResponse>
{
    typedef ::mozilla::dom::indexedDB::GetDatabasesResponse 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 PBackgroundIDBFactoryParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBFactoryChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBackgroundIDBFactoryChild and PBackgroundIDBFactoryParent
//
namespace mozilla {
namespace dom {
namespace indexedDB {
namespace PBackgroundIDBFactory {

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

enum MessageType {
    PBackgroundIDBFactoryStart = PBackgroundIDBFactoryMsgStart << 16,
    Msg_DeleteMe__ID,
    Msg_PBackgroundIDBFactoryRequestConstructor__ID,
    Reply_PBackgroundIDBFactoryRequestConstructor__ID,
    Msg_GetDatabases__ID,
    Reply_GetDatabases__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_PBackgroundIDBDatabaseConstructor__ID,
    Reply_PBackgroundIDBDatabaseConstructor__ID,
    PBackgroundIDBFactoryEnd
};

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

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

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

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_PBackgroundIDBDatabaseConstructor(IPC::Message::routeid_t routingId);
mozilla::UniquePtr<IPC::Message>
Reply_PBackgroundIDBDatabaseConstructor(IPC::Message::routeid_t routingId);



} // namespace PBackgroundIDBFactory
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // ifndef PBackgroundIDBFactory_h
