Bug ? - Remove redundant Docshell destroyed check; r?nika
Checks added in
Bug 369126 and
Bug 94229. There's not a point between
these two checks where a DocShell can be destroyed, and they return 2
different errors. Keeping version of
Bug 369126.
MozReview-Commit-ID: HXUv5VbXEGA
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9189,16 +9189,18 @@ nsDocShell::InternalLoad(nsIURI* aURI,
}
if (!aURI) {
return NS_ERROR_NULL_POINTER;
}
NS_ENSURE_TRUE(IsValidLoadType(aLoadType), NS_ERROR_INVALID_ARG);
+ // If this docshell is being destroyed, we'll run into assertions even if we
+ // have a different window target and are not loading into. Bail early.
NS_ENSURE_TRUE(!mIsBeingDestroyed, NS_ERROR_NOT_AVAILABLE);
rv = EnsureScriptEnvironment();
if (NS_FAILED(rv)) {
return rv;
}
// wyciwyg urls can only be loaded through history. Any normal load of
@@ -9566,24 +9568,16 @@ nsDocShell::InternalLoad(nsIURI* aURI,
}
// Else we ran out of memory, or were a popup and got blocked,
// or something.
return rv;
}
- //
- // Load is being targetted at this docshell so return an error if the
- // docshell is in the process of being destroyed.
- //
- if (mIsBeingDestroyed) {
- return NS_ERROR_FAILURE;
- }
-
NS_ENSURE_STATE(!HasUnloadedParent());
rv = CheckLoadingPermissions();
if (NS_FAILED(rv)) {
return rv;
}
if (mFiredUnloadEvent) {