Download manager. Not part of build. a=asa

This commit is contained in:
blakeross%telocity.com 2002-03-07 00:03:25 +00:00
Родитель 968a245fa4
Коммит 79b92e1df8
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -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;