Bug 1591877 - Forbid creation of PBackgroundLSRequest/PBackgroundLSSimpleRequest actors in the parent process if LSNG is not enabled; r=dom-storage-reviewers,jstutte

Differential Revision: https://phabricator.services.mozilla.com/D119710
This commit is contained in:
Jan Varga 2021-07-13 11:16:00 +00:00
parent 1fbcf183f9
commit ed1318cf0a

View File

@ -3282,6 +3282,10 @@ PBackgroundLSRequestParent* AllocPBackgroundLSRequestParent(
AssertIsOnBackgroundThread();
MOZ_ASSERT(aParams.type() != LSRequestParams::T__None);
if (NS_WARN_IF(!NextGenLocalStorageEnabled())) {
return nullptr;
}
if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread())) {
return nullptr;
}
@ -3334,6 +3338,7 @@ bool RecvPBackgroundLSRequestConstructor(PBackgroundLSRequestParent* aActor,
AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor);
MOZ_ASSERT(aParams.type() != LSRequestParams::T__None);
MOZ_ASSERT(NextGenLocalStorageEnabled());
MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
// The actor is now completely built.
@ -3360,6 +3365,10 @@ PBackgroundLSSimpleRequestParent* AllocPBackgroundLSSimpleRequestParent(
AssertIsOnBackgroundThread();
MOZ_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
if (NS_WARN_IF(!NextGenLocalStorageEnabled())) {
return nullptr;
}
if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread())) {
return nullptr;
}
@ -3397,6 +3406,7 @@ bool RecvPBackgroundLSSimpleRequestConstructor(
AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor);
MOZ_ASSERT(aParams.type() != LSSimpleRequestParams::T__None);
MOZ_ASSERT(NextGenLocalStorageEnabled());
MOZ_ASSERT(!QuotaClient::IsShuttingDownOnBackgroundThread());
// The actor is now completely built.