PQuota.ipdl (6111B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include protocol PBackground; 6 include protocol PQuotaRequest; 7 include protocol PQuotaUsageRequest; 8 9 include PBackgroundSharedTypes; 10 11 include "mozilla/dom/quota/SerializationHelpers.h"; 12 13 using mozilla::OriginAttributesPattern 14 from "mozilla/OriginAttributes.h"; 15 16 using mozilla::dom::quota::PersistenceType 17 from "mozilla/dom/quota/PersistenceType.h"; 18 19 using mozilla::dom::quota::Client::Type 20 from "mozilla/dom/quota/Client.h"; 21 22 [MoveOnly] using mozilla::dom::quota::OriginUsageMetadataArray 23 from "mozilla/dom/quota/CommonMetadataArray.h"; 24 25 using mozilla::dom::quota::UsageInfo 26 from "mozilla/dom/quota/UsageInfo.h"; 27 28 using mozilla::dom::ContentParentId 29 from "mozilla/dom/ipc/IdType.h"; 30 31 namespace mozilla { 32 33 namespace ipc { 34 35 union BoolResponse 36 { 37 nsresult; 38 bool; 39 }; 40 41 union UInt64Response 42 { 43 nsresult; 44 uint64_t; 45 }; 46 47 union CStringArrayResponse 48 { 49 nsresult; 50 nsCString[]; 51 }; 52 53 } // namespace ipc 54 55 namespace dom { 56 namespace quota { 57 58 union OriginUsageMetadataArrayResponse 59 { 60 nsresult; 61 OriginUsageMetadataArray; 62 }; 63 64 union UsageInfoResponse 65 { 66 nsresult; 67 UsageInfo; 68 }; 69 70 struct StorageNameParams 71 { 72 }; 73 74 struct GetFullOriginMetadataParams 75 { 76 PersistenceType persistenceType; 77 PrincipalInfo principalInfo; 78 }; 79 80 struct ClearResetOriginParams 81 { 82 PrincipalInfo principalInfo; 83 PersistenceType persistenceType; 84 bool persistenceTypeIsExplicit; 85 Type clientType; 86 bool clientTypeIsExplicit; 87 }; 88 89 struct PersistedParams 90 { 91 PrincipalInfo principalInfo; 92 }; 93 94 struct PersistParams 95 { 96 PrincipalInfo principalInfo; 97 }; 98 99 struct EstimateParams 100 { 101 PrincipalInfo principalInfo; 102 }; 103 104 union RequestParams 105 { 106 StorageNameParams; 107 GetFullOriginMetadataParams; 108 PersistedParams; 109 PersistParams; 110 EstimateParams; 111 }; 112 113 [ChildImpl=virtual, ParentImpl=virtual] 114 protocol PQuota 115 { 116 manager PBackground; 117 118 manages PQuotaRequest; 119 manages PQuotaUsageRequest; 120 121 parent: 122 async __delete__(); 123 124 async PQuotaRequest(RequestParams params); 125 126 async StorageInitialized() 127 returns(BoolResponse response); 128 129 async PersistentStorageInitialized() 130 returns(BoolResponse response); 131 132 async TemporaryStorageInitialized() 133 returns(BoolResponse response); 134 135 async TemporaryGroupInitialized(PrincipalInfo principalInfo) 136 returns(BoolResponse response); 137 138 async PersistentOriginInitialized(PrincipalInfo principalInfo) 139 returns(BoolResponse response); 140 141 async TemporaryOriginInitialized(PersistenceType persistenceType, 142 PrincipalInfo principalInfo) 143 returns(BoolResponse response); 144 145 async InitializeStorage() 146 returns(BoolResponse response); 147 148 async InitializePersistentStorage() 149 returns(BoolResponse response); 150 151 async InitializeAllTemporaryOrigins() 152 returns(BoolResponse response); 153 154 async InitializeTemporaryGroup(PrincipalInfo principalInfo) 155 returns(BoolResponse response); 156 157 async InitializePersistentOrigin(PrincipalInfo principalInfo) 158 returns(BoolResponse response); 159 160 async InitializeTemporaryOrigin(PersistenceType persistenceType, 161 PrincipalInfo principalInfo, 162 bool createIfNonExistent) 163 returns(BoolResponse response); 164 165 async InitializePersistentClient(PrincipalInfo principalInfo, 166 Type clientType) 167 returns(BoolResponse response); 168 169 async InitializeTemporaryClient(PersistenceType persistenceType, 170 PrincipalInfo principalInfo, 171 Type clientType, 172 bool createIfNonExistent) 173 returns(BoolResponse response); 174 175 async InitializeTemporaryStorage() 176 returns(BoolResponse response); 177 178 async GetUsage(bool getAll, 179 ManagedEndpoint<PQuotaUsageRequestParent> parentEndpoint) 180 returns(OriginUsageMetadataArrayResponse response); 181 182 async GetOriginUsage(PrincipalInfo principalInfo, 183 ManagedEndpoint<PQuotaUsageRequestParent> parentEndpoint) 184 returns(UsageInfoResponse response); 185 186 async GetCachedOriginUsage(PrincipalInfo principalInfo) 187 returns(UInt64Response response); 188 189 async ListOrigins() 190 returns(CStringArrayResponse response); 191 192 async ListCachedOrigins() 193 returns(CStringArrayResponse response); 194 195 async ClearStoragesForOrigin(PersistenceType? persistenceType, 196 PrincipalInfo principalInfo) 197 returns(BoolResponse response); 198 199 async ClearStoragesForClient(PersistenceType? persistenceType, 200 PrincipalInfo principalInfo, 201 Type clientType) 202 returns(BoolResponse response); 203 204 async ClearStoragesForOriginPrefix(PersistenceType? persistenceType, 205 PrincipalInfo principalInfo) 206 returns(BoolResponse response); 207 208 // This can only be called from some other thread in the parent process! 209 async ClearStoragesForOriginAttributesPattern(OriginAttributesPattern pattern) 210 returns(BoolResponse response); 211 212 async ClearStoragesForPrivateBrowsing() 213 returns(BoolResponse response); 214 215 async ClearStorage() 216 returns(BoolResponse response); 217 218 async ShutdownStoragesForOrigin(PersistenceType? persistenceType, 219 PrincipalInfo principalInfo) 220 returns(BoolResponse response); 221 222 async ShutdownStoragesForClient(PersistenceType? persistenceType, 223 PrincipalInfo principalInfo, 224 Type clientType) 225 returns(BoolResponse response); 226 227 async ShutdownStorage() 228 returns(BoolResponse response); 229 230 async StartIdleMaintenance(); 231 232 async StopIdleMaintenance(); 233 234 async AbortOperationsForProcess(ContentParentId contentParentId); 235 236 async SetThumbnailPrivateIdentityId(uint32_t aThumbnailPrivateIdentityId); 237 }; 238 239 } // namespace quota 240 } // namespace dom 241 } // namespace mozilla