/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PBackground; include protocol PQuotaRequest; include protocol PQuotaUsageRequest; include PBackgroundSharedTypes; include "mozilla/dom/quota/SerializationHelpers.h"; using mozilla::OriginAttributesPattern from "mozilla/OriginAttributes.h"; using mozilla::dom::quota::PersistenceType from "mozilla/dom/quota/PersistenceType.h"; using mozilla::dom::quota::Client::Type from "mozilla/dom/quota/Client.h"; [MoveOnly] using mozilla::dom::quota::OriginUsageMetadataArray from "mozilla/dom/quota/CommonMetadataArray.h"; using mozilla::dom::quota::UsageInfo from "mozilla/dom/quota/UsageInfo.h"; using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h"; namespace mozilla { namespace ipc { union BoolResponse { nsresult; bool; }; union UInt64Response { nsresult; uint64_t; }; union CStringArrayResponse { nsresult; nsCString[]; }; } // namespace ipc namespace dom { namespace quota { union OriginUsageMetadataArrayResponse { nsresult; OriginUsageMetadataArray; }; union UsageInfoResponse { nsresult; UsageInfo; }; struct StorageNameParams { }; struct GetFullOriginMetadataParams { PersistenceType persistenceType; PrincipalInfo principalInfo; }; struct ClearResetOriginParams { PrincipalInfo principalInfo; PersistenceType persistenceType; bool persistenceTypeIsExplicit; Type clientType; bool clientTypeIsExplicit; }; struct PersistedParams { PrincipalInfo principalInfo; }; struct PersistParams { PrincipalInfo principalInfo; }; struct EstimateParams { PrincipalInfo principalInfo; }; union RequestParams { StorageNameParams; GetFullOriginMetadataParams; PersistedParams; PersistParams; EstimateParams; }; [ChildImpl=virtual, ParentImpl=virtual] protocol PQuota { manager PBackground; manages PQuotaRequest; manages PQuotaUsageRequest; parent: async __delete__(); async PQuotaRequest(RequestParams params); async StorageInitialized() returns(BoolResponse response); async PersistentStorageInitialized() returns(BoolResponse response); async TemporaryStorageInitialized() returns(BoolResponse response); async TemporaryGroupInitialized(PrincipalInfo principalInfo) returns(BoolResponse response); async PersistentOriginInitialized(PrincipalInfo principalInfo) returns(BoolResponse response); async TemporaryOriginInitialized(PersistenceType persistenceType, PrincipalInfo principalInfo) returns(BoolResponse response); async InitializeStorage() returns(BoolResponse response); async InitializePersistentStorage() returns(BoolResponse response); async InitializeAllTemporaryOrigins() returns(BoolResponse response); async InitializeTemporaryGroup(PrincipalInfo principalInfo) returns(BoolResponse response); async InitializePersistentOrigin(PrincipalInfo principalInfo) returns(BoolResponse response); async InitializeTemporaryOrigin(PersistenceType persistenceType, PrincipalInfo principalInfo, bool createIfNonExistent) returns(BoolResponse response); async InitializePersistentClient(PrincipalInfo principalInfo, Type clientType) returns(BoolResponse response); async InitializeTemporaryClient(PersistenceType persistenceType, PrincipalInfo principalInfo, Type clientType, bool createIfNonExistent) returns(BoolResponse response); async InitializeTemporaryStorage() returns(BoolResponse response); async GetUsage(bool getAll, ManagedEndpoint parentEndpoint) returns(OriginUsageMetadataArrayResponse response); async GetOriginUsage(PrincipalInfo principalInfo, ManagedEndpoint parentEndpoint) returns(UsageInfoResponse response); async GetCachedOriginUsage(PrincipalInfo principalInfo) returns(UInt64Response response); async ListOrigins() returns(CStringArrayResponse response); async ListCachedOrigins() returns(CStringArrayResponse response); async ClearStoragesForOrigin(PersistenceType? persistenceType, PrincipalInfo principalInfo) returns(BoolResponse response); async ClearStoragesForClient(PersistenceType? persistenceType, PrincipalInfo principalInfo, Type clientType) returns(BoolResponse response); async ClearStoragesForOriginPrefix(PersistenceType? persistenceType, PrincipalInfo principalInfo) returns(BoolResponse response); // This can only be called from some other thread in the parent process! async ClearStoragesForOriginAttributesPattern(OriginAttributesPattern pattern) returns(BoolResponse response); async ClearStoragesForPrivateBrowsing() returns(BoolResponse response); async ClearStorage() returns(BoolResponse response); async ShutdownStoragesForOrigin(PersistenceType? persistenceType, PrincipalInfo principalInfo) returns(BoolResponse response); async ShutdownStoragesForClient(PersistenceType? persistenceType, PrincipalInfo principalInfo, Type clientType) returns(BoolResponse response); async ShutdownStorage() returns(BoolResponse response); async StartIdleMaintenance(); async StopIdleMaintenance(); async AbortOperationsForProcess(ContentParentId contentParentId); async SetThumbnailPrivateIdentityId(uint32_t aThumbnailPrivateIdentityId); }; } // namespace quota } // namespace dom } // namespace mozilla