Bug 1840182 - Do not create new XHR channel during shutdown r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D213018
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#ifndef XP_WIN
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include "mozilla/AppShutdown.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
@@ -1558,6 +1559,11 @@ void XMLHttpRequestMainThread::Open(const nsACString& aMethod,
|
||||
return;
|
||||
}
|
||||
|
||||
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
|
||||
aRv.Throw(NS_ERROR_ILLEGAL_DURING_SHUTDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
// Gecko-specific
|
||||
if (!aAsync && responsibleDocument && GetOwner()) {
|
||||
// We have no extant document during unload, so the above general
|
||||
|
||||
Reference in New Issue
Block a user