diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 70eba703594..d3404ce11d4 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: ft=cpp tw=78 sw=4 et ts=4 + * vim: ft=cpp tw=78 sw=4 et ts=4 sts=4 cin * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 @@ -5565,6 +5565,10 @@ nsDocShell::DoURILoad(nsIURI * aURI, channel->SetOriginalURI(aURI); if (aTypeHint && *aTypeHint) { channel->SetContentType(nsDependentCString(aTypeHint)); + mContentTypeHint = aTypeHint; + } + else { + mContentTypeHint.Truncate(); } //hack @@ -6322,7 +6326,6 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsCOMPtr cacheToken; PRBool expired = PR_FALSE; PRBool discardLayoutState = PR_FALSE; - nsCAutoString contentType; if (aChannel) { nsCOMPtr cacheChannel(do_QueryInterface(aChannel)); @@ -6348,7 +6351,6 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, discardLayoutState = ShouldDiscardLayoutState(httpChannel); } - aChannel->GetContentType(contentType); } //Title is set in nsDocShell::SetTitle() @@ -6358,7 +6360,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, inputStream, // Post data stream nsnull, // LayoutHistory state cacheKey, // CacheKey - contentType); // Content-type + mContentTypeHint); // Content-type entry->SetReferrerURI(referrerURI); /* If cache got a 'no-store', ask SH not to store * HistoryLayoutState. By default, SH will set this diff --git a/mozilla/docshell/base/nsDocShell.h b/mozilla/docshell/base/nsDocShell.h index 1bcab0b6c95..bbc23d1b6c4 100644 --- a/mozilla/docshell/base/nsDocShell.h +++ b/mozilla/docshell/base/nsDocShell.h @@ -384,6 +384,11 @@ protected: nsString mName; nsString mTitle; + /** + * Content-Type Hint of the most-recently initiated load. Used for + * session history entries. + */ + nsCString mContentTypeHint; nsVoidArray mChildren; nsCOMPtr mRefreshURIList; nsDSURIContentListener * mContentListener;