Bug 1320765 - Test mRemoteBrowser to avoid crash during swapping frame loaders. r=mystor
MozReview-Commit-ID: 9Ypk1FmdjUU
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -1267,16 +1267,20 @@ nsFrameLoader::SwapWithOtherRemoteLoader
}
nsIPresShell* ourShell = ourDoc->GetShell();
nsIPresShell* otherShell = otherDoc->GetShell();
if (!ourShell || !otherShell) {
return NS_ERROR_NOT_IMPLEMENTED;
}
+ if (!mRemoteBrowser || !aOther->mRemoteBrowser) {
+ return NS_ERROR_NOT_IMPLEMENTED;
+ }
+
if (mRemoteBrowser->IsIsolatedMozBrowserElement() !=
aOther->mRemoteBrowser->IsIsolatedMozBrowserElement()) {
return NS_ERROR_NOT_IMPLEMENTED;
}
// When we swap docShells, maybe we have to deal with a new page created just
// for this operation. In this case, the browser code should already have set
// the correct userContextId attribute value in the owning XULElement, but our