mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 8bacae951c0c (bug 1246725)
This commit is contained in:
parent
1990919b33
commit
7ebb137164
@ -23,7 +23,7 @@ var resProt = ios.getProtocolHandler("resource")
|
||||
var URLParser = Cc["@mozilla.org/network/url-parser;1?auth=no"]
|
||||
.getService(Ci.nsIURLParser);
|
||||
|
||||
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function newURI(uriStr, base) {
|
||||
try {
|
||||
@ -66,11 +66,12 @@ var toFilename = exports.toFilename = function toFilename(url) {
|
||||
if (uri.scheme == "resource")
|
||||
uri = newURI(resolveResourceURI(uri));
|
||||
if (uri.scheme == "chrome") {
|
||||
var channel = NetUtil.newChannel({
|
||||
uri: uri,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
var channel = ios.newChannelFromURI2(uri,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
try {
|
||||
channel = channel.QueryInterface(Ci.nsIFileChannel);
|
||||
return channel.file.path;
|
||||
|
@ -17,7 +17,7 @@ const { getMode, isWindowPBSupported, isTabPBSupported } = require('sdk/private-
|
||||
const { pb } = require('./private-browsing/helper');
|
||||
const prefs = require('sdk/preferences/service');
|
||||
|
||||
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
const kAutoStartPref = "browser.privatebrowsing.autostart";
|
||||
|
||||
@ -66,10 +66,14 @@ exports.testIsPrivateBrowsingFalseDefault = function(assert) {
|
||||
};
|
||||
|
||||
exports.testNSIPrivateBrowsingChannel = function(assert) {
|
||||
let channel = NetUtil.newChannel({
|
||||
uri: "about:blank",
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
let channel = Services.io.newChannel2("about:blank",
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
|
||||
assert.equal(isPrivate(channel), false, 'isPrivate detects non-private channels');
|
||||
channel.setPrivate(true);
|
||||
|
Loading…
Reference in New Issue
Block a user