From 56a61985cf8763197217adc4832adba1a58a42ca Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Thu, 22 Feb 2007 22:11:30 +0000 Subject: [PATCH] bug 371299 add a way to query if meta refreshes are pending for a docshell r+sr=bz git-svn-id: svn://10.0.0.236/trunk@220767 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 15 +++++++++++++++ mozilla/webshell/public/nsIRefreshURI.idl | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 075092ceeaf..d2edf59cfc5 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -4538,6 +4538,21 @@ nsDocShell::CancelRefreshURITimers() return NS_OK; } +NS_IMETHODIMP +nsDocShell::GetRefreshPending(PRBool* _retval) +{ + if (!mRefreshURIList) { + *_retval = PR_FALSE; + return NS_OK; + } + + PRUint32 count; + nsresult rv = mRefreshURIList->Count(&count); + if (NS_SUCCEEDED(rv)) + *_retval = (count != 0); + return rv; +} + NS_IMETHODIMP nsDocShell::SuspendRefreshURIs() { diff --git a/mozilla/webshell/public/nsIRefreshURI.idl b/mozilla/webshell/public/nsIRefreshURI.idl index f8544c60b0d..d163830f35d 100644 --- a/mozilla/webshell/public/nsIRefreshURI.idl +++ b/mozilla/webshell/public/nsIRefreshURI.idl @@ -41,7 +41,7 @@ #include "nsIURI.idl" interface nsIChannel; -[scriptable, uuid(c25b6df0-e4e0-11da-8ad9-0800200c9a66)] +[scriptable, uuid(cb0ad623-6b46-4c09-a473-c1d6ca63d3c7)] interface nsIRefreshURI : nsISupports { /** * Load a uri after waiting for aMillis milliseconds. If the docshell @@ -96,6 +96,11 @@ interface nsIRefreshURI : nsISupports { * Cancels all timer loads. */ void cancelRefreshURITimers(); + + /** + * True when there are pending refreshes, false otherwise. + */ + readonly attribute boolean refreshPending; };