Bug 1269279 - Remove SEC_NORMAL from toolkit/components/passwordmgr/ (r=billm)

This commit is contained in:
Christoph Kerschbaumer 2016-05-06 15:15:23 +02:00
Родитель eb68ff098e
Коммит 280bbd924b
2 изменённых файлов: 11 добавлений и 23 удалений

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

@ -81,19 +81,14 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components; const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/Timer.jsm"); Cu.import("resource://gre/modules/Timer.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let channel = Services.io.newChannel2( let channel = NetUtil.newChannel({
"http://example.com", uri: "http://example.com",
null, loadUsingSystemPrincipal: true
null, });
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER
);
let pps = Cc["@mozilla.org/network/protocol-proxy-service;1"]. let pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].
getService(Ci.nsIProtocolProxyService); getService(Ci.nsIProtocolProxyService);

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

@ -12,6 +12,8 @@
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged"); SimpleTest.requestFlakyTimeout("untriaged");
const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm');
var prefs = Cc["@mozilla.org/preferences-service;1"]. var prefs = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch); getService(Ci.nsIPrefBranch);
prefs.setIntPref("network.auth.subresource-http-auth-allow", 2); prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
@ -144,23 +146,14 @@
function startup() { function startup() {
//need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy. //need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
var ios = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] var channel = NetUtil.newChannel({
.getService(SpecialPowers.Ci.nsIIOService); uri: "http://example.com",
loadUsingSystemPrincipal: true
});
var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"] var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"]
.getService(); .getService();
var systemPrincipal = SpecialPowers.Services.scriptSecurityManager
.getSystemPrincipal();
var channel = ios.newChannel2("http://example.com",
null,
null,
null, // aLoadingNode
systemPrincipal,
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
pps.asyncResolve(channel, 0, resolveCallback); pps.asyncResolve(channel, 0, resolveCallback);
} }