mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 20:25:44 +00:00
Bug 398197 - Canceled queued downloads come from Wed, Dec 31, 1969 6:00 PM. r=sdwilsh, a=mconnor
This commit is contained in:
parent
8b8d2e52fe
commit
5fa5ae2c4a
@ -1140,7 +1140,7 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType,
|
||||
targetFile->GetLeafName(dl->mDisplayName);
|
||||
|
||||
dl->mMIMEInfo = aMIMEInfo;
|
||||
dl->SetStartTime(aStartTime);
|
||||
dl->SetStartTime(aStartTime == 0 ? PR_Now() : aStartTime);
|
||||
|
||||
// Creates a cycle that will be broken when the download finishes
|
||||
dl->mCancelable = aCancelable;
|
||||
@ -1156,7 +1156,7 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType,
|
||||
aTempFile->GetPath(tempPath);
|
||||
|
||||
PRInt64 id = AddDownloadToDB(dl->mDisplayName, source, target, tempPath,
|
||||
aStartTime, 0,
|
||||
dl->mStartTime, dl->mLastUpdate,
|
||||
nsIDownloadManager::DOWNLOAD_NOTSTARTED);
|
||||
NS_ENSURE_TRUE(id, NS_ERROR_FAILURE);
|
||||
dl->mID = id;
|
||||
@ -1912,10 +1912,6 @@ nsDownload::OnStateChange(nsIWebProgress *aWebProgress,
|
||||
nsIRequest *aRequest, PRUint32 aStateFlags,
|
||||
nsresult aStatus)
|
||||
{
|
||||
// Record the start time only if it hasn't been set.
|
||||
if (mStartTime == 0 && (aStateFlags & STATE_START))
|
||||
SetStartTime(PR_Now());
|
||||
|
||||
// We don't want to lose access to our member variables
|
||||
nsRefPtr<nsDownload> kungFuDeathGrip = this;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user