зеркало из https://github.com/mozilla/pjs.git
209330 Use the real progress when no document is loading, to ensure that state
changes are sent when necessary r=darin sr=jst a=brendan
This commit is contained in:
Родитель
d940f877c4
Коммит
e5d73d5ca5
|
@ -127,6 +127,7 @@ nsBrowserStatusFilter::OnStateChange(nsIWebProgress *aWebProgress,
|
|||
mTotalRequests = 0;
|
||||
mFinishedRequests = 0;
|
||||
mUseRealProgressFlag = PR_FALSE;
|
||||
mIsLoadingDocument = PR_TRUE;
|
||||
}
|
||||
if (aStateFlags & STATE_IS_REQUEST) {
|
||||
++mTotalRequests;
|
||||
|
@ -134,10 +135,16 @@ 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.
|
||||
mUseRealProgressFlag = (mTotalRequests == 1);
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
else if (aStateFlags & STATE_STOP) {
|
||||
if (aStateFlags & STATE_IS_NETWORK) {
|
||||
mIsLoadingDocument = PR_FALSE;
|
||||
}
|
||||
if (aStateFlags & STATE_IS_REQUEST) {
|
||||
++mFinishedRequests;
|
||||
if (!mUseRealProgressFlag && mTotalRequests)
|
||||
|
|
|
@ -87,6 +87,9 @@ private:
|
|||
// indicates whether a timeout is pending
|
||||
PRPackedBool mDelayedStatus;
|
||||
PRPackedBool mDelayedProgress;
|
||||
|
||||
// indicates whether a document is currently loading
|
||||
PRPackedBool mIsLoadingDocument;
|
||||
};
|
||||
|
||||
#define NS_BROWSERSTATUSFILTER_CLASSNAME \
|
||||
|
|
Загрузка…
Ссылка в новой задаче