Bug 1160098 - XULElement::LoadSrc() should check whether we successfully created a new frameLoader before trying to call SetIsPrerendered() on it r=smaug
authorTim Taubert <ttaubert@mozilla.com>
Thu, 30 Apr 2015 11:50:39 +0200
changeset 241889 b318ff4e610e6355d87fc97a6ad90e7b2f26c94e
parent 241888 98d3519ab098ebb3bb7ed3ceb405812e3d8b75de
child 241890 0d5bddff56b41a9ca7be583101a1b5ea8ca149fb
push id28672
push userryanvm@gmail.com
push dateFri, 01 May 2015 16:57:20 +0000
treeherdermozilla-central@e70555ac58d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1160098
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160098 - XULElement::LoadSrc() should check whether we successfully created a new frameLoader before trying to call SetIsPrerendered() on it r=smaug
dom/xul/nsXULElement.cpp
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1594,23 +1594,23 @@ nsXULElement::LoadSrc()
     }
     nsXULSlots* slots = static_cast<nsXULSlots*>(Slots());
     if (!slots->mFrameLoader) {
         // false as the last parameter so that xul:iframe/browser/editor
         // session history handling works like dynamic html:iframes.
         // Usually xul elements are used in chrome, which doesn't have
         // session history at all.
         slots->mFrameLoader = nsFrameLoader::Create(this, false);
+        NS_ENSURE_TRUE(slots->mFrameLoader, NS_OK);
+
         if (AttrValueIs(kNameSpaceID_None, nsGkAtoms::prerendered,
                         NS_LITERAL_STRING("true"), eIgnoreCase)) {
             nsresult rv = slots->mFrameLoader->SetIsPrerendered();
             NS_ENSURE_SUCCESS(rv,rv);
         }
-
-        NS_ENSURE_TRUE(slots->mFrameLoader, NS_OK);
     }
 
     return slots->mFrameLoader->LoadFrame();
 }
 
 nsresult
 nsXULElement::GetFrameLoader(nsIFrameLoader **aFrameLoader)
 {