Issue #2452 - Declare the NS_ERROR_DOCSHELL_DYING error

From https://bugzilla.mozilla.org/show_bug.cgi?id=1337537
This commit is contained in:
Martok 2024-01-14 21:48:08 +01:00 committed by roytam1
commit 728b8ad60b
3 changed files with 10 additions and 1 deletions

View file

@ -136,7 +136,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
mExistingJPEGRequest = baseChannel;
}
if (rv == NS_ERROR_REMOTE_XUL) {
if (rv == NS_ERROR_REMOTE_XUL || rv == NS_ERROR_DOCSHELL_DYING) {
aRequest->Cancel(rv);
*aAbortProcess = true;
return NS_OK;

View file

@ -9040,6 +9040,12 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
{
*aContentHandler = nullptr;
if (!mTreeOwner) {
// If we don't have a tree owner, then we're in the process of being
// destroyed. Rather than continue trying to load something, just give up.
return NS_ERROR_DOCSHELL_DYING;
}
// Can we check the content type of the current content viewer
// and reuse it without destroying it and re-creating it?

View file

@ -247,6 +247,9 @@
ERROR(NS_ERROR_REMOTE_XUL, FAILURE(75)),
/* The request resulted in an error page being displayed. */
ERROR(NS_ERROR_LOAD_SHOWED_ERRORPAGE, FAILURE(77)),
/* The request occurred in docshell that lacks a treeowner, so it is
* probably in the process of being torn down. */
ERROR(NS_ERROR_DOCSHELL_DYING, FAILURE(78)),
/* FTP specific error codes: */