mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 22:41:02 +00:00
Bug 342375 Resume/Pause can not work in download.
Patch by leon.sha@sun.com. darin: review+
This commit is contained in:
parent
939cd4d9d3
commit
73a492ca4a
@ -1846,6 +1846,7 @@ nsDownload::nsDownload():mDownloadState(nsIDownloadManager::DOWNLOAD_NOTSTARTED)
|
|||||||
mMaxBytes(LL_ZERO),
|
mMaxBytes(LL_ZERO),
|
||||||
mStartTime(LL_ZERO),
|
mStartTime(LL_ZERO),
|
||||||
mLastUpdate(PR_Now() - (PRUint32)gInterval),
|
mLastUpdate(PR_Now() - (PRUint32)gInterval),
|
||||||
|
mPaused(PR_FALSE),
|
||||||
mSpeed(0)
|
mSpeed(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -2353,10 +2354,12 @@ nsDownload::Pause(PRBool aPaused)
|
|||||||
if (mRequest) {
|
if (mRequest) {
|
||||||
if (aPaused) {
|
if (aPaused) {
|
||||||
mRequest->Suspend();
|
mRequest->Suspend();
|
||||||
|
mPaused = PR_TRUE;
|
||||||
mDownloadState = nsIDownloadManager::DOWNLOAD_PAUSED;
|
mDownloadState = nsIDownloadManager::DOWNLOAD_PAUSED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mRequest->Resume();
|
mRequest->Resume();
|
||||||
|
mPaused = PR_FALSE;
|
||||||
mDownloadState = nsIDownloadManager::DOWNLOAD_DOWNLOADING;
|
mDownloadState = nsIDownloadManager::DOWNLOAD_DOWNLOADING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user