Bug 1125991 - Make JS callers of ios.newChannel call ios.newChannel2 in toolkit/components/jsdownloads (r=paolo)

This commit is contained in:
Christoph Kerschbaumer 2015-02-02 20:09:40 -08:00
parent 503f1e807e
commit 5aac2fe0fc

View File

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