diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index da3f7611fe4..2cce39a3a55 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -205,15 +205,17 @@ NS_IMETHODIMP nsDocShell::LoadURI(nsIURI* aURI, nsIDocShellLoadInfo* aLoadInfo) nsCOMPtr referrer; PRBool replace = PR_FALSE; + PRBool refresh = PR_FALSE; if(aLoadInfo) { aLoadInfo->GetReferrer(getter_AddRefs(referrer)); aLoadInfo->GetReplaceSessionHistorySlot(&replace); + aLoadInfo->GetRefresh(&refresh); } NS_ENSURE_SUCCESS(InternalLoad(aURI, referrer, nsnull, nsnull, - replace ? loadNormalReplace : loadNormal), NS_ERROR_FAILURE); + replace ? loadNormalReplace : (refresh ? loadRefresh : loadNormal)), NS_ERROR_FAILURE); return NS_OK; } @@ -2643,7 +2645,10 @@ NS_IMETHODIMP nsDocShell::DoURILoad(nsIURI* aURI, nsIURI* aReferrerURI, case loadReloadBypassProxyAndCache: loadAttribs |= nsIChannel::FORCE_RELOAD; break; - case loadNormal: + case loadRefresh: + loadAttribs |= nsIChannel::FORCE_RELOAD; + break; + case loadNormal: // Set cache checking flags if ( mPrefs ) { @@ -2839,6 +2844,7 @@ void nsDocShell::OnNewURI(nsIURI *aURI, nsIChannel *aChannel, loadType aLoadType break; case loadNormal: + case loadRefresh: case loadNormalReplace: case loadLink: break; @@ -3686,13 +3692,20 @@ NS_INTERFACE_MAP_END_THREADSAFE NS_IMETHODIMP_(void) nsRefreshTimer::Notify(nsITimer *aTimer) { - NS_ASSERTION(mDocShell, "DocShell is somehow null"); + NS_ASSERTION(mDocShell, "DocShell is somehow null"); - if(mDocShell) - mDocShell->LoadURI(mURI, nsnull); - /* - * LoadURL(...) will cancel all refresh timers... This causes the Timer and - * its refreshData instance to be released... - */ + if(mDocShell) + { + nsCOMPtr loadInfo; + mDocShell -> CreateLoadInfo (getter_AddRefs (loadInfo)); + + loadInfo -> SetRefresh (PR_TRUE); + mDocShell -> LoadURI(mURI, loadInfo); + } + + /* + * LoadURL(...) will cancel all refresh timers... This causes the Timer and + * its refreshData instance to be released... + */ } diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index cab2e1c71b1..481eeb94c6f 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -180,7 +180,8 @@ protected: loadReloadBypassCache, loadReloadBypassProxy, loadReloadBypassProxyAndCache, - loadLink + loadLink, + loadRefresh } loadType; NS_IMETHOD InternalLoad(nsIURI* aURI, nsIURI* aReferrerURI, diff --git a/docshell/base/nsDocShellLoadInfo.cpp b/docshell/base/nsDocShellLoadInfo.cpp index 24ec755bd8c..898ec72fa31 100644 --- a/docshell/base/nsDocShellLoadInfo.cpp +++ b/docshell/base/nsDocShellLoadInfo.cpp @@ -27,7 +27,8 @@ //*** nsDocShellLoadInfo: Object Management //***************************************************************************** -nsDocShellLoadInfo::nsDocShellLoadInfo() : mReplaceSessionHistorySlot(PR_FALSE) +nsDocShellLoadInfo::nsDocShellLoadInfo() : mReplaceSessionHistorySlot(PR_FALSE), + mRefresh(PR_FALSE) { NS_INIT_REFCNT(); } @@ -81,6 +82,20 @@ NS_IMETHODIMP nsDocShellLoadInfo::SetReplaceSessionHistorySlot(PRBool aReplace) return NS_OK; } +NS_IMETHODIMP nsDocShellLoadInfo::GetRefresh(PRBool* aRefresh) +{ + NS_ENSURE_ARG_POINTER(aRefresh); + + *aRefresh = mRefresh; + return NS_OK; +} + +NS_IMETHODIMP nsDocShellLoadInfo::SetRefresh(PRBool aRefresh) +{ + mRefresh = aRefresh; + return NS_OK; +} + //***************************************************************************** // nsDocShellLoadInfo: Helpers //***************************************************************************** diff --git a/docshell/base/nsDocShellLoadInfo.h b/docshell/base/nsDocShellLoadInfo.h index 607e6c4cb3b..bea0bbded22 100644 --- a/docshell/base/nsDocShellLoadInfo.h +++ b/docshell/base/nsDocShellLoadInfo.h @@ -46,6 +46,7 @@ protected: protected: nsCOMPtr mReferrer; PRBool mReplaceSessionHistorySlot; + PRBool mRefresh; }; #endif /* nsDocShellLoadInfo_h__ */ diff --git a/docshell/base/nsIDocShellLoadInfo.idl b/docshell/base/nsIDocShellLoadInfo.idl index 4dab7222ceb..1048ff64183 100644 --- a/docshell/base/nsIDocShellLoadInfo.idl +++ b/docshell/base/nsIDocShellLoadInfo.idl @@ -43,4 +43,10 @@ interface nsIDocShellLoadInfo : nsISupports adding it to session history. */ attribute boolean replaceSessionHistorySlot; + + /* + an indication that the load will occur as result of Refresh header or + directive + */ + attribute boolean refresh; }; \ No newline at end of file