Bug 1223225 - Use channel.asyncOpen2() in browser/base/content/nsContextMenu.js (r=sicking)

This commit is contained in:
Christoph Kerschbaumer 2015-11-15 14:47:51 -08:00
Родитель 5f0c0c81f8
Коммит 70c1329cf3
1 изменённых файлов: 7 добавлений и 10 удалений

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

@ -1344,15 +1344,12 @@ nsContextMenu.prototype = {
// * this.principal - as the loadingPrincipal // * this.principal - as the loadingPrincipal
// for now lets use systemPrincipal to bypass mixedContentBlocker // for now lets use systemPrincipal to bypass mixedContentBlocker
// checks after redirects, see bug: 1136055 // checks after redirects, see bug: 1136055
var ioService = Cc["@mozilla.org/network/io-service;1"]. var channel = NetUtil.newChannel({
getService(Ci.nsIIOService); uri: makeURI(linkURL),
var principal = Services.scriptSecurityManager.getSystemPrincipal(); loadUsingSystemPrincipal: true,
var channel = ioService.newChannelFromURI2(makeURI(linkURL), securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
null, // aLoadingNode });
principal, // aLoadingPrincipal
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
if (linkDownload) if (linkDownload)
channel.contentDispositionFilename = linkDownload; channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) { if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
@ -1385,7 +1382,7 @@ nsContextMenu.prototype = {
timer.TYPE_ONE_SHOT); timer.TYPE_ONE_SHOT);
// kick off the channel with our proxy object as the listener // kick off the channel with our proxy object as the listener
channel.asyncOpen(new saveAsListener(), null); channel.asyncOpen2(new saveAsListener());
}, },
// Save URL of clicked-on link. // Save URL of clicked-on link.