Trying to land bug 462517, r=biesi, sr=roc, a=dveditz

git-svn-id: svn://10.0.0.236/trunk@256555 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Olli.Pettay%helsinki.fi
2009-03-17 17:02:10 +00:00
parent a6e8c8acb2
commit 49de28c180

View File

@@ -99,12 +99,12 @@ public:
// This stores both the content and the frame so that Instantiate calls can be
// avoided if the frame changed in the meantime.
nsObjectLoadingContent *mContent;
nsIObjectFrame* mFrame;
nsWeakFrame mFrame;
nsCString mContentType;
nsCOMPtr<nsIURI> mURI;
nsAsyncInstantiateEvent(nsObjectLoadingContent* aContent,
nsIObjectFrame* aFrame,
nsIFrame* aFrame,
const nsCString& aType,
nsIURI* aURI)
: mContent(aContent), mFrame(aFrame), mContentType(aType), mURI(aURI)
@@ -134,7 +134,7 @@ nsAsyncInstantiateEvent::Run()
// Also make sure that we still refer to the same data.
nsIObjectFrame* frame = mContent->
GetExistingFrame(nsObjectLoadingContent::eFlushContent);
if (frame == mFrame &&
if (mFrame.IsAlive() &&
mContent->mURI == mURI &&
mContent->mContentType.Equals(mContentType)) {
if (LOG_ENABLED()) {
@@ -790,8 +790,10 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
return NS_OK;
}
nsIFrame* frame = nsnull;
CallQueryInterface(aFrame, &frame);
nsCOMPtr<nsIRunnable> event =
new nsAsyncInstantiateEvent(this, aFrame, mContentType, mURI);
new nsAsyncInstantiateEvent(this, frame, mContentType, mURI);
if (!event) {
return NS_ERROR_OUT_OF_MEMORY;
}