Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, function(evt) {
var progressEvent = new ProgressEvent('progress', {
loaded: evt.progress.bytesReceived,
total: evt.progress.totalBytesToReceive,
target: evt.resultFile
});
// when bytesReceived == 0, BackgroundDownloader has not yet differentiated whether it could get file length or not,
// when totalBytesToReceive == 0, BackgroundDownloader is unable to get file length
progressEvent.lengthComputable = (evt.progress.bytesReceived > 0) && (evt.progress.totalBytesToReceive > 0);
successCallback(progressEvent, { keepCallback: true });
});
}, function(error) {
}, function(evt) {
var progressEvent = new ProgressEvent('progress', {
loaded: evt.progress.bytesReceived,
total: evt.progress.totalBytesToReceive,
target: evt.resultFile
});
// when bytesReceived == 0, BackgroundDownloader has not yet differentiated whether it could get file length or not,
// when totalBytesToReceive == 0, BackgroundDownloader is unable to get file length
progressEvent.lengthComputable = (evt.progress.bytesReceived > 0) && (evt.progress.totalBytesToReceive > 0);
successCallback(progressEvent, { keepCallback: true });
});
}, function(error) {
function (evt) {
var progressEvent = new ProgressEvent('progress', {
loaded: evt.progress.bytesSent,
total: evt.progress.totalBytesToSend,
target: evt.resultFile
});
progressEvent.lengthComputable = true;
successCallback(progressEvent, { keepCallback: true });
}
);
function newProgressEvent(result) {
var pe = new ProgressEvent();
pe.lengthComputable = result.lengthComputable;
pe.loaded = result.loaded;
pe.total = result.total;
return pe;
}
function newProgressEvent(result) {
var pe = new ProgressEvent();
pe.lengthComputable = result.lengthComputable;
pe.loaded = result.loaded;
pe.total = result.total;
return pe;
}
function newProgressEvent(result) {
var pe = new ProgressEvent();
pe.lengthComputable = result.lengthComputable;
pe.loaded = result.loaded;
pe.total = result.total;
return pe;
}
function (evt) {
var progressEvent = new ProgressEvent('progress', {
loaded: evt.progress.bytesSent,
total: evt.progress.totalBytesToSend,
target: evt.resultFile
});
progressEvent.lengthComputable = true;
successCallback(progressEvent, { keepCallback: true });
}
);