зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1132213 - Remove newChannel2 and asyncFetch2 calls in the "jsdownloads" folder. r=paolo
This commit is contained in:
Родитель
f971f18e02
Коммит
635534a8b0
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче