зеркало из https://github.com/mozilla/gecko-dev.git
Download manager. Not part of build. a=asa
This commit is contained in:
Родитель
968a245fa4
Коммит
79b92e1df8
|
@ -853,6 +853,7 @@ nsDownload::GetTransferInformation(PRInt32* aCurr, PRInt32* aMax)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// nsIWebProgressListener
|
||||
|
||||
PRInt32 i = 0;
|
||||
NS_IMETHODIMP
|
||||
nsDownload::OnProgressChange(nsIWebProgress *aWebProgress,
|
||||
nsIRequest *aRequest,
|
||||
|
@ -867,11 +868,12 @@ nsDownload::OnProgressChange(nsIWebProgress *aWebProgress,
|
|||
|
||||
// filter notifications since they come in so frequently
|
||||
PRTime delta;
|
||||
LL_SUB(delta, PR_Now(), mLastUpdate);
|
||||
if (delta < INTERVAL && aMaxTotalProgress != -1 && aCurTotalProgress < aMaxTotalProgress)
|
||||
PRTime now = PR_Now();
|
||||
LL_SUB(delta, now, mLastUpdate);
|
||||
if (LL_CMP(delta, <, INTERVAL) && aMaxTotalProgress != -1 && aCurTotalProgress < aMaxTotalProgress)
|
||||
return NS_OK;
|
||||
|
||||
mLastUpdate = PR_Now();
|
||||
mLastUpdate = now;
|
||||
|
||||
if (mDownloadState == NOTSTARTED) {
|
||||
char* persistentDescriptor;
|
||||
|
|
|
@ -84,8 +84,9 @@ nsDownloadProgressListener.prototype = {
|
|||
// Get current time.
|
||||
var now = ( new Date() ).getTime();
|
||||
// If interval hasn't elapsed, ignore it.
|
||||
if ( now - this.lastUpdate < interval && aMaxTotalProgress != "-1" && parseInt(aCurTotalProgress) < parseInt(aMaxTotalProgress) )
|
||||
if ( now - this.lastUpdate < interval && aMaxTotalProgress != "-1" && parseInt(aCurTotalProgress) < parseInt(aMaxTotalProgress) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update this time.
|
||||
this.lastUpdate = now;
|
||||
|
|
Загрузка…
Ссылка в новой задаче