Bug 1729458 - Part 3: Clean up future client sources during shutdown, r=asuth

Depends on D124800

Differential Revision: https://phabricator.services.mozilla.com/D125248
This commit is contained in:
Nika Layzell 2021-09-14 15:02:59 +00:00
parent 0c06ba67db
commit 8defd39d49

View File

@ -167,6 +167,18 @@ void ClientManagerService::Shutdown() {
CopyableAutoTArray<ClientManagerParent*, 16>(mManagerList)) {
Unused << PClientManagerParent::Send__delete__(actor);
}
// Destroying manager actors should've also destroyed all source actors, so
// the only sources left will be future sources, which need to be aborted.
for (auto& entry : mSourceTable) {
MOZ_RELEASE_ASSERT(entry.GetData().is<FutureClientSourceParent>());
CopyableErrorResult rv;
rv.ThrowInvalidStateError("Client creation aborted.");
entry.GetModifiableData()
->as<FutureClientSourceParent>()
.RejectPromiseIfExists(rv);
}
mSourceTable.Clear();
}
ClientSourceParent* ClientManagerService::MaybeUnwrapAsExistingSource(