Bug 1443925 - Part 1: Support running GetBlobURLPrincipal off-main-thread, r=asuth

This method isn't actually safe to run off-main-thread yet, as nsIPrincipal
manipulation isn't being made threadsafe until a later part, however it can be
called off-main-thread when creating a new content principal with a Blob URL
spec.

Differential Revision: https://phabricator.services.mozilla.com/D163031
This commit is contained in:
Nika Layzell 2022-12-02 00:53:49 +00:00
parent 2a8b178ca4
commit bf9f3c01b4

View File

@ -881,8 +881,7 @@ bool BlobURLProtocolHandler::GetBlobURLPrincipal(nsIURI* aURI,
return false;
}
MOZ_ASSERT(NS_IsMainThread(),
"without locking gDataTable is main-thread only");
StaticMutexAutoLock lock(sMutex);
mozilla::dom::DataInfo* info =
GetDataInfoFromURI(aURI, true /*aAlsoIfRevoked */);
if (!info || info->mObjectType != mozilla::dom::DataInfo::eBlobImpl ||