mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
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:
parent
dedd00cfb3
commit
ceeb50765a
@ -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) {
|
||||
|
@ -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 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user