Bug 1132213 - Remove newChannel2 and asyncFetch2 calls in the "jsdownloads" folder. r=paolo

This commit is contained in:
Aime Galmi 2015-03-22 01:38:01 +01:00
Родитель f971f18e02
Коммит 635534a8b0
3 изменённых файлов: 14 добавлений и 31 удалений

Просмотреть файл

@ -1907,14 +1907,10 @@ this.DownloadCopySaver.prototype = {
// Create a channel from the source, and listen to progress
// notifications.
let channel = NetUtil.newChannel2(download.source.url,
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
let channel = NetUtil.newChannel({
uri: download.source.url,
loadUsingSystemPrincipal: true,
});
if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
channel.setPrivate(download.source.isPrivate);
}

Просмотреть файл

@ -396,14 +396,10 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) {
},
}).then(null, do_report_unexpected_exception);
let channel = NetUtil.newChannel2(sourceURI,
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
let channel = NetUtil.newChannel({
uri: sourceURI,
loadUsingSystemPrincipal: true,
});
// Start the actual download process.
channel.asyncOpen({
@ -537,7 +533,7 @@ function promiseVerifyContents(aPath, aExpectedContents)
}
let deferred = Promise.defer();
NetUtil.asyncFetch2(
NetUtil.asyncFetch(
file,
function(aInputStream, aStatus) {
do_check_true(Components.isSuccessCode(aStatus));
@ -553,12 +549,7 @@ function promiseVerifyContents(aPath, aExpectedContents)
do_check_eq(contents, aExpectedContents);
}
deferred.resolve();
},
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
});
yield deferred.promise;
});

Просмотреть файл

@ -164,14 +164,10 @@ function promiseTableCount(aConnection) {
function promiseEntityID(aUrl) {
let deferred = Promise.defer();
let entityID = "";
let channel = NetUtil.newChannel2(NetUtil.newURI(aUrl),
null,
null,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
let channel = NetUtil.newChannel({
uri: NetUtil.newURI(aUrl),
loadUsingSystemPrincipal: true,
});
channel.asyncOpen({
onStartRequest: function (aRequest) {