Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / ipc / glue / BackgroundParentImpl.h
blob583d6585fa54755bfe810fe257dba9ecafb34f6f
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/. */
7 #ifndef mozilla_ipc_backgroundparentimpl_h__
8 #define mozilla_ipc_backgroundparentimpl_h__
10 #include "mozilla/ipc/PBackgroundParent.h"
12 namespace mozilla::ipc {
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();
21 void ProcessingError(Result aCode, const char* aReason) override;
23 void ActorDestroy(ActorDestroyReason aWhy) override;
25 PBackgroundTestParent* AllocPBackgroundTestParent(
26 const nsACString& aTestArg) override;
28 mozilla::ipc::IPCResult RecvPBackgroundTestConstructor(
29 PBackgroundTestParent* aActor, const nsACString& aTestArg) override;
31 bool DeallocPBackgroundTestParent(PBackgroundTestParent* aActor) override;
33 already_AddRefed<PBackgroundIDBFactoryParent>
34 AllocPBackgroundIDBFactoryParent(const LoggingInfo& aLoggingInfo,
35 const nsACString& aSystemLocale) override;
37 mozilla::ipc::IPCResult RecvPBackgroundIDBFactoryConstructor(
38 PBackgroundIDBFactoryParent* aActor, const LoggingInfo& aLoggingInfo,
39 const nsACString& aSystemLocale) override;
41 PBackgroundIndexedDBUtilsParent* AllocPBackgroundIndexedDBUtilsParent()
42 override;
44 bool DeallocPBackgroundIndexedDBUtilsParent(
45 PBackgroundIndexedDBUtilsParent* aActor) override;
47 mozilla::ipc::IPCResult RecvFlushPendingFileDeletions() override;
49 already_AddRefed<PBackgroundSDBConnectionParent>
50 AllocPBackgroundSDBConnectionParent(
51 const PersistenceType& aPersistenceType,
52 const PrincipalInfo& aPrincipalInfo) override;
54 mozilla::ipc::IPCResult RecvPBackgroundSDBConnectionConstructor(
55 PBackgroundSDBConnectionParent* aActor,
56 const PersistenceType& aPersistenceType,
57 const PrincipalInfo& aPrincipalInfo) override;
59 PBackgroundLSObserverParent* AllocPBackgroundLSObserverParent(
60 const uint64_t& aObserverId) override;
62 mozilla::ipc::IPCResult RecvPBackgroundLSObserverConstructor(
63 PBackgroundLSObserverParent* aActor,
64 const uint64_t& aObserverId) override;
66 bool DeallocPBackgroundLSObserverParent(
67 PBackgroundLSObserverParent* aActor) override;
69 PBackgroundLSRequestParent* AllocPBackgroundLSRequestParent(
70 const LSRequestParams& aParams) override;
72 mozilla::ipc::IPCResult RecvPBackgroundLSRequestConstructor(
73 PBackgroundLSRequestParent* aActor,
74 const LSRequestParams& aParams) override;
76 bool DeallocPBackgroundLSRequestParent(
77 PBackgroundLSRequestParent* aActor) override;
79 PBackgroundLSSimpleRequestParent* AllocPBackgroundLSSimpleRequestParent(
80 const LSSimpleRequestParams& aParams) override;
82 mozilla::ipc::IPCResult RecvPBackgroundLSSimpleRequestConstructor(
83 PBackgroundLSSimpleRequestParent* aActor,
84 const LSSimpleRequestParams& aParams) override;
86 bool DeallocPBackgroundLSSimpleRequestParent(
87 PBackgroundLSSimpleRequestParent* aActor) override;
89 PBackgroundLocalStorageCacheParent* AllocPBackgroundLocalStorageCacheParent(
90 const PrincipalInfo& aPrincipalInfo, const nsACString& aOriginKey,
91 const uint32_t& aPrivateBrowsingId) override;
93 mozilla::ipc::IPCResult RecvPBackgroundLocalStorageCacheConstructor(
94 PBackgroundLocalStorageCacheParent* aActor,
95 const PrincipalInfo& aPrincipalInfo, const nsACString& aOriginKey,
96 const uint32_t& aPrivateBrowsingId) override;
98 bool DeallocPBackgroundLocalStorageCacheParent(
99 PBackgroundLocalStorageCacheParent* aActor) override;
101 PBackgroundStorageParent* AllocPBackgroundStorageParent(
102 const nsAString& aProfilePath,
103 const uint32_t& aPrivateBrowsingId) override;
105 mozilla::ipc::IPCResult RecvPBackgroundStorageConstructor(
106 PBackgroundStorageParent* aActor, const nsAString& aProfilePath,
107 const uint32_t& aPrivateBrowsingId) override;
109 bool DeallocPBackgroundStorageParent(
110 PBackgroundStorageParent* aActor) override;
112 already_AddRefed<PBackgroundSessionStorageManagerParent>
113 AllocPBackgroundSessionStorageManagerParent(
114 const uint64_t& aTopContextId) override;
116 already_AddRefed<PBackgroundSessionStorageServiceParent>
117 AllocPBackgroundSessionStorageServiceParent() override;
119 mozilla::ipc::IPCResult RecvCreateFileSystemManagerParent(
120 const PrincipalInfo& aPrincipalInfo,
121 Endpoint<mozilla::dom::PFileSystemManagerParent>&& aParentEndpoint,
122 CreateFileSystemManagerParentResolver&& aResolver) override;
124 mozilla::ipc::IPCResult RecvCreateWebTransportParent(
125 const nsAString& aURL, nsIPrincipal* aPrincipal,
126 const mozilla::Maybe<IPCClientInfo>& aClientInfo, const bool& aDedicated,
127 const bool& aRequireUnreliable, const uint32_t& aCongestionControl,
128 nsTArray<WebTransportHash>&& aServerCertHashes,
129 Endpoint<PWebTransportParent>&& aParentEndpoint,
130 CreateWebTransportParentResolver&& aResolver) override;
132 mozilla::ipc::IPCResult RecvCreateNotificationParent(
133 Endpoint<dom::notification::PNotificationParent>&& aParentEndpoint,
134 NotNull<nsIPrincipal*> aPrincipal,
135 NotNull<nsIPrincipal*> aEffectiveStoragePrincipal,
136 const bool& aIsSecureContext, const nsAString& aId,
137 const nsAString& aScope, const IPCNotificationOptions& aOptions,
138 CreateNotificationParentResolver&& aResolver) final;
140 already_AddRefed<PIdleSchedulerParent> AllocPIdleSchedulerParent() override;
142 PTemporaryIPCBlobParent* AllocPTemporaryIPCBlobParent() override;
144 mozilla::ipc::IPCResult RecvPTemporaryIPCBlobConstructor(
145 PTemporaryIPCBlobParent* actor) override;
147 bool DeallocPTemporaryIPCBlobParent(PTemporaryIPCBlobParent* aActor) override;
149 PFileCreatorParent* AllocPFileCreatorParent(
150 const nsAString& aFullPath, const nsAString& aType,
151 const nsAString& aName, const Maybe<int64_t>& aLastModified,
152 const bool& aExistenceCheck, const bool& aIsFromNsIFile) override;
154 mozilla::ipc::IPCResult RecvPFileCreatorConstructor(
155 PFileCreatorParent* actor, const nsAString& aFullPath,
156 const nsAString& aType, const nsAString& aName,
157 const Maybe<int64_t>& aLastModified, const bool& aExistenceCheck,
158 const bool& aIsFromNsIFile) override;
160 bool DeallocPFileCreatorParent(PFileCreatorParent* aActor) override;
162 already_AddRefed<mozilla::dom::PRemoteWorkerControllerParent>
163 AllocPRemoteWorkerControllerParent(
164 const mozilla::dom::RemoteWorkerData& aRemoteWorkerData) override;
166 mozilla::ipc::IPCResult RecvPRemoteWorkerControllerConstructor(
167 mozilla::dom::PRemoteWorkerControllerParent* aActor,
168 const mozilla::dom::RemoteWorkerData& aRemoteWorkerData) override;
170 mozilla::dom::PSharedWorkerParent* AllocPSharedWorkerParent(
171 const mozilla::dom::RemoteWorkerData& aData, const uint64_t& aWindowID,
172 const mozilla::dom::MessagePortIdentifier& aPortIdentifier) override;
174 mozilla::ipc::IPCResult RecvPSharedWorkerConstructor(
175 PSharedWorkerParent* aActor, const mozilla::dom::RemoteWorkerData& aData,
176 const uint64_t& aWindowID,
177 const mozilla::dom::MessagePortIdentifier& aPortIdentifier) override;
179 bool DeallocPSharedWorkerParent(PSharedWorkerParent* aActor) override;
181 already_AddRefed<PVsyncParent> AllocPVsyncParent() override;
183 PBroadcastChannelParent* AllocPBroadcastChannelParent(
184 const PrincipalInfo& aPrincipalInfo, const nsACString& aOrigin,
185 const nsAString& aChannel) override;
187 mozilla::ipc::IPCResult RecvPBroadcastChannelConstructor(
188 PBroadcastChannelParent* actor, const PrincipalInfo& aPrincipalInfo,
189 const nsACString& origin, const nsAString& channel) override;
191 bool DeallocPBroadcastChannelParent(PBroadcastChannelParent* aActor) override;
193 virtual PCookieStoreParent* AllocPCookieStoreParent() override;
195 virtual bool DeallocPCookieStoreParent(PCookieStoreParent* aActor) override;
197 PServiceWorkerManagerParent* AllocPServiceWorkerManagerParent() override;
199 bool DeallocPServiceWorkerManagerParent(
200 PServiceWorkerManagerParent* aActor) override;
202 PCamerasParent* AllocPCamerasParent() override;
203 #ifdef MOZ_WEBRTC
204 mozilla::ipc::IPCResult RecvPCamerasConstructor(
205 PCamerasParent* aActor) override;
206 #endif
207 bool DeallocPCamerasParent(PCamerasParent* aActor) override;
209 mozilla::ipc::IPCResult RecvShutdownServiceWorkerRegistrar() override;
211 already_AddRefed<dom::cache::PCacheStorageParent> AllocPCacheStorageParent(
212 const dom::cache::Namespace& aNamespace,
213 const PrincipalInfo& aPrincipalInfo) override;
215 PUDPSocketParent* AllocPUDPSocketParent(const Maybe<PrincipalInfo>& pInfo,
216 const nsACString& aFilter) override;
217 mozilla::ipc::IPCResult RecvPUDPSocketConstructor(
218 PUDPSocketParent*, const Maybe<PrincipalInfo>& aPrincipalInfo,
219 const nsACString& aFilter) override;
220 bool DeallocPUDPSocketParent(PUDPSocketParent*) override;
222 PMessagePortParent* AllocPMessagePortParent(
223 const nsID& aUUID, const nsID& aDestinationUUID,
224 const uint32_t& aSequenceID) override;
226 mozilla::ipc::IPCResult RecvPMessagePortConstructor(
227 PMessagePortParent* aActor, const nsID& aUUID,
228 const nsID& aDestinationUUID, const uint32_t& aSequenceID) override;
230 bool DeallocPMessagePortParent(PMessagePortParent* aActor) override;
232 mozilla::ipc::IPCResult RecvMessagePortForceClose(
233 const nsID& aUUID, const nsID& aDestinationUUID,
234 const uint32_t& aSequenceID) override;
236 already_AddRefed<PQuotaParent> AllocPQuotaParent() override;
238 mozilla::ipc::IPCResult RecvShutdownQuotaManager() override;
240 mozilla::ipc::IPCResult RecvShutdownBackgroundSessionStorageManagers()
241 override;
243 mozilla::ipc::IPCResult RecvPropagateBackgroundSessionStorageManager(
244 const uint64_t& aCurrentTopContextId,
245 const uint64_t& aTargetTopContextId) override;
247 mozilla::ipc::IPCResult RecvRemoveBackgroundSessionStorageManager(
248 const uint64_t& aTopContextId) override;
250 mozilla::ipc::IPCResult RecvLoadSessionStorageManagerData(
251 const uint64_t& aTopContextId,
252 nsTArray<mozilla::dom::SSCacheCopy>&& aOriginCacheCopy) override;
254 mozilla::ipc::IPCResult RecvGetSessionStorageManagerData(
255 const uint64_t& aTopContextId, const uint32_t& aSizeLimit,
256 const bool& aCancelSessionStoreTimer,
257 GetSessionStorageManagerDataResolver&& aResolver) override;
259 already_AddRefed<PFileSystemRequestParent> AllocPFileSystemRequestParent(
260 const FileSystemParams&) override;
262 mozilla::ipc::IPCResult RecvPFileSystemRequestConstructor(
263 PFileSystemRequestParent* actor, const FileSystemParams& params) override;
265 // Gamepad API Background IPC
266 already_AddRefed<PGamepadEventChannelParent> AllocPGamepadEventChannelParent()
267 override;
269 already_AddRefed<PGamepadTestChannelParent> AllocPGamepadTestChannelParent()
270 override;
272 PWebAuthnTransactionParent* AllocPWebAuthnTransactionParent() override;
274 bool DeallocPWebAuthnTransactionParent(
275 PWebAuthnTransactionParent* aActor) override;
277 already_AddRefed<PHttpBackgroundChannelParent>
278 AllocPHttpBackgroundChannelParent(const uint64_t& aChannelId) override;
280 mozilla::ipc::IPCResult RecvPHttpBackgroundChannelConstructor(
281 PHttpBackgroundChannelParent* aActor,
282 const uint64_t& aChannelId) override;
284 already_AddRefed<PClientManagerParent> AllocPClientManagerParent() override;
286 mozilla::ipc::IPCResult RecvPClientManagerConstructor(
287 PClientManagerParent* aActor) override;
289 mozilla::ipc::IPCResult RecvCreateMIDIPort(
290 Endpoint<PMIDIPortParent>&& aEndpoint, const MIDIPortInfo& aPortInfo,
291 const bool& aSysexEnabled) override;
293 mozilla::ipc::IPCResult RecvCreateMIDIManager(
294 Endpoint<PMIDIManagerParent>&& aEndpoint) override;
296 mozilla::ipc::IPCResult RecvHasMIDIDevice(
297 HasMIDIDeviceResolver&& aResolver) override;
299 mozilla::ipc::IPCResult RecvCreateMLSTransaction(
300 Endpoint<PMLSTransactionParent>&& aEndpoint,
301 NotNull<nsIPrincipal*> aPrincipal) override;
303 mozilla::ipc::IPCResult RecvStorageActivity(
304 const PrincipalInfo& aPrincipalInfo) override;
306 already_AddRefed<PServiceWorkerParent> AllocPServiceWorkerParent(
307 const IPCServiceWorkerDescriptor&) final;
309 mozilla::ipc::IPCResult RecvPServiceWorkerManagerConstructor(
310 PServiceWorkerManagerParent* aActor) override;
312 mozilla::ipc::IPCResult RecvPServiceWorkerConstructor(
313 PServiceWorkerParent* aActor,
314 const IPCServiceWorkerDescriptor& aDescriptor) override;
316 already_AddRefed<PServiceWorkerContainerParent>
317 AllocPServiceWorkerContainerParent() final;
319 mozilla::ipc::IPCResult RecvPServiceWorkerContainerConstructor(
320 PServiceWorkerContainerParent* aActor) override;
322 already_AddRefed<PServiceWorkerRegistrationParent>
323 AllocPServiceWorkerRegistrationParent(
324 const IPCServiceWorkerRegistrationDescriptor&,
325 const IPCClientInfo&) final;
327 mozilla::ipc::IPCResult RecvPServiceWorkerRegistrationConstructor(
328 PServiceWorkerRegistrationParent* aActor,
329 const IPCServiceWorkerRegistrationDescriptor& aDescriptor,
330 const IPCClientInfo& aForClient) override;
332 PEndpointForReportParent* AllocPEndpointForReportParent(
333 const nsAString& aGroupName,
334 const PrincipalInfo& aPrincipalInfo) override;
336 mozilla::ipc::IPCResult RecvPEndpointForReportConstructor(
337 PEndpointForReportParent* actor, const nsAString& aGroupName,
338 const PrincipalInfo& aPrincipalInfo) override;
340 mozilla::ipc::IPCResult RecvEnsureRDDProcessAndCreateBridge(
341 EnsureRDDProcessAndCreateBridgeResolver&& aResolver) override;
343 mozilla::ipc::IPCResult RecvEnsureUtilityProcessAndCreateBridge(
344 const RemoteDecodeIn& aLocation,
345 EnsureUtilityProcessAndCreateBridgeResolver&& aResolver) override;
347 mozilla::ipc::IPCResult RecvRequestCameraAccess(
348 const bool& aAllowPermissionRequest,
349 RequestCameraAccessResolver&& aResolver) override;
351 bool DeallocPEndpointForReportParent(
352 PEndpointForReportParent* aActor) override;
354 mozilla::ipc::IPCResult RecvRemoveEndpoint(
355 const nsAString& aGroupName, const nsACString& aEndpointURL,
356 const PrincipalInfo& aPrincipalInfo) override;
358 mozilla::ipc::IPCResult RecvPLockManagerConstructor(
359 PLockManagerParent* actor, mozilla::NotNull<nsIPrincipal*> aPrincipalInfo,
360 const Maybe<nsID>& aClientId) override;
362 already_AddRefed<PLockManagerParent> AllocPLockManagerParent(
363 NotNull<nsIPrincipal*> aPrincipal, const Maybe<nsID>& aClientId) final;
365 already_AddRefed<PFetchParent> AllocPFetchParent() override;
368 } // namespace mozilla::ipc
370 #endif // mozilla_ipc_backgroundparentimpl_h__