BackgroundParentImpl.h (15120B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_ipc_backgroundparentimpl_h__ 8 #define mozilla_ipc_backgroundparentimpl_h__ 9 10 #include "mozilla/ipc/PBackgroundParent.h" 11 12 namespace mozilla::ipc { 13 14 // Instances of this class should never be created directly. This class is meant 15 // to be inherited in BackgroundImpl. 16 class BackgroundParentImpl : public PBackgroundParent { 17 protected: 18 BackgroundParentImpl(); 19 virtual ~BackgroundParentImpl(); 20 21 void ProcessingError(Result aCode, const char* aReason) override; 22 23 void ActorDestroy(ActorDestroyReason aWhy) override; 24 25 PBackgroundTestParent* AllocPBackgroundTestParent( 26 const nsACString& aTestArg) override; 27 28 mozilla::ipc::IPCResult RecvPBackgroundTestConstructor( 29 PBackgroundTestParent* aActor, const nsACString& aTestArg) override; 30 31 bool DeallocPBackgroundTestParent(PBackgroundTestParent* aActor) override; 32 33 already_AddRefed<PBackgroundIDBFactoryParent> 34 AllocPBackgroundIDBFactoryParent(const LoggingInfo& aLoggingInfo, 35 const nsACString& aSystemLocale) override; 36 37 mozilla::ipc::IPCResult RecvPBackgroundIDBFactoryConstructor( 38 PBackgroundIDBFactoryParent* aActor, const LoggingInfo& aLoggingInfo, 39 const nsACString& aSystemLocale) override; 40 41 PBackgroundIndexedDBUtilsParent* AllocPBackgroundIndexedDBUtilsParent() 42 override; 43 44 bool DeallocPBackgroundIndexedDBUtilsParent( 45 PBackgroundIndexedDBUtilsParent* aActor) override; 46 47 mozilla::ipc::IPCResult RecvFlushPendingFileDeletions() override; 48 49 already_AddRefed<PBackgroundSDBConnectionParent> 50 AllocPBackgroundSDBConnectionParent( 51 const PersistenceType& aPersistenceType, 52 const PrincipalInfo& aPrincipalInfo) override; 53 54 mozilla::ipc::IPCResult RecvPBackgroundSDBConnectionConstructor( 55 PBackgroundSDBConnectionParent* aActor, 56 const PersistenceType& aPersistenceType, 57 const PrincipalInfo& aPrincipalInfo) override; 58 59 PBackgroundLSObserverParent* AllocPBackgroundLSObserverParent( 60 const uint64_t& aObserverId) override; 61 62 mozilla::ipc::IPCResult RecvPBackgroundLSObserverConstructor( 63 PBackgroundLSObserverParent* aActor, 64 const uint64_t& aObserverId) override; 65 66 bool DeallocPBackgroundLSObserverParent( 67 PBackgroundLSObserverParent* aActor) override; 68 69 PBackgroundLSRequestParent* AllocPBackgroundLSRequestParent( 70 const LSRequestParams& aParams) override; 71 72 mozilla::ipc::IPCResult RecvPBackgroundLSRequestConstructor( 73 PBackgroundLSRequestParent* aActor, 74 const LSRequestParams& aParams) override; 75 76 bool DeallocPBackgroundLSRequestParent( 77 PBackgroundLSRequestParent* aActor) override; 78 79 PBackgroundLSSimpleRequestParent* AllocPBackgroundLSSimpleRequestParent( 80 const LSSimpleRequestParams& aParams) override; 81 82 mozilla::ipc::IPCResult RecvPBackgroundLSSimpleRequestConstructor( 83 PBackgroundLSSimpleRequestParent* aActor, 84 const LSSimpleRequestParams& aParams) override; 85 86 bool DeallocPBackgroundLSSimpleRequestParent( 87 PBackgroundLSSimpleRequestParent* aActor) override; 88 89 PBackgroundLocalStorageCacheParent* AllocPBackgroundLocalStorageCacheParent( 90 const PrincipalInfo& aPrincipalInfo, const nsACString& aOriginKey, 91 const uint32_t& aPrivateBrowsingId) override; 92 93 mozilla::ipc::IPCResult RecvPBackgroundLocalStorageCacheConstructor( 94 PBackgroundLocalStorageCacheParent* aActor, 95 const PrincipalInfo& aPrincipalInfo, const nsACString& aOriginKey, 96 const uint32_t& aPrivateBrowsingId) override; 97 98 bool DeallocPBackgroundLocalStorageCacheParent( 99 PBackgroundLocalStorageCacheParent* aActor) override; 100 101 PBackgroundStorageParent* AllocPBackgroundStorageParent( 102 const nsAString& aProfilePath, 103 const uint32_t& aPrivateBrowsingId) override; 104 105 mozilla::ipc::IPCResult RecvPBackgroundStorageConstructor( 106 PBackgroundStorageParent* aActor, const nsAString& aProfilePath, 107 const uint32_t& aPrivateBrowsingId) override; 108 109 bool DeallocPBackgroundStorageParent( 110 PBackgroundStorageParent* aActor) override; 111 112 already_AddRefed<PBackgroundSessionStorageManagerParent> 113 AllocPBackgroundSessionStorageManagerParent( 114 const uint64_t& aTopContextId) override; 115 116 already_AddRefed<PBackgroundSessionStorageServiceParent> 117 AllocPBackgroundSessionStorageServiceParent() override; 118 119 mozilla::ipc::IPCResult RecvCreateFileSystemManagerParent( 120 const PrincipalInfo& aPrincipalInfo, 121 Endpoint<mozilla::dom::PFileSystemManagerParent>&& aParentEndpoint, 122 CreateFileSystemManagerParentResolver&& aResolver) override; 123 124 mozilla::ipc::IPCResult RecvCreateWebTransportParent( 125 const nsAString& aURL, nsIPrincipal* aPrincipal, 126 const uint64_t& aBrowsingContextID, 127 const mozilla::Maybe<IPCClientInfo>& aClientInfo, const bool& aDedicated, 128 const bool& aRequireUnreliable, const uint32_t& aCongestionControl, 129 nsTArray<WebTransportHash>&& aServerCertHashes, 130 Endpoint<PWebTransportParent>&& aParentEndpoint, 131 CreateWebTransportParentResolver&& aResolver) override; 132 133 mozilla::ipc::IPCResult RecvCreateNotificationParent( 134 Endpoint<dom::notification::PNotificationParent>&& aParentEndpoint, 135 NotNull<nsIPrincipal*> aPrincipal, 136 NotNull<nsIPrincipal*> aEffectiveStoragePrincipal, 137 const bool& aIsSecureContext, const nsAString& aScope, 138 const IPCNotification& aNotification, 139 CreateNotificationParentResolver&& aResolver) final; 140 141 already_AddRefed<PIdleSchedulerParent> AllocPIdleSchedulerParent() override; 142 143 PTemporaryIPCBlobParent* AllocPTemporaryIPCBlobParent() override; 144 145 mozilla::ipc::IPCResult RecvPTemporaryIPCBlobConstructor( 146 PTemporaryIPCBlobParent* actor) override; 147 148 bool DeallocPTemporaryIPCBlobParent(PTemporaryIPCBlobParent* aActor) override; 149 150 PFileCreatorParent* AllocPFileCreatorParent( 151 const nsAString& aFullPath, const nsAString& aType, 152 const nsAString& aName, const Maybe<int64_t>& aLastModified, 153 const bool& aExistenceCheck, const bool& aIsFromNsIFile) override; 154 155 mozilla::ipc::IPCResult RecvPFileCreatorConstructor( 156 PFileCreatorParent* actor, const nsAString& aFullPath, 157 const nsAString& aType, const nsAString& aName, 158 const Maybe<int64_t>& aLastModified, const bool& aExistenceCheck, 159 const bool& aIsFromNsIFile) override; 160 161 bool DeallocPFileCreatorParent(PFileCreatorParent* aActor) override; 162 163 already_AddRefed<mozilla::dom::PRemoteWorkerControllerParent> 164 AllocPRemoteWorkerControllerParent( 165 const mozilla::dom::RemoteWorkerData& aRemoteWorkerData) override; 166 167 mozilla::ipc::IPCResult RecvPRemoteWorkerControllerConstructor( 168 mozilla::dom::PRemoteWorkerControllerParent* aActor, 169 const mozilla::dom::RemoteWorkerData& aRemoteWorkerData) override; 170 171 mozilla::dom::PSharedWorkerParent* AllocPSharedWorkerParent( 172 const mozilla::dom::RemoteWorkerData& aData, const uint64_t& aWindowID, 173 const mozilla::dom::MessagePortIdentifier& aPortIdentifier) override; 174 175 mozilla::ipc::IPCResult RecvPSharedWorkerConstructor( 176 PSharedWorkerParent* aActor, const mozilla::dom::RemoteWorkerData& aData, 177 const uint64_t& aWindowID, 178 const mozilla::dom::MessagePortIdentifier& aPortIdentifier) override; 179 180 bool DeallocPSharedWorkerParent(PSharedWorkerParent* aActor) override; 181 182 already_AddRefed<PVsyncParent> AllocPVsyncParent() override; 183 184 PBroadcastChannelParent* AllocPBroadcastChannelParent( 185 const PrincipalInfo& aPrincipalInfo, const nsACString& aOrigin, 186 const nsAString& aChannel) override; 187 188 mozilla::ipc::IPCResult RecvPBroadcastChannelConstructor( 189 PBroadcastChannelParent* actor, const PrincipalInfo& aPrincipalInfo, 190 const nsACString& origin, const nsAString& channel) override; 191 192 bool DeallocPBroadcastChannelParent(PBroadcastChannelParent* aActor) override; 193 194 virtual PCookieStoreParent* AllocPCookieStoreParent() override; 195 196 virtual bool DeallocPCookieStoreParent(PCookieStoreParent* aActor) override; 197 198 PServiceWorkerManagerParent* AllocPServiceWorkerManagerParent() override; 199 200 bool DeallocPServiceWorkerManagerParent( 201 PServiceWorkerManagerParent* aActor) override; 202 203 PCamerasParent* AllocPCamerasParent() override; 204 #ifdef MOZ_WEBRTC 205 mozilla::ipc::IPCResult RecvPCamerasConstructor( 206 PCamerasParent* aActor) override; 207 #endif 208 bool DeallocPCamerasParent(PCamerasParent* aActor) override; 209 210 mozilla::ipc::IPCResult RecvShutdownServiceWorkerRegistrar() override; 211 212 already_AddRefed<dom::cache::PCacheStorageParent> AllocPCacheStorageParent( 213 const dom::cache::Namespace& aNamespace, 214 const PrincipalInfo& aPrincipalInfo) override; 215 216 PUDPSocketParent* AllocPUDPSocketParent(const Maybe<PrincipalInfo>& pInfo, 217 const nsACString& aFilter) override; 218 mozilla::ipc::IPCResult RecvPUDPSocketConstructor( 219 PUDPSocketParent*, const Maybe<PrincipalInfo>& aPrincipalInfo, 220 const nsACString& aFilter) override; 221 bool DeallocPUDPSocketParent(PUDPSocketParent*) override; 222 223 PMessagePortParent* AllocPMessagePortParent( 224 const nsID& aUUID, const nsID& aDestinationUUID, 225 const uint32_t& aSequenceID) override; 226 227 mozilla::ipc::IPCResult RecvPMessagePortConstructor( 228 PMessagePortParent* aActor, const nsID& aUUID, 229 const nsID& aDestinationUUID, const uint32_t& aSequenceID) override; 230 231 bool DeallocPMessagePortParent(PMessagePortParent* aActor) override; 232 233 mozilla::ipc::IPCResult RecvMessagePortForceClose( 234 const nsID& aUUID, const nsID& aDestinationUUID, 235 const uint32_t& aSequenceID) override; 236 237 already_AddRefed<PQuotaParent> AllocPQuotaParent() override; 238 239 mozilla::ipc::IPCResult RecvShutdownQuotaManager() override; 240 241 mozilla::ipc::IPCResult RecvShutdownBackgroundSessionStorageManagers() 242 override; 243 244 mozilla::ipc::IPCResult RecvPropagateBackgroundSessionStorageManager( 245 const uint64_t& aCurrentTopContextId, 246 const uint64_t& aTargetTopContextId) override; 247 248 mozilla::ipc::IPCResult RecvRemoveBackgroundSessionStorageManager( 249 const uint64_t& aTopContextId) override; 250 251 mozilla::ipc::IPCResult RecvLoadSessionStorageManagerData( 252 const uint64_t& aTopContextId, 253 nsTArray<mozilla::dom::SSCacheCopy>&& aOriginCacheCopy) override; 254 255 mozilla::ipc::IPCResult RecvGetSessionStorageManagerData( 256 const uint64_t& aTopContextId, const uint32_t& aSizeLimit, 257 const bool& aCancelSessionStoreTimer, 258 GetSessionStorageManagerDataResolver&& aResolver) override; 259 260 already_AddRefed<PFileSystemRequestParent> AllocPFileSystemRequestParent( 261 const FileSystemParams&) override; 262 263 mozilla::ipc::IPCResult RecvPFileSystemRequestConstructor( 264 PFileSystemRequestParent* actor, const FileSystemParams& params) override; 265 266 // Gamepad API Background IPC 267 already_AddRefed<PGamepadEventChannelParent> AllocPGamepadEventChannelParent() 268 override; 269 270 already_AddRefed<PGamepadTestChannelParent> AllocPGamepadTestChannelParent() 271 override; 272 273 already_AddRefed<PHttpBackgroundChannelParent> 274 AllocPHttpBackgroundChannelParent(const uint64_t& aChannelId) override; 275 276 mozilla::ipc::IPCResult RecvPHttpBackgroundChannelConstructor( 277 PHttpBackgroundChannelParent* aActor, 278 const uint64_t& aChannelId) override; 279 280 already_AddRefed<PClientManagerParent> AllocPClientManagerParent() override; 281 282 mozilla::ipc::IPCResult RecvPClientManagerConstructor( 283 PClientManagerParent* aActor) override; 284 285 mozilla::ipc::IPCResult RecvCreateBoundStorageKeyParent( 286 Endpoint<::mozilla::dom::cache::PBoundStorageKeyParent>&& aEndpoint, 287 const Namespace& aNamespace, 288 const PrincipalInfo& aPrincipalInfo) override; 289 290 mozilla::ipc::IPCResult RecvCreateMIDIPort( 291 Endpoint<PMIDIPortParent>&& aEndpoint, const MIDIPortInfo& aPortInfo, 292 const bool& aSysexEnabled) override; 293 294 mozilla::ipc::IPCResult RecvCreateMIDIManager( 295 Endpoint<PMIDIManagerParent>&& aEndpoint) override; 296 297 mozilla::ipc::IPCResult RecvHasMIDIDevice( 298 HasMIDIDeviceResolver&& aResolver) override; 299 300 mozilla::ipc::IPCResult RecvCreateMLSTransaction( 301 Endpoint<PMLSTransactionParent>&& aEndpoint, 302 NotNull<nsIPrincipal*> aPrincipal) override; 303 304 mozilla::ipc::IPCResult RecvStorageActivity( 305 const PrincipalInfo& aPrincipalInfo) override; 306 307 already_AddRefed<PServiceWorkerParent> AllocPServiceWorkerParent( 308 const IPCServiceWorkerDescriptor&) final; 309 310 mozilla::ipc::IPCResult RecvPServiceWorkerManagerConstructor( 311 PServiceWorkerManagerParent* aActor) override; 312 313 mozilla::ipc::IPCResult RecvPServiceWorkerConstructor( 314 PServiceWorkerParent* aActor, 315 const IPCServiceWorkerDescriptor& aDescriptor) override; 316 317 already_AddRefed<PServiceWorkerContainerParent> 318 AllocPServiceWorkerContainerParent() final; 319 320 mozilla::ipc::IPCResult RecvPServiceWorkerContainerConstructor( 321 PServiceWorkerContainerParent* aActor) override; 322 323 already_AddRefed<PServiceWorkerRegistrationParent> 324 AllocPServiceWorkerRegistrationParent( 325 const IPCServiceWorkerRegistrationDescriptor&, 326 const IPCClientInfo&) final; 327 328 mozilla::ipc::IPCResult RecvPServiceWorkerRegistrationConstructor( 329 PServiceWorkerRegistrationParent* aActor, 330 const IPCServiceWorkerRegistrationDescriptor& aDescriptor, 331 const IPCClientInfo& aForClient) override; 332 333 PEndpointForReportParent* AllocPEndpointForReportParent( 334 const nsAString& aGroupName, 335 const PrincipalInfo& aPrincipalInfo) override; 336 337 mozilla::ipc::IPCResult RecvPEndpointForReportConstructor( 338 PEndpointForReportParent* actor, const nsAString& aGroupName, 339 const PrincipalInfo& aPrincipalInfo) override; 340 341 mozilla::ipc::IPCResult RecvEnsureRDDProcessAndCreateBridge( 342 EnsureRDDProcessAndCreateBridgeResolver&& aResolver) override; 343 344 mozilla::ipc::IPCResult RecvEnsureUtilityProcessAndCreateBridge( 345 const RemoteMediaIn& aLocation, 346 EnsureUtilityProcessAndCreateBridgeResolver&& aResolver) override; 347 348 mozilla::ipc::IPCResult RecvRequestCameraAccess( 349 const bool& aAllowPermissionRequest, 350 RequestCameraAccessResolver&& aResolver) override; 351 352 bool DeallocPEndpointForReportParent( 353 PEndpointForReportParent* aActor) override; 354 355 mozilla::ipc::IPCResult RecvRemoveEndpoint( 356 const nsAString& aGroupName, const nsACString& aEndpointURL, 357 const PrincipalInfo& aPrincipalInfo) override; 358 359 mozilla::ipc::IPCResult RecvPLockManagerConstructor( 360 PLockManagerParent* actor, mozilla::NotNull<nsIPrincipal*> aPrincipalInfo, 361 const Maybe<nsID>& aClientId) override; 362 363 already_AddRefed<PLockManagerParent> AllocPLockManagerParent( 364 NotNull<nsIPrincipal*> aPrincipal, const Maybe<nsID>& aClientId) final; 365 366 already_AddRefed<PFetchParent> AllocPFetchParent() override; 367 }; 368 369 } // namespace mozilla::ipc 370 371 #endif // mozilla_ipc_backgroundparentimpl_h__