Bug 664463 - Don't load anything to frameloader if it isn't in the docshell tree anymore, r=bz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 15 Jun 2011 23:21:32 +0300
changeset 71660 cab0115bbc48da3322890161779addd6cb28ab6e
parent 71659 274e2d2a93a8f53596951833e17a1ec5bba95992
child 71661 02a14a8abac321915ae6e142bdb33111028117d7
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs664463
milestone7.0a1
first release with
nightly linux32
cab0115bbc48 / 7.0a1 / 20110616030822 / files
nightly linux64
cab0115bbc48 / 7.0a1 / 20110616030822 / files
nightly mac
cab0115bbc48 / 7.0a1 / 20110616030822 / files
nightly win32
cab0115bbc48 / 7.0a1 / 20110616030822 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 664463 - Don't load anything to frameloader if it isn't in the docshell tree anymore, r=bz
content/base/src/nsFrameLoader.cpp
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -1400,16 +1400,17 @@ nsFrameLoader::MaybeCreateDocShell()
     // Don't allow subframe loads in external reference documents, nor
     // in non-active documents.
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsCOMPtr<nsISupports> container =
     doc->GetContainer();
   nsCOMPtr<nsIWebNavigation> parentAsWebNav = do_QueryInterface(container);
+  NS_ENSURE_STATE(parentAsWebNav);
 
   // Create the docshell...
   mDocShell = do_CreateInstance("@mozilla.org/docshell;1");
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
 
   if (!mNetworkCreated) {
     nsCOMPtr<nsIDocShellHistory> history = do_QueryInterface(mDocShell);
     if (history) {
@@ -1452,16 +1453,17 @@ nsFrameLoader::MaybeCreateDocShell()
 
     PRInt32 parentType;
     parentAsItem->GetItemType(&parentType);
 
     // XXXbz why is this in content code, exactly?  We should handle
     // this some other way.....  Not sure how yet.
     nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
     parentAsItem->GetTreeOwner(getter_AddRefs(parentTreeOwner));
+    NS_ENSURE_STATE(parentTreeOwner);
     mIsTopLevelContent =
       AddTreeItemToTreeOwner(docShellAsItem, mOwnerContent, parentTreeOwner,
                              parentType, parentAsNode);
 
     // Make sure all shells have links back to the content element
     // in the nearest enclosing chrome shell.
     nsCOMPtr<nsIDOMEventTarget> chromeEventHandler;