209330 r=jag sr=darin a=shaver

make sure to always check whether an OnStateChange call is needed, instead of
returning early while calling OnProgressChange
This commit is contained in:
cbiesinger%web.de 2005-06-01 19:37:10 +00:00
parent dedd00cfb3
commit ceeb50765a
2 changed files with 6 additions and 13 deletions

View File

@ -127,7 +127,6 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress,
mTotalRequests = 0;
mFinishedRequests = 0;
mUseRealProgressFlag = PR_FALSE;
mIsLoadingDocument = PR_TRUE;
}
if (aStateFlags & STATE_IS_REQUEST) {
++mTotalRequests;
@ -135,21 +134,18 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress,
// if the total requests exceeds 1, then we'll base our progress
// notifications on the percentage of completed requests.
// otherwise, progress for the single request will be reported.
// But if we're not loading a document, we must be sure to deliver
// OnStateChange for STATE_STOP correctly: use the real progress in
// such cases
mUseRealProgressFlag = (mTotalRequests == 1) || !mIsLoadingDocument;
mUseRealProgressFlag = (mTotalRequests == 1);
}
}
else if (aStateFlags & STATE_STOP) {
if (aStateFlags & STATE_IS_NETWORK) {
mIsLoadingDocument = PR_FALSE;
}
if (aStateFlags & STATE_IS_REQUEST) {
++mFinishedRequests;
// Note: Do not return from here. This is necessary so that the
// STATE_STOP can still be relayed to the listener if needed
// (bug 209330)
if (!mUseRealProgressFlag && mTotalRequests)
return OnProgressChange(nsnull, nsnull, 0, 0,
mFinishedRequests, mTotalRequests);
OnProgressChange(nsnull, nsnull, 0, 0,
mFinishedRequests, mTotalRequests);
}
}
else if (aStateFlags & STATE_TRANSFERRING) {

View File

@ -87,9 +87,6 @@ private:
// indicates whether a timeout is pending
PRPackedBool mDelayedStatus;
PRPackedBool mDelayedProgress;
// indicates whether a document is currently loading
PRPackedBool mIsLoadingDocument;
};
#define NS_BROWSERSTATUSFILTER_CLASSNAME \