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

#ifndef PBackgroundIDBVersionChangeTransactionParent_h
#define PBackgroundIDBVersionChangeTransactionParent_h

#include "mozilla/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.h"
#ifdef DEBUG
#include "prenv.h"
#endif  // DEBUG

#include "mozilla/Tainting.h"
#include "mozilla/ipc/MessageChannel.h"
#include "mozilla/ipc/ProtocolUtils.h"
// Headers for things that cannot be forward declared
#include "mozilla/dom/IDBCursor.h"
#include "mozilla/dom/IndexedDatabase.h"
#include "mozilla/dom/quota/PersistenceType.h"
#include "mozilla/ipc/SerializedStructuredCloneBuffer.h"

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBCursorParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBCursorChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

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

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBDatabaseFileParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBDatabaseFileChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBRequestParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PBackgroundIDBRequestChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

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

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

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

namespace mozilla {
struct null_t;
} // namespace mozilla

namespace mozilla {
struct void_t;
} // namespace mozilla

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

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

namespace mozilla {
namespace dom {
namespace indexedDB {


class PBackgroundIDBVersionChangeTransactionParent :
    public mozilla::ipc::IRefCountedProtocol
{
private:
    friend class ::mozilla::dom::indexedDB::PBackgroundIDBCursorParent;
    friend class ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseParent;
    friend class ::mozilla::dom::indexedDB::PBackgroundIDBRequestParent;
public:
    static constexpr ::mozilla::ipc::ProtocolId kProtocolId = PBackgroundIDBVersionChangeTransactionMsgStart;
protected:
    typedef mozilla::ipc::ActorId ActorId;
    typedef ::mozilla::ipc::ByteBuf ByteBuf;
    typedef ::mozilla::dom::indexedDB::CommonIndexOpenCursorParams CommonIndexOpenCursorParams;
    typedef ::mozilla::dom::indexedDB::CommonOpenCursorParams CommonOpenCursorParams;
    typedef ::mozilla::dom::indexedDB::DatabaseMetadata DatabaseMetadata;
    typedef ::mozilla::dom::indexedDB::DatabaseSpec DatabaseSpec;
    typedef ::mozilla::dom::IDBCursor::Direction Direction;
    template<class FooSide> using Endpoint = mozilla::ipc::Endpoint<FooSide>;
    typedef ::mozilla::dom::indexedDB::FileAddInfo FileAddInfo;
    typedef ::mozilla::ipc::FileDescriptor FileDescriptor;
    typedef ::mozilla::dom::indexedDB::StructuredCloneFileBase::FileType FileType;
    typedef ::mozilla::dom::indexedDB::IndexCountParams IndexCountParams;
    typedef ::mozilla::dom::indexedDB::IndexGetAllKeysParams IndexGetAllKeysParams;
    typedef ::mozilla::dom::indexedDB::IndexGetAllParams IndexGetAllParams;
    typedef ::mozilla::dom::indexedDB::IndexGetKeyParams IndexGetKeyParams;
    typedef ::mozilla::dom::indexedDB::IndexGetParams IndexGetParams;
    typedef ::mozilla::dom::indexedDB::IndexMetadata IndexMetadata;
    typedef ::mozilla::dom::indexedDB::IndexOpenCursorParams IndexOpenCursorParams;
    typedef ::mozilla::dom::indexedDB::IndexOpenKeyCursorParams IndexOpenKeyCursorParams;
    typedef ::mozilla::dom::indexedDB::IndexUpdateInfo IndexUpdateInfo;
    typedef ::mozilla::dom::indexedDB::Key Key;
    typedef ::mozilla::dom::indexedDB::KeyPath KeyPath;
    typedef ::mozilla::dom::indexedDB::LoggingInfo LoggingInfo;
    template<class FooSide> using ManagedEndpoint = mozilla::ipc::ManagedEndpoint<FooSide>;
    typedef ::mozilla::dom::indexedDB::NullableBlob NullableBlob;
    typedef ::mozilla::dom::indexedDB::ObjectStoreAddParams ObjectStoreAddParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreAddPutParams ObjectStoreAddPutParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreClearParams ObjectStoreClearParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreCountParams ObjectStoreCountParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreDeleteParams ObjectStoreDeleteParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreGetAllKeysParams ObjectStoreGetAllKeysParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreGetAllParams ObjectStoreGetAllParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreGetKeyParams ObjectStoreGetKeyParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreGetParams ObjectStoreGetParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreMetadata ObjectStoreMetadata;
    typedef ::mozilla::dom::indexedDB::ObjectStoreOpenCursorParams ObjectStoreOpenCursorParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreOpenKeyCursorParams ObjectStoreOpenKeyCursorParams;
    typedef ::mozilla::dom::indexedDB::ObjectStorePutParams ObjectStorePutParams;
    typedef ::mozilla::dom::indexedDB::ObjectStoreSpec ObjectStoreSpec;
    typedef ::mozilla::dom::indexedDB::OpenCursorParams OpenCursorParams;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBCursorChild PBackgroundIDBCursorChild;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBCursorParent PBackgroundIDBCursorParent;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseChild PBackgroundIDBDatabaseChild;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseFileChild PBackgroundIDBDatabaseFileChild;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseFileParent PBackgroundIDBDatabaseFileParent;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBDatabaseParent PBackgroundIDBDatabaseParent;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBRequestChild PBackgroundIDBRequestChild;
    typedef ::mozilla::dom::indexedDB::PBackgroundIDBRequestParent PBackgroundIDBRequestParent;
    typedef ::mozilla::dom::quota::PersistenceType PersistenceType;
    typedef base::ProcessId ProcessId;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef ::mozilla::dom::indexedDB::RequestParams RequestParams;
    typedef mozilla::ipc::ResponseRejectReason ResponseRejectReason;
    typedef ::mozilla::dom::indexedDB::SerializedKeyRange SerializedKeyRange;
    typedef ::mozilla::SerializedStructuredCloneBuffer SerializedStructuredCloneBuffer;
    typedef ::mozilla::dom::indexedDB::SerializedStructuredCloneFile SerializedStructuredCloneFile;
    typedef ::mozilla::dom::indexedDB::SerializedStructuredCloneReadInfo SerializedStructuredCloneReadInfo;
    typedef ::mozilla::dom::indexedDB::SerializedStructuredCloneWriteInfo SerializedStructuredCloneWriteInfo;
    typedef ::mozilla::ipc::Shmem Shmem;
    template<class T> using UniquePtr = mozilla::UniquePtr<T>;
    typedef ::int16_t int16_t;
    typedef ::int32_t int32_t;
    typedef ::int64_t int64_t;
    typedef ::int8_t int8_t;
    typedef ::intptr_t intptr_t;
    typedef ::nsCString nsCString;
    typedef ::nsString nsString;
    typedef ::nsresult nsresult;
    typedef ::mozilla::null_t null_t;
    typedef ::uint16_t uint16_t;
    typedef ::uint32_t uint32_t;
    typedef ::uint64_t uint64_t;
    typedef ::uint8_t uint8_t;
    typedef ::uintptr_t uintptr_t;
    typedef ::mozilla::void_t void_t;

protected:
    virtual mozilla::ipc::IPCResult
    RecvDeleteMe() = 0;
    virtual mozilla::ipc::IPCResult
    RecvCommit(const mozilla::Maybe<int64_t>& lastRequest) = 0;
    virtual mozilla::ipc::IPCResult
    RecvAbort(const nsresult& resultCode) = 0;
    virtual mozilla::ipc::IPCResult
    RecvCreateObjectStore(const ObjectStoreMetadata& metadata) = 0;
    virtual mozilla::ipc::IPCResult
    RecvDeleteObjectStore(const int64_t& objectStoreId) = 0;
    virtual mozilla::ipc::IPCResult
    RecvRenameObjectStore(
            const int64_t& objectStoreId,
            const nsAString& name) = 0;
    virtual mozilla::ipc::IPCResult
    RecvCreateIndex(
            const int64_t& objectStoreId,
            const IndexMetadata& metadata) = 0;
    virtual mozilla::ipc::IPCResult
    RecvDeleteIndex(
            const int64_t& objectStoreId,
            const int64_t& indexId) = 0;
    virtual mozilla::ipc::IPCResult
    RecvRenameIndex(
            const int64_t& objectStoreId,
            const int64_t& indexId,
            const nsAString& name) = 0;
    virtual mozilla::ipc::IPCResult
    RecvPBackgroundIDBCursorConstructor(
            PBackgroundIDBCursorParent* actor,
            const int64_t& requestId,
            const OpenCursorParams& params);
    virtual mozilla::ipc::IPCResult
    RecvPBackgroundIDBRequestConstructor(
            PBackgroundIDBRequestParent* actor,
            const int64_t& requestId,
            const RequestParams& params);
    virtual already_AddRefed<PBackgroundIDBCursorParent>
    AllocPBackgroundIDBCursorParent(
            const int64_t& requestId,
            const OpenCursorParams& params) = 0;
    virtual PBackgroundIDBRequestParent*
    AllocPBackgroundIDBRequestParent(
            const int64_t& requestId,
            const RequestParams& params) = 0;
    virtual bool
    DeallocPBackgroundIDBRequestParent(PBackgroundIDBRequestParent* aActor) = 0;
public:
    typedef mozilla::ipc::IProtocol IProtocol;
    typedef IPC::Message Message;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;

public:
    MOZ_IMPLICIT PBackgroundIDBVersionChangeTransactionParent();

    virtual ~PBackgroundIDBVersionChangeTransactionParent();

protected:
    void
    ActorAlloc() final;
    void
    ActorDealloc() final;
public:
    ::base::ProcessId
    OtherPid() const;
    ::GeckoChildID
    OtherChildID() const;
    ::mozilla::ipc::EndpointProcInfo
    OtherEndpointProcInfo() const;

    PBackgroundIDBDatabaseParent*
    Manager() const;

    void
    ManagedPBackgroundIDBCursorParent(nsTArray<PBackgroundIDBCursorParent*>& aArr) const;
    const ManagedContainer<PBackgroundIDBCursorParent>&
    ManagedPBackgroundIDBCursorParent() const;

    void
    ManagedPBackgroundIDBRequestParent(nsTArray<PBackgroundIDBRequestParent*>& aArr) const;
    const ManagedContainer<PBackgroundIDBRequestParent>&
    ManagedPBackgroundIDBRequestParent() const;

    mozilla::Span<mozilla::ipc::ProtocolId const>
    ManagedProtocolIds() const final;

    UntypedManagedContainer*
    GetManagedActors(mozilla::ipc::ProtocolId aProtocol) final;

    ManagedEndpoint<PBackgroundIDBCursorChild>
    OpenPBackgroundIDBCursorEndpoint(PBackgroundIDBCursorParent* aActor);
    bool
    BindPBackgroundIDBCursorEndpoint(
            ManagedEndpoint<PBackgroundIDBCursorParent> aEndpoint,
            PBackgroundIDBCursorParent* aActor);

    ManagedEndpoint<PBackgroundIDBRequestChild>
    OpenPBackgroundIDBRequestEndpoint(PBackgroundIDBRequestParent* aActor);
    bool
    BindPBackgroundIDBRequestEndpoint(
            ManagedEndpoint<PBackgroundIDBRequestParent> aEndpoint,
            PBackgroundIDBRequestParent* aActor);

    [[nodiscard]] static bool
    Send__delete__(PBackgroundIDBVersionChangeTransactionParent* actor);

    [[nodiscard]] bool
    SendComplete(const nsresult& result);

    void
    DeallocManagee(
            mozilla::ipc::ProtocolId aProtocolId,
            IProtocol* aListener) override;

    Result
    OnMessageReceived(const Message& msg__) override;

    Result
    OnMessageReceived(
            const Message& msg__,
            UniquePtr<Message>& reply__) override;

private:
    bool mAwaitingManagedEndpointBind = false;

    ManagedContainer<PBackgroundIDBCursorParent> mManagedPBackgroundIDBCursorParent;
    ManagedContainer<PBackgroundIDBRequestParent> mManagedPBackgroundIDBRequestParent;
};


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

#endif // ifndef PBackgroundIDBVersionChangeTransactionParent_h
