mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 436990. Make sure to remove already-fired timers from our refresh URI list. r+sr=jst
This commit is contained in:
parent
a9d090b456
commit
9e228136ee
21
docshell/base/crashtests/436900-1-inner.html
Normal file
21
docshell/base/crashtests/436900-1-inner.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="refresh" content="0">
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
location.hash += "+++";
|
||||
|
||||
function done()
|
||||
{
|
||||
parent.document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(done, 10)">
|
||||
|
||||
</body>
|
||||
</html>
|
8
docshell/base/crashtests/436900-1.html
Normal file
8
docshell/base/crashtests/436900-1.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="436900-1-inner.html#foo"></iframe>
|
||||
</body>
|
||||
</html>
|
@ -1,2 +1,3 @@
|
||||
load 369126-1.html
|
||||
load 403574-1.xhtml
|
||||
load 436900-1.html
|
||||
|
@ -4435,6 +4435,31 @@ nsDocShell::RefreshURI(nsIURI * aURI, PRInt32 aDelay, PRBool aRepeat,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDocShell::ForceRefreshURIFromTimer(nsIURI * aURI,
|
||||
PRInt32 aDelay,
|
||||
PRBool aMetaRefresh,
|
||||
nsITimer* aTimer)
|
||||
{
|
||||
NS_PRECONDITION(aTimer, "Must have a timer here");
|
||||
|
||||
// Remove aTimer from mRefreshURIList if needed
|
||||
if (mRefreshURIList) {
|
||||
PRUint32 n = 0;
|
||||
mRefreshURIList->Count(&n);
|
||||
|
||||
for (PRUint32 i = 0; i < n; ++i) {
|
||||
nsCOMPtr<nsITimer> timer = do_QueryElementAt(mRefreshURIList, i);
|
||||
if (timer == aTimer) {
|
||||
mRefreshURIList->RemoveElementAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ForceRefreshURI(aURI, aDelay, aMetaRefresh);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::ForceRefreshURI(nsIURI * aURI,
|
||||
PRInt32 aDelay,
|
||||
@ -9303,9 +9328,7 @@ nsRefreshTimer::Notify(nsITimer * aTimer)
|
||||
// Get the delay count to determine load type
|
||||
PRUint32 delay = 0;
|
||||
aTimer->GetDelay(&delay);
|
||||
nsCOMPtr<nsIRefreshURI> refreshURI = do_QueryInterface(mDocShell);
|
||||
if (refreshURI)
|
||||
refreshURI->ForceRefreshURI(mURI, delay, mMetaRefresh);
|
||||
mDocShell->ForceRefreshURIFromTimer(mURI, delay, mMetaRefresh, aTimer);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -109,6 +109,7 @@
|
||||
#include "nsIChannelClassifier.h"
|
||||
|
||||
class nsIScrollableView;
|
||||
class nsDocShell;
|
||||
|
||||
/* load commands were moved to nsIDocShell.h */
|
||||
/* load types were moved to nsDocShellLoadTypes.h */
|
||||
@ -133,7 +134,7 @@ public:
|
||||
|
||||
PRInt32 GetDelay() { return mDelay ;}
|
||||
|
||||
nsCOMPtr<nsIDocShell> mDocShell;
|
||||
nsRefPtr<nsDocShell> mDocShell;
|
||||
nsCOMPtr<nsIURI> mURI;
|
||||
PRInt32 mDelay;
|
||||
PRPackedBool mRepeat;
|
||||
@ -235,6 +236,13 @@ public:
|
||||
// subframes. It then simulates the completion of the toplevel load.
|
||||
nsresult RestoreFromHistory();
|
||||
|
||||
// Perform a URI load from a refresh timer. This is just like the
|
||||
// ForceRefreshURI method on nsIRefreshURI, but makes sure to take
|
||||
// the timer involved out of mRefreshURIList if it's there.
|
||||
// aTimer must not be null.
|
||||
nsresult ForceRefreshURIFromTimer(nsIURI * aURI, PRInt32 aDelay,
|
||||
PRBool aMetaRefresh, nsITimer* aTimer);
|
||||
|
||||
protected:
|
||||
// Object Management
|
||||
virtual ~nsDocShell();
|
||||
|
Loading…
Reference in New Issue
Block a user