Bug 622480, no need to save old presentation always, r=bz, a=blocking

--HG--
extra : rebase_source : 3d1453d72509e89b2929de49702dcd6dc6e94f81
This commit is contained in:
Olli Pettay 2011-01-18 21:55:04 +02:00
parent 2d11d98ae1
commit df3448dcd1
2 changed files with 10 additions and 4 deletions

View File

@ -6448,7 +6448,8 @@ nsDocShell::EnsureContentViewer()
nsresult
nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
nsIURI* aBaseURI)
nsIURI* aBaseURI,
PRBool aTryToSaveOldPresentation)
{
nsCOMPtr<nsIDocument> blankDoc;
nsCOMPtr<nsIContentViewer> viewer;
@ -6480,7 +6481,8 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
return NS_ERROR_FAILURE;
}
mSavingOldViewer = CanSavePresentation(LOAD_NORMAL, nsnull, nsnull);
mSavingOldViewer = aTryToSaveOldPresentation &&
CanSavePresentation(LOAD_NORMAL, nsnull, nsnull);
// Make sure to blow away our mLoadingURI just in case. No loads
// from inside this pagehide.
@ -9992,7 +9994,10 @@ nsDocShell::LoadHistoryEntry(nsISHEntry * aEntry, PRUint32 aLoadType)
// anything from the current document from leaking into any JavaScript
// code in the URL.
nsCOMPtr<nsIPrincipal> prin = do_QueryInterface(owner);
rv = CreateAboutBlankContentViewer(prin, nsnull);
// Don't cache the presentation if we're going to just reload the
// current entry. Caching would lead to trying to save the different
// content viewers in the same nsISHEntry object.
rv = CreateAboutBlankContentViewer(prin, nsnull, aEntry != mOSHE);
if (NS_FAILED(rv)) {
// The creation of the intermittent about:blank content

View File

@ -288,7 +288,8 @@ protected:
// aPrincipal can be passed in if the caller wants. If null is
// passed in, the about:blank principal will end up being used.
nsresult CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
nsIURI* aBaseURI);
nsIURI* aBaseURI,
PRBool aTryToSaveOldPresentation = PR_TRUE);
NS_IMETHOD CreateContentViewer(const char * aContentType,
nsIRequest * request, nsIStreamListener ** aContentHandler);
NS_IMETHOD NewContentViewerObj(const char * aContentType,