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
{
18 BackgroundParentImpl();
19 virtual ~BackgroundParentImpl();
21 void ActorDestroy(ActorDestroyReason aWhy
) override
;
23 PBackgroundTestParent
* AllocPBackgroundTestParent(
24 const nsACString
& aTestArg
) override
;
26 mozilla::ipc::IPCResult
RecvPBackgroundTestConstructor(
27 PBackgroundTestParent
* aActor
, const nsACString
& aTestArg
) override
;
29 bool DeallocPBackgroundTestParent(PBackgroundTestParent
* aActor
) override
;
31 already_AddRefed
<PBackgroundIDBFactoryParent
>
32 AllocPBackgroundIDBFactoryParent(const LoggingInfo
& aLoggingInfo
) override
;
34 already_AddRefed
<net::PBackgroundDataBridgeParent
>
35 AllocPBackgroundDataBridgeParent(const uint64_t& aChannelID
) override
;
37 mozilla::ipc::IPCResult
RecvPBackgroundIDBFactoryConstructor(
38 PBackgroundIDBFactoryParent
* aActor
,
39 const LoggingInfo
& aLoggingInfo
) override
;
41 PBackgroundIndexedDBUtilsParent
* AllocPBackgroundIndexedDBUtilsParent()
44 bool DeallocPBackgroundIndexedDBUtilsParent(
45 PBackgroundIndexedDBUtilsParent
* aActor
) override
;
47 mozilla::ipc::IPCResult
RecvFlushPendingFileDeletions() override
;
49 PBackgroundSDBConnectionParent
* AllocPBackgroundSDBConnectionParent(
50 const PersistenceType
& aPersistenceType
,
51 const PrincipalInfo
& aPrincipalInfo
) override
;
53 mozilla::ipc::IPCResult
RecvPBackgroundSDBConnectionConstructor(
54 PBackgroundSDBConnectionParent
* aActor
,
55 const PersistenceType
& aPersistenceType
,
56 const PrincipalInfo
& aPrincipalInfo
) override
;
58 bool DeallocPBackgroundSDBConnectionParent(
59 PBackgroundSDBConnectionParent
* aActor
) override
;
61 PBackgroundLSDatabaseParent
* AllocPBackgroundLSDatabaseParent(
62 const PrincipalInfo
& aPrincipalInfo
, const uint32_t& aPrivateBrowsingId
,
63 const uint64_t& aDatastoreId
) override
;
65 mozilla::ipc::IPCResult
RecvPBackgroundLSDatabaseConstructor(
66 PBackgroundLSDatabaseParent
* aActor
, const PrincipalInfo
& aPrincipalInfo
,
67 const uint32_t& aPrivateBrowsingId
,
68 const uint64_t& aDatastoreId
) override
;
70 bool DeallocPBackgroundLSDatabaseParent(
71 PBackgroundLSDatabaseParent
* aActor
) override
;
73 PBackgroundLSObserverParent
* AllocPBackgroundLSObserverParent(
74 const uint64_t& aObserverId
) override
;
76 mozilla::ipc::IPCResult
RecvPBackgroundLSObserverConstructor(
77 PBackgroundLSObserverParent
* aActor
,
78 const uint64_t& aObserverId
) override
;
80 bool DeallocPBackgroundLSObserverParent(
81 PBackgroundLSObserverParent
* aActor
) override
;
83 PBackgroundLSRequestParent
* AllocPBackgroundLSRequestParent(
84 const LSRequestParams
& aParams
) override
;
86 mozilla::ipc::IPCResult
RecvPBackgroundLSRequestConstructor(
87 PBackgroundLSRequestParent
* aActor
,
88 const LSRequestParams
& aParams
) override
;
90 bool DeallocPBackgroundLSRequestParent(
91 PBackgroundLSRequestParent
* aActor
) override
;
93 PBackgroundLSSimpleRequestParent
* AllocPBackgroundLSSimpleRequestParent(
94 const LSSimpleRequestParams
& aParams
) override
;
96 mozilla::ipc::IPCResult
RecvPBackgroundLSSimpleRequestConstructor(
97 PBackgroundLSSimpleRequestParent
* aActor
,
98 const LSSimpleRequestParams
& aParams
) override
;
100 bool DeallocPBackgroundLSSimpleRequestParent(
101 PBackgroundLSSimpleRequestParent
* aActor
) override
;
103 mozilla::ipc::IPCResult
RecvLSClearPrivateBrowsing() override
;
105 PBackgroundLocalStorageCacheParent
* AllocPBackgroundLocalStorageCacheParent(
106 const PrincipalInfo
& aPrincipalInfo
, const nsACString
& aOriginKey
,
107 const uint32_t& aPrivateBrowsingId
) override
;
109 mozilla::ipc::IPCResult
RecvPBackgroundLocalStorageCacheConstructor(
110 PBackgroundLocalStorageCacheParent
* aActor
,
111 const PrincipalInfo
& aPrincipalInfo
, const nsACString
& aOriginKey
,
112 const uint32_t& aPrivateBrowsingId
) override
;
114 bool DeallocPBackgroundLocalStorageCacheParent(
115 PBackgroundLocalStorageCacheParent
* aActor
) override
;
117 PBackgroundStorageParent
* AllocPBackgroundStorageParent(
118 const nsAString
& aProfilePath
,
119 const uint32_t& aPrivateBrowsingId
) override
;
121 mozilla::ipc::IPCResult
RecvPBackgroundStorageConstructor(
122 PBackgroundStorageParent
* aActor
, const nsAString
& aProfilePath
,
123 const uint32_t& aPrivateBrowsingId
) override
;
125 bool DeallocPBackgroundStorageParent(
126 PBackgroundStorageParent
* aActor
) override
;
128 already_AddRefed
<PBackgroundSessionStorageManagerParent
>
129 AllocPBackgroundSessionStorageManagerParent(
130 const uint64_t& aTopContextId
) override
;
132 already_AddRefed
<PBackgroundSessionStorageServiceParent
>
133 AllocPBackgroundSessionStorageServiceParent() override
;
135 mozilla::ipc::IPCResult
RecvCreateFileSystemManagerParent(
136 const PrincipalInfo
& aPrincipalInfo
,
137 Endpoint
<mozilla::dom::PFileSystemManagerParent
>&& aParentEndpoint
,
138 CreateFileSystemManagerParentResolver
&& aResolver
) override
;
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 mozilla::dom::PRemoteWorkerParent
* AllocPRemoteWorkerParent(
163 const RemoteWorkerData
& aData
) override
;
165 bool DeallocPRemoteWorkerParent(PRemoteWorkerParent
* aActor
) override
;
167 mozilla::dom::PRemoteWorkerControllerParent
*
168 AllocPRemoteWorkerControllerParent(
169 const mozilla::dom::RemoteWorkerData
& aRemoteWorkerData
) override
;
171 mozilla::ipc::IPCResult
RecvPRemoteWorkerControllerConstructor(
172 mozilla::dom::PRemoteWorkerControllerParent
* aActor
,
173 const mozilla::dom::RemoteWorkerData
& aRemoteWorkerData
) override
;
175 bool DeallocPRemoteWorkerControllerParent(
176 mozilla::dom::PRemoteWorkerControllerParent
* aActor
) override
;
178 mozilla::dom::PRemoteWorkerServiceParent
* AllocPRemoteWorkerServiceParent()
181 mozilla::ipc::IPCResult
RecvPRemoteWorkerServiceConstructor(
182 PRemoteWorkerServiceParent
* aActor
) override
;
184 bool DeallocPRemoteWorkerServiceParent(
185 PRemoteWorkerServiceParent
* aActor
) override
;
187 mozilla::dom::PSharedWorkerParent
* AllocPSharedWorkerParent(
188 const mozilla::dom::RemoteWorkerData
& aData
, const uint64_t& aWindowID
,
189 const mozilla::dom::MessagePortIdentifier
& aPortIdentifier
) override
;
191 mozilla::ipc::IPCResult
RecvPSharedWorkerConstructor(
192 PSharedWorkerParent
* aActor
, const mozilla::dom::RemoteWorkerData
& aData
,
193 const uint64_t& aWindowID
,
194 const mozilla::dom::MessagePortIdentifier
& aPortIdentifier
) override
;
196 bool DeallocPSharedWorkerParent(PSharedWorkerParent
* aActor
) override
;
198 already_AddRefed
<PVsyncParent
> AllocPVsyncParent() override
;
200 already_AddRefed
<mozilla::psm::PVerifySSLServerCertParent
>
201 AllocPVerifySSLServerCertParent(
202 const nsTArray
<ByteArray
>& aPeerCertChain
, const nsACString
& aHostName
,
203 const int32_t& aPort
, const OriginAttributes
& aOriginAttributes
,
204 const Maybe
<ByteArray
>& aStapledOCSPResponse
,
205 const Maybe
<ByteArray
>& aSctsFromTLSExtension
,
206 const Maybe
<DelegatedCredentialInfoArg
>& aDcInfo
,
207 const uint32_t& aProviderFlags
,
208 const uint32_t& aCertVerifierFlags
) override
;
210 mozilla::ipc::IPCResult
RecvPVerifySSLServerCertConstructor(
211 PVerifySSLServerCertParent
* aActor
, nsTArray
<ByteArray
>&& aPeerCertChain
,
212 const nsACString
& aHostName
, const int32_t& aPort
,
213 const OriginAttributes
& aOriginAttributes
,
214 const Maybe
<ByteArray
>& aStapledOCSPResponse
,
215 const Maybe
<ByteArray
>& aSctsFromTLSExtension
,
216 const Maybe
<DelegatedCredentialInfoArg
>& aDcInfo
,
217 const uint32_t& aProviderFlags
,
218 const uint32_t& aCertVerifierFlags
) override
;
220 virtual already_AddRefed
<mozilla::psm::PSelectTLSClientAuthCertParent
>
221 AllocPSelectTLSClientAuthCertParent(
222 const nsACString
& aHostName
, const OriginAttributes
& aOriginAttributes
,
223 const int32_t& aPort
, const uint32_t& aProviderFlags
,
224 const uint32_t& aProviderTlsFlags
, const ByteArray
& aServerCertBytes
,
225 const nsTArray
<ByteArray
>& aCANames
) override
;
226 virtual mozilla::ipc::IPCResult
RecvPSelectTLSClientAuthCertConstructor(
227 PSelectTLSClientAuthCertParent
* actor
, const nsACString
& aHostName
,
228 const OriginAttributes
& aOriginAttributes
, const int32_t& aPort
,
229 const uint32_t& aProviderFlags
, const uint32_t& aProviderTlsFlags
,
230 const ByteArray
& aServerCertBytes
,
231 nsTArray
<ByteArray
>&& aCANames
) override
;
233 PBroadcastChannelParent
* AllocPBroadcastChannelParent(
234 const PrincipalInfo
& aPrincipalInfo
, const nsACString
& aOrigin
,
235 const nsAString
& aChannel
) override
;
237 mozilla::ipc::IPCResult
RecvPBroadcastChannelConstructor(
238 PBroadcastChannelParent
* actor
, const PrincipalInfo
& aPrincipalInfo
,
239 const nsACString
& origin
, const nsAString
& channel
) override
;
241 bool DeallocPBroadcastChannelParent(PBroadcastChannelParent
* aActor
) override
;
243 PServiceWorkerManagerParent
* AllocPServiceWorkerManagerParent() override
;
245 bool DeallocPServiceWorkerManagerParent(
246 PServiceWorkerManagerParent
* aActor
) override
;
248 PCamerasParent
* AllocPCamerasParent() override
;
250 mozilla::ipc::IPCResult
RecvPCamerasConstructor(
251 PCamerasParent
* aActor
) override
;
253 bool DeallocPCamerasParent(PCamerasParent
* aActor
) override
;
255 mozilla::ipc::IPCResult
RecvShutdownServiceWorkerRegistrar() override
;
257 already_AddRefed
<dom::cache::PCacheStorageParent
> AllocPCacheStorageParent(
258 const dom::cache::Namespace
& aNamespace
,
259 const PrincipalInfo
& aPrincipalInfo
) override
;
261 PUDPSocketParent
* AllocPUDPSocketParent(const Maybe
<PrincipalInfo
>& pInfo
,
262 const nsACString
& aFilter
) override
;
263 mozilla::ipc::IPCResult
RecvPUDPSocketConstructor(
264 PUDPSocketParent
*, const Maybe
<PrincipalInfo
>& aPrincipalInfo
,
265 const nsACString
& aFilter
) override
;
266 bool DeallocPUDPSocketParent(PUDPSocketParent
*) override
;
268 PMessagePortParent
* AllocPMessagePortParent(
269 const nsID
& aUUID
, const nsID
& aDestinationUUID
,
270 const uint32_t& aSequenceID
) override
;
272 mozilla::ipc::IPCResult
RecvPMessagePortConstructor(
273 PMessagePortParent
* aActor
, const nsID
& aUUID
,
274 const nsID
& aDestinationUUID
, const uint32_t& aSequenceID
) override
;
276 already_AddRefed
<PIPCClientCertsParent
> AllocPIPCClientCertsParent() override
;
278 bool DeallocPMessagePortParent(PMessagePortParent
* aActor
) override
;
280 mozilla::ipc::IPCResult
RecvMessagePortForceClose(
281 const nsID
& aUUID
, const nsID
& aDestinationUUID
,
282 const uint32_t& aSequenceID
) override
;
284 PQuotaParent
* AllocPQuotaParent() override
;
286 bool DeallocPQuotaParent(PQuotaParent
* aActor
) override
;
288 mozilla::ipc::IPCResult
RecvShutdownQuotaManager() override
;
290 mozilla::ipc::IPCResult
RecvShutdownBackgroundSessionStorageManagers()
293 mozilla::ipc::IPCResult
RecvPropagateBackgroundSessionStorageManager(
294 const uint64_t& aCurrentTopContextId
,
295 const uint64_t& aTargetTopContextId
) override
;
297 mozilla::ipc::IPCResult
RecvRemoveBackgroundSessionStorageManager(
298 const uint64_t& aTopContextId
) override
;
300 mozilla::ipc::IPCResult
RecvLoadSessionStorageManagerData(
301 const uint64_t& aTopContextId
,
302 nsTArray
<mozilla::dom::SSCacheCopy
>&& aOriginCacheCopy
) override
;
304 mozilla::ipc::IPCResult
RecvGetSessionStorageManagerData(
305 const uint64_t& aTopContextId
, const uint32_t& aSizeLimit
,
306 const bool& aCancelSessionStoreTimer
,
307 GetSessionStorageManagerDataResolver
&& aResolver
) override
;
309 already_AddRefed
<PFileSystemRequestParent
> AllocPFileSystemRequestParent(
310 const FileSystemParams
&) override
;
312 mozilla::ipc::IPCResult
RecvPFileSystemRequestConstructor(
313 PFileSystemRequestParent
* actor
, const FileSystemParams
& params
) override
;
315 // Gamepad API Background IPC
316 already_AddRefed
<PGamepadEventChannelParent
> AllocPGamepadEventChannelParent()
319 already_AddRefed
<PGamepadTestChannelParent
> AllocPGamepadTestChannelParent()
322 PWebAuthnTransactionParent
* AllocPWebAuthnTransactionParent() override
;
324 bool DeallocPWebAuthnTransactionParent(
325 PWebAuthnTransactionParent
* aActor
) override
;
327 already_AddRefed
<PHttpBackgroundChannelParent
>
328 AllocPHttpBackgroundChannelParent(const uint64_t& aChannelId
) override
;
330 mozilla::ipc::IPCResult
RecvPHttpBackgroundChannelConstructor(
331 PHttpBackgroundChannelParent
* aActor
,
332 const uint64_t& aChannelId
) override
;
334 PClientManagerParent
* AllocPClientManagerParent() override
;
336 bool DeallocPClientManagerParent(PClientManagerParent
* aActor
) override
;
338 mozilla::ipc::IPCResult
RecvPClientManagerConstructor(
339 PClientManagerParent
* aActor
) override
;
341 PMIDIPortParent
* AllocPMIDIPortParent(const MIDIPortInfo
& aPortInfo
,
342 const bool& aSysexEnabled
) override
;
344 bool DeallocPMIDIPortParent(PMIDIPortParent
* aActor
) override
;
346 PMIDIManagerParent
* AllocPMIDIManagerParent() override
;
348 bool DeallocPMIDIManagerParent(PMIDIManagerParent
* aActor
) override
;
350 mozilla::ipc::IPCResult
RecvHasMIDIDevice(
351 HasMIDIDeviceResolver
&& aResolver
) override
;
353 mozilla::ipc::IPCResult
RecvStorageActivity(
354 const PrincipalInfo
& aPrincipalInfo
) override
;
356 already_AddRefed
<PServiceWorkerParent
> AllocPServiceWorkerParent(
357 const IPCServiceWorkerDescriptor
&) final
;
359 mozilla::ipc::IPCResult
RecvPServiceWorkerManagerConstructor(
360 PServiceWorkerManagerParent
* aActor
) override
;
362 mozilla::ipc::IPCResult
RecvPServiceWorkerConstructor(
363 PServiceWorkerParent
* aActor
,
364 const IPCServiceWorkerDescriptor
& aDescriptor
) override
;
366 already_AddRefed
<PServiceWorkerContainerParent
>
367 AllocPServiceWorkerContainerParent() final
;
369 mozilla::ipc::IPCResult
RecvPServiceWorkerContainerConstructor(
370 PServiceWorkerContainerParent
* aActor
) override
;
372 already_AddRefed
<PServiceWorkerRegistrationParent
>
373 AllocPServiceWorkerRegistrationParent(
374 const IPCServiceWorkerRegistrationDescriptor
&) final
;
376 mozilla::ipc::IPCResult
RecvPServiceWorkerRegistrationConstructor(
377 PServiceWorkerRegistrationParent
* aActor
,
378 const IPCServiceWorkerRegistrationDescriptor
& aDescriptor
) override
;
380 PEndpointForReportParent
* AllocPEndpointForReportParent(
381 const nsAString
& aGroupName
,
382 const PrincipalInfo
& aPrincipalInfo
) override
;
384 mozilla::ipc::IPCResult
RecvPEndpointForReportConstructor(
385 PEndpointForReportParent
* actor
, const nsAString
& aGroupName
,
386 const PrincipalInfo
& aPrincipalInfo
) override
;
388 mozilla::ipc::IPCResult
RecvEnsureRDDProcessAndCreateBridge(
389 EnsureRDDProcessAndCreateBridgeResolver
&& aResolver
) override
;
391 mozilla::ipc::IPCResult
RecvEnsureUtilityProcessAndCreateBridge(
392 const RemoteDecodeIn
& aLocation
,
393 EnsureUtilityProcessAndCreateBridgeResolver
&& aResolver
) override
;
395 bool DeallocPEndpointForReportParent(
396 PEndpointForReportParent
* aActor
) override
;
398 mozilla::ipc::IPCResult
RecvRemoveEndpoint(
399 const nsAString
& aGroupName
, const nsACString
& aEndpointURL
,
400 const PrincipalInfo
& aPrincipalInfo
) override
;
402 dom::PMediaTransportParent
* AllocPMediaTransportParent() override
;
403 bool DeallocPMediaTransportParent(
404 dom::PMediaTransportParent
* aActor
) override
;
406 already_AddRefed
<mozilla::net::PWebSocketConnectionParent
>
407 AllocPWebSocketConnectionParent(const uint32_t& aListenerId
) override
;
408 mozilla::ipc::IPCResult
RecvPWebSocketConnectionConstructor(
409 PWebSocketConnectionParent
* actor
, const uint32_t& aListenerId
) override
;
411 already_AddRefed
<PLockManagerParent
> AllocPLockManagerParent(
412 const ContentPrincipalInfo
& aPrincipalInfo
, const nsID
& aClientId
) final
;
415 } // namespace mozilla::ipc
417 #endif // mozilla_ipc_backgroundparentimpl_h__