From c8e1a406bd97c1b95d34f8b210b2fa6afd77ac26 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 11 Aug 2005 20:14:00 +0000 Subject: [PATCH] fixes bug 301358 "HTTP 'refresh' doesn't load page with bfcache enabled" r=biesi sr=bryner a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@177590 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 17 +++++++++++------ mozilla/docshell/base/nsDocShell.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 1120377cab6..2850dba4fc8 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3164,8 +3164,13 @@ nsDocShell::Stop(PRUint32 aStopFlags) } if (nsIWebNavigation::STOP_NETWORK & aStopFlags) { - // Cancel any timers that were set for this loader. - CancelRefreshURITimers(); + // Suspend any timers that were set for this loader. We'll clear + // them out for good in CreateContentViewer. + if (mRefreshURIList) { + SuspendRefreshURIs(); + mSavedRefreshURIList.swap(mRefreshURIList); + mRefreshURIList = nsnull; + } // XXXbz We could also pass |this| to nsIURILoader::Stop. That will // just call Stop() on us as an nsIDocumentLoader... We need fewer @@ -4879,12 +4884,9 @@ nsDocShell::CaptureState() NS_ENSURE_SUCCESS(rv, rv); // Suspend refresh URIs and save off the timer queue - SuspendRefreshURIs(); - rv = mOSHE->SetRefreshURIList(mRefreshURIList); + rv = mOSHE->SetRefreshURIList(mSavedRefreshURIList); NS_ENSURE_SUCCESS(rv, rv); - mRefreshURIList = nsnull; - // Capture the current content viewer bounds. nsCOMPtr shell; nsDocShell::GetPresShell(getter_AddRefs(shell)); @@ -5183,6 +5185,8 @@ nsDocShell::RestoreFromHistory() } } + mSavedRefreshURIList = nsnull; + // Save off the root view's parent and sibling so that we can insert the // new content viewer's root view at the same position. Also save the // bounds of the root view's widget. @@ -5476,6 +5480,7 @@ nsDocShell::CreateContentViewer(const char *aContentType, NS_ENSURE_SUCCESS(Embed(viewer, "", (nsISupports *) nsnull), NS_ERROR_FAILURE); + mSavedRefreshURIList = nsnull; mSavingOldViewer = PR_FALSE; mEODForCurrentDocument = PR_FALSE; diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index a03a6db77eb..72cdf9be7db 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -564,6 +564,7 @@ protected: */ nsCString mContentTypeHint; nsCOMPtr mRefreshURIList; + nsCOMPtr mSavedRefreshURIList; nsRefPtr mContentListener; nsRect mBounds; // Dimensions of the docshell nsCOMPtr mContentViewer;