Fix 41269. WIP on 31189. r/a=gagan

This commit is contained in:
ruslan%netscape.com 2000-06-02 21:02:31 +00:00
Родитель 542c738619
Коммит 55053f0abd
5 изменённых файлов: 47 добавлений и 11 удалений

Просмотреть файл

@ -205,15 +205,17 @@ NS_IMETHODIMP nsDocShell::LoadURI(nsIURI* aURI, nsIDocShellLoadInfo* aLoadInfo)
nsCOMPtr<nsIURI> 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<nsIDocShellLoadInfo> 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...
*/
}

Просмотреть файл

@ -180,7 +180,8 @@ protected:
loadReloadBypassCache,
loadReloadBypassProxy,
loadReloadBypassProxyAndCache,
loadLink
loadLink,
loadRefresh
} loadType;
NS_IMETHOD InternalLoad(nsIURI* aURI, nsIURI* aReferrerURI,

Просмотреть файл

@ -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
//*****************************************************************************

Просмотреть файл

@ -46,6 +46,7 @@ protected:
protected:
nsCOMPtr<nsIURI> mReferrer;
PRBool mReplaceSessionHistorySlot;
PRBool mRefresh;
};
#endif /* nsDocShellLoadInfo_h__ */

Просмотреть файл

@ -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;
};