Bug 342375 Resume/Pause can not work in download.

Patch by leon.sha@sun.com.
darin: review+
This commit is contained in:
leon.sha%sun.com 2006-06-23 05:36:05 +00:00
parent 939cd4d9d3
commit 73a492ca4a

View File

@ -1846,6 +1846,7 @@ nsDownload::nsDownload():mDownloadState(nsIDownloadManager::DOWNLOAD_NOTSTARTED)
mMaxBytes(LL_ZERO),
mStartTime(LL_ZERO),
mLastUpdate(PR_Now() - (PRUint32)gInterval),
mPaused(PR_FALSE),
mSpeed(0)
{
}
@ -2353,10 +2354,12 @@ nsDownload::Pause(PRBool aPaused)
if (mRequest) {
if (aPaused) {
mRequest->Suspend();
mPaused = PR_TRUE;
mDownloadState = nsIDownloadManager::DOWNLOAD_PAUSED;
}
else {
mRequest->Resume();
mPaused = PR_FALSE;
mDownloadState = nsIDownloadManager::DOWNLOAD_DOWNLOADING;
}
}