mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Bug 382081 - Small downloads don't show in download manager when already open. r=mconnor
This commit is contained in:
parent
3932303027
commit
075b8daeec
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user