зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1223437 - Use channel.asyncOpen2 in toolkit/components/jsdownloads/test/unit (r=sicking)
This commit is contained in:
Родитель
a6cb71ab15
Коммит
fed8644966
|
@ -410,10 +410,11 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) {
|
||||||
let channel = NetUtil.newChannel({
|
let channel = NetUtil.newChannel({
|
||||||
uri: sourceURI,
|
uri: sourceURI,
|
||||||
loadUsingSystemPrincipal: true,
|
loadUsingSystemPrincipal: true,
|
||||||
|
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the actual download process.
|
// Start the actual download process.
|
||||||
channel.asyncOpen({
|
channel.asyncOpen2({
|
||||||
contentListener: null,
|
contentListener: null,
|
||||||
|
|
||||||
onStartRequest: function (aRequest, aContext)
|
onStartRequest: function (aRequest, aContext)
|
||||||
|
@ -435,7 +436,7 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) {
|
||||||
this.contentListener.onDataAvailable(aRequest, aContext, aInputStream,
|
this.contentListener.onDataAvailable(aRequest, aContext, aInputStream,
|
||||||
aOffset, aCount);
|
aOffset, aCount);
|
||||||
},
|
},
|
||||||
}, null);
|
});
|
||||||
}.bind(this)).then(null, do_report_unexpected_exception);
|
}.bind(this)).then(null, do_report_unexpected_exception);
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
|
|
|
@ -167,9 +167,10 @@ function promiseEntityID(aUrl) {
|
||||||
let channel = NetUtil.newChannel({
|
let channel = NetUtil.newChannel({
|
||||||
uri: NetUtil.newURI(aUrl),
|
uri: NetUtil.newURI(aUrl),
|
||||||
loadUsingSystemPrincipal: true,
|
loadUsingSystemPrincipal: true,
|
||||||
|
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
|
||||||
});
|
});
|
||||||
|
|
||||||
channel.asyncOpen({
|
channel.asyncOpen2({
|
||||||
onStartRequest: function (aRequest) {
|
onStartRequest: function (aRequest) {
|
||||||
if (aRequest instanceof Ci.nsIResumableChannel) {
|
if (aRequest instanceof Ci.nsIResumableChannel) {
|
||||||
entityID = aRequest.entityID;
|
entityID = aRequest.entityID;
|
||||||
|
@ -186,7 +187,7 @@ function promiseEntityID(aUrl) {
|
||||||
},
|
},
|
||||||
|
|
||||||
onDataAvailable: function () {}
|
onDataAvailable: function () {}
|
||||||
}, null);
|
});
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче