Bug 382081 - Small downloads don't show in download manager when already open. r=mconnor

This commit is contained in:
sdwilsh@shawnwilsher.com 2007-06-05 09:54:40 -07:00
parent 3932303027
commit 075b8daeec

View File

@ -1366,6 +1366,12 @@ nsDownload::OnProgressChange64(nsIWebProgress *aWebProgress,
if (!mRequest)
mRequest = aRequest; // used for pause/resume
if (mDownloadState == nsIDownloadManager::DOWNLOAD_NOTSTARTED) {
nsresult rv = SetState(nsIDownloadManager::DOWNLOAD_DOWNLOADING);
NS_ENSURE_SUCCESS(rv, rv);
mDownloadManager->mObserverService->NotifyObservers(this, "dl-start", nsnull);
}
// filter notifications since they come in so frequently
PRTime now = PR_Now();
PRIntervalTime delta = now - mLastUpdate;
@ -1374,12 +1380,6 @@ nsDownload::OnProgressChange64(nsIWebProgress *aWebProgress,
mLastUpdate = now;
if (mDownloadState == nsIDownloadManager::DOWNLOAD_NOTSTARTED) {
nsresult rv = SetState(nsIDownloadManager::DOWNLOAD_DOWNLOADING);
NS_ENSURE_SUCCESS(rv, rv);
mDownloadManager->mObserverService->NotifyObservers(this, "dl-start", nsnull);
}
// Calculate the speed using the elapsed delta time and bytes downloaded
// during that time for more accuracy.
double elapsedSecs = double(delta) / PR_USEC_PER_SEC;