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

#ifndef PQuotaParent_h
#define PQuotaParent_h

#include "mozilla/dom/quota/PQuota.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/OriginAttributes.h"
#include "mozilla/dom/IntegrityPolicy.h"
#include "mozilla/dom/ipc/IdType.h"
#include "mozilla/dom/quota/Client.h"
#include "mozilla/dom/quota/CommonMetadataArray.h"
#include "mozilla/dom/quota/PersistenceType.h"
#include "mozilla/dom/quota/UsageInfo.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "nsIContentSecurityPolicy.h"

namespace mozilla {
namespace ipc {
class PBackgroundParent;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PBackgroundChild;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace quota {
class PQuotaRequestParent;
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace quota {
class PQuotaRequestChild;
} // namespace quota
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace quota {
class PQuotaUsageRequestParent;
} // namespace quota
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace quota {
class PQuotaUsageRequestChild;
} // namespace quota
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace quota {
class PQuotaRequestParent;
} // namespace quota
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace quota {
class PQuotaUsageRequestParent;
} // namespace quota
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PBackgroundParent;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
struct void_t;
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace quota {


class PQuotaParent :
    public mozilla::ipc::IRefCountedProtocol
{
private:
    friend class ::mozilla::dom::quota::PQuotaRequestParent;
    friend class ::mozilla::dom::quota::PQuotaUsageRequestParent;
    friend class ::mozilla::ipc::PBackgroundParent;
public:
    static constexpr ::mozilla::ipc::ProtocolId kProtocolId = PQuotaMsgStart;
protected:
    typedef mozilla::ipc::ActorId ActorId;
    typedef ::mozilla::ipc::BoolResponse BoolResponse;
    typedef ::mozilla::ipc::ByteBuf ByteBuf;
    typedef ::mozilla::ipc::CSPInfo CSPInfo;
    typedef ::mozilla::ipc::CStringArrayResponse CStringArrayResponse;
    typedef ::mozilla::dom::quota::ClearResetOriginParams ClearResetOriginParams;
    typedef ::mozilla::dom::ContentParentId ContentParentId;
    typedef ::mozilla::ipc::ContentPrincipalInfo ContentPrincipalInfo;
    typedef ::mozilla::ipc::ContentSecurityPolicy ContentSecurityPolicy;
    typedef ::mozilla::dom::IntegrityPolicy::Destinations Destinations;
    template<class FooSide> using Endpoint = mozilla::ipc::Endpoint<FooSide>;
    typedef ::mozilla::dom::quota::EstimateParams EstimateParams;
    typedef ::mozilla::ipc::ExpandedPrincipalInfo ExpandedPrincipalInfo;
    typedef ::mozilla::ipc::FileDescriptor FileDescriptor;
    typedef ::mozilla::dom::quota::GetFullOriginMetadataParams GetFullOriginMetadataParams;
    typedef ::mozilla::ipc::IntegrityPolicyArgs IntegrityPolicyArgs;
    typedef ::mozilla::ipc::IntegrityPolicyEntry IntegrityPolicyEntry;
    template<class FooSide> using ManagedEndpoint = mozilla::ipc::ManagedEndpoint<FooSide>;
    typedef ::mozilla::ipc::NullPrincipalInfo NullPrincipalInfo;
    typedef ::mozilla::OriginAttributes OriginAttributes;
    typedef ::mozilla::OriginAttributesPattern OriginAttributesPattern;
    typedef ::mozilla::dom::quota::OriginUsageMetadataArray OriginUsageMetadataArray;
    typedef ::mozilla::dom::quota::OriginUsageMetadataArrayResponse OriginUsageMetadataArrayResponse;
    typedef ::mozilla::ipc::PBackgroundChild PBackgroundChild;
    typedef ::mozilla::ipc::PBackgroundParent PBackgroundParent;
    typedef ::mozilla::dom::quota::PQuotaRequestChild PQuotaRequestChild;
    typedef ::mozilla::dom::quota::PQuotaRequestParent PQuotaRequestParent;
    typedef ::mozilla::dom::quota::PQuotaUsageRequestChild PQuotaUsageRequestChild;
    typedef ::mozilla::dom::quota::PQuotaUsageRequestParent PQuotaUsageRequestParent;
    typedef ::mozilla::dom::quota::PersistParams PersistParams;
    typedef ::mozilla::dom::quota::PersistedParams PersistedParams;
    typedef ::mozilla::dom::quota::PersistenceType PersistenceType;
    typedef ::mozilla::ipc::PolicyContainerArgs PolicyContainerArgs;
    typedef ::mozilla::ipc::PrincipalInfo PrincipalInfo;
    typedef base::ProcessId ProcessId;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef ::mozilla::dom::quota::RequestParams RequestParams;
    typedef ::nsIContentSecurityPolicy::RequireTrustedTypesForDirectiveState RequireTrustedTypesForDirectiveState;
    typedef mozilla::ipc::ResponseRejectReason ResponseRejectReason;
    typedef ::mozilla::ipc::Shmem Shmem;
    typedef ::mozilla::dom::IntegrityPolicy::Sources Sources;
    typedef ::mozilla::dom::quota::StorageNameParams StorageNameParams;
    typedef ::mozilla::ipc::SystemPrincipalInfo SystemPrincipalInfo;
    typedef ::mozilla::dom::quota::Client::Type Type;
    typedef ::mozilla::ipc::UInt64Response UInt64Response;
    template<class T> using UniquePtr = mozilla::UniquePtr<T>;
    typedef ::mozilla::dom::quota::UsageInfo UsageInfo;
    typedef ::mozilla::dom::quota::UsageInfoResponse UsageInfoResponse;
    typedef ::mozilla::ipc::WebTransportHash WebTransportHash;
    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 ::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;

public:
    typedef std::function<void(const BoolResponse&)> StorageInitializedResolver;
    typedef std::function<void(const BoolResponse&)> PersistentStorageInitializedResolver;
    typedef std::function<void(const BoolResponse&)> TemporaryStorageInitializedResolver;
    typedef std::function<void(const BoolResponse&)> TemporaryGroupInitializedResolver;
    typedef std::function<void(const BoolResponse&)> PersistentOriginInitializedResolver;
    typedef std::function<void(const BoolResponse&)> TemporaryOriginInitializedResolver;
    typedef std::function<void(const BoolResponse&)> InitializeStorageResolver;
    typedef std::function<void(const BoolResponse&)> InitializePersistentStorageResolver;
    typedef std::function<void(const BoolResponse&)> InitializeAllTemporaryOriginsResolver;
    typedef std::function<void(const BoolResponse&)> InitializeTemporaryGroupResolver;
    typedef std::function<void(const BoolResponse&)> InitializePersistentOriginResolver;
    typedef std::function<void(const BoolResponse&)> InitializeTemporaryOriginResolver;
    typedef std::function<void(const BoolResponse&)> InitializePersistentClientResolver;
    typedef std::function<void(const BoolResponse&)> InitializeTemporaryClientResolver;
    typedef std::function<void(const BoolResponse&)> InitializeTemporaryStorageResolver;
    typedef std::function<void(OriginUsageMetadataArrayResponse&&)> GetUsageResolver;
    typedef std::function<void(const UsageInfoResponse&)> GetOriginUsageResolver;
    typedef std::function<void(const UInt64Response&)> GetCachedOriginUsageResolver;
    typedef std::function<void(const CStringArrayResponse&)> ListOriginsResolver;
    typedef std::function<void(const CStringArrayResponse&)> ListCachedOriginsResolver;
    typedef std::function<void(const BoolResponse&)> ClearStoragesForOriginResolver;
    typedef std::function<void(const BoolResponse&)> ClearStoragesForClientResolver;
    typedef std::function<void(const BoolResponse&)> ClearStoragesForOriginPrefixResolver;
    typedef std::function<void(const BoolResponse&)> ClearStoragesForOriginAttributesPatternResolver;
    typedef std::function<void(const BoolResponse&)> ClearStoragesForPrivateBrowsingResolver;
    typedef std::function<void(const BoolResponse&)> ClearStorageResolver;
    typedef std::function<void(const BoolResponse&)> ShutdownStoragesForOriginResolver;
    typedef std::function<void(const BoolResponse&)> ShutdownStoragesForClientResolver;
    typedef std::function<void(const BoolResponse&)> ShutdownStorageResolver;

protected:
    virtual mozilla::ipc::IPCResult
    Recv__delete__();
    virtual mozilla::ipc::IPCResult
    RecvPQuotaRequestConstructor(
            PQuotaRequestParent* actor,
            const RequestParams& params);
    virtual mozilla::ipc::IPCResult
    RecvStorageInitialized(StorageInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvPersistentStorageInitialized(PersistentStorageInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvTemporaryStorageInitialized(TemporaryStorageInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvTemporaryGroupInitialized(
            const PrincipalInfo& principalInfo,
            TemporaryGroupInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvPersistentOriginInitialized(
            const PrincipalInfo& principalInfo,
            PersistentOriginInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvTemporaryOriginInitialized(
            const PersistenceType& persistenceType,
            const PrincipalInfo& principalInfo,
            TemporaryOriginInitializedResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeStorage(InitializeStorageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializePersistentStorage(InitializePersistentStorageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeAllTemporaryOrigins(InitializeAllTemporaryOriginsResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeTemporaryGroup(
            const PrincipalInfo& principalInfo,
            InitializeTemporaryGroupResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializePersistentOrigin(
            const PrincipalInfo& principalInfo,
            InitializePersistentOriginResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeTemporaryOrigin(
            const PersistenceType& persistenceType,
            const PrincipalInfo& principalInfo,
            const bool& createIfNonExistent,
            InitializeTemporaryOriginResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializePersistentClient(
            const PrincipalInfo& principalInfo,
            const Type& clientType,
            InitializePersistentClientResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeTemporaryClient(
            const PersistenceType& persistenceType,
            const PrincipalInfo& principalInfo,
            const Type& clientType,
            const bool& createIfNonExistent,
            InitializeTemporaryClientResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvInitializeTemporaryStorage(InitializeTemporaryStorageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvGetUsage(
            const bool& getAll,
            ManagedEndpoint<::mozilla::dom::quota::PQuotaUsageRequestParent>&& parentEndpoint,
            GetUsageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvGetOriginUsage(
            const PrincipalInfo& principalInfo,
            ManagedEndpoint<::mozilla::dom::quota::PQuotaUsageRequestParent>&& parentEndpoint,
            GetOriginUsageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvGetCachedOriginUsage(
            const PrincipalInfo& principalInfo,
            GetCachedOriginUsageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvListOrigins(ListOriginsResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvListCachedOrigins(ListCachedOriginsResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStoragesForOrigin(
            const mozilla::Maybe<PersistenceType>& persistenceType,
            const PrincipalInfo& principalInfo,
            ClearStoragesForOriginResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStoragesForClient(
            const mozilla::Maybe<PersistenceType>& persistenceType,
            const PrincipalInfo& principalInfo,
            const Type& clientType,
            ClearStoragesForClientResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStoragesForOriginPrefix(
            const mozilla::Maybe<PersistenceType>& persistenceType,
            const PrincipalInfo& principalInfo,
            ClearStoragesForOriginPrefixResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStoragesForOriginAttributesPattern(
            const OriginAttributesPattern& pattern,
            ClearStoragesForOriginAttributesPatternResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStoragesForPrivateBrowsing(ClearStoragesForPrivateBrowsingResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvClearStorage(ClearStorageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvShutdownStoragesForOrigin(
            const mozilla::Maybe<PersistenceType>& persistenceType,
            const PrincipalInfo& principalInfo,
            ShutdownStoragesForOriginResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvShutdownStoragesForClient(
            const mozilla::Maybe<PersistenceType>& persistenceType,
            const PrincipalInfo& principalInfo,
            const Type& clientType,
            ShutdownStoragesForClientResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvShutdownStorage(ShutdownStorageResolver&& aResolve) = 0;
    virtual mozilla::ipc::IPCResult
    RecvStartIdleMaintenance() = 0;
    virtual mozilla::ipc::IPCResult
    RecvStopIdleMaintenance() = 0;
    virtual mozilla::ipc::IPCResult
    RecvAbortOperationsForProcess(const ContentParentId& contentParentId) = 0;
    virtual mozilla::ipc::IPCResult
    RecvSetThumbnailPrivateIdentityId(const uint32_t& aThumbnailPrivateIdentityId) = 0;
    virtual PQuotaRequestParent*
    AllocPQuotaRequestParent(const RequestParams& params) = 0;
    virtual bool
    DeallocPQuotaRequestParent(PQuotaRequestParent* aActor) = 0;
public:
    typedef mozilla::ipc::IProtocol IProtocol;
    typedef IPC::Message Message;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;

public:
    MOZ_IMPLICIT PQuotaParent();

    virtual ~PQuotaParent();

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

    PBackgroundParent*
    Manager() const;

    void
    ManagedPQuotaRequestParent(nsTArray<PQuotaRequestParent*>& aArr) const;
    const ManagedContainer<PQuotaRequestParent>&
    ManagedPQuotaRequestParent() const;

    void
    ManagedPQuotaUsageRequestParent(nsTArray<PQuotaUsageRequestParent*>& aArr) const;
    const ManagedContainer<PQuotaUsageRequestParent>&
    ManagedPQuotaUsageRequestParent() const;

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

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

    void
    RejectPendingResponses(ResponseRejectReason aReason) final;

    ManagedEndpoint<PQuotaRequestChild>
    OpenPQuotaRequestEndpoint(PQuotaRequestParent* aActor);
    bool
    BindPQuotaRequestEndpoint(
            ManagedEndpoint<PQuotaRequestParent> aEndpoint,
            PQuotaRequestParent* aActor);

    ManagedEndpoint<PQuotaUsageRequestChild>
    OpenPQuotaUsageRequestEndpoint(PQuotaUsageRequestParent* aActor);
    bool
    BindPQuotaUsageRequestEndpoint(
            ManagedEndpoint<PQuotaUsageRequestParent> aEndpoint,
            PQuotaUsageRequestParent* aActor);

    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:
    mozilla::ipc::IPDLAsyncReturnsCallbacks mAsyncCallbacks;

    bool mAwaitingManagedEndpointBind = false;

    ManagedContainer<PQuotaRequestParent> mManagedPQuotaRequestParent;
    ManagedContainer<PQuotaUsageRequestParent> mManagedPQuotaUsageRequestParent;
};


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

#endif // ifndef PQuotaParent_h
