Bug 1954597 - Part 6: Succeed ValidatePrincipal during XPCOM shutdown, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D242423
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "mozilla/dom/ProcessIsolation.h"
|
||||
|
||||
#include "mozilla/AppShutdown.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/BrowsingContextGroup.h"
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
@@ -1178,6 +1179,12 @@ bool ValidatePrincipalCouldPotentiallyBeLoadedBy(
|
||||
return aOptions.contains(ValidatePrincipalOptions::AllowSystem);
|
||||
}
|
||||
|
||||
// Performing checks against the remote type requires the IOService and
|
||||
// ThirdPartyService to be available, check we're not late in shutdown.
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::XPCOMShutdownFinal)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We can load a `resource://` URI in any process. This usually comes up due
|
||||
// to pdf.js and the JSON viewer. See bug 1686200.
|
||||
if (aPrincipal->SchemeIs("resource")) {
|
||||
|
||||
Reference in New Issue
Block a user