Bug 1044584 - Fix incorrect computation of mUploadTransferred. r=bz

This commit is contained in:
Axel Viala 2014-07-28 17:19:51 +02:00
parent 21a6473c1b
commit ea0878e381

View File

@ -3592,11 +3592,13 @@ nsXMLHttpRequest::OnProgress(nsIRequest *aRequest, nsISupports *aContext, uint64
// So, try to remove the headers, if possible.
bool lengthComputable = (aProgressMax != UINT64_MAX);
if (upload) {
mUploadTransferred = aProgress;
uint64_t loaded = aProgress;
if (lengthComputable) {
mUploadTransferred = aProgressMax - mUploadTotal;
uint64_t headerSize = aProgressMax - mUploadTotal;
loaded -= headerSize;
}
mUploadLengthComputable = lengthComputable;
mUploadTransferred = loaded;
mProgressSinceLastProgressEvent = true;
MaybeDispatchProgressEvents(false);