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"]
|
var URLParser = Cc["@mozilla.org/network/url-parser;1?auth=no"]
|
||||||
.getService(Ci.nsIURLParser);
|
.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) {
|
function newURI(uriStr, base) {
|
||||||
try {
|
try {
|
||||||
@ -66,11 +66,12 @@ var toFilename = exports.toFilename = function toFilename(url) {
|
|||||||
if (uri.scheme == "resource")
|
if (uri.scheme == "resource")
|
||||||
uri = newURI(resolveResourceURI(uri));
|
uri = newURI(resolveResourceURI(uri));
|
||||||
if (uri.scheme == "chrome") {
|
if (uri.scheme == "chrome") {
|
||||||
var channel = NetUtil.newChannel({
|
var channel = ios.newChannelFromURI2(uri,
|
||||||
uri: uri,
|
null, // aLoadingNode
|
||||||
loadUsingSystemPrincipal: true
|
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||||
});
|
null, // aTriggeringPrincipal
|
||||||
|
Ci.nsILoadInfo.SEC_NORMAL,
|
||||||
|
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||||
try {
|
try {
|
||||||
channel = channel.QueryInterface(Ci.nsIFileChannel);
|
channel = channel.QueryInterface(Ci.nsIFileChannel);
|
||||||
return channel.file.path;
|
return channel.file.path;
|
||||||
|
@ -17,7 +17,7 @@ const { getMode, isWindowPBSupported, isTabPBSupported } = require('sdk/private-
|
|||||||
const { pb } = require('./private-browsing/helper');
|
const { pb } = require('./private-browsing/helper');
|
||||||
const prefs = require('sdk/preferences/service');
|
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";
|
const kAutoStartPref = "browser.privatebrowsing.autostart";
|
||||||
|
|
||||||
@ -66,10 +66,14 @@ exports.testIsPrivateBrowsingFalseDefault = function(assert) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.testNSIPrivateBrowsingChannel = function(assert) {
|
exports.testNSIPrivateBrowsingChannel = function(assert) {
|
||||||
let channel = NetUtil.newChannel({
|
let channel = Services.io.newChannel2("about:blank",
|
||||||
uri: "about:blank",
|
null,
|
||||||
loadUsingSystemPrincipal: true
|
null,
|
||||||
});
|
null, // aLoadingNode
|
||||||
|
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||||
|
null, // aTriggeringPrincipal
|
||||||
|
Ci.nsILoadInfo.SEC_NORMAL,
|
||||||
|
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||||
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
|
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
|
||||||
assert.equal(isPrivate(channel), false, 'isPrivate detects non-private channels');
|
assert.equal(isPrivate(channel), false, 'isPrivate detects non-private channels');
|
||||||
channel.setPrivate(true);
|
channel.setPrivate(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user