Bug 1246725 - Remove SEC_NORMAL from addon-sdk (r=sicking)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Mon, 08 Feb 2016 11:12:37 -0800
changeset 296947 ece69108baefc705cf2f7fd2802119fe883f80d0
parent 296946 32fb5b0bfb893fa170ae88707036328f0cfdb2f3
child 296948 1b02f9d6c0586c7d7db405b3fc1ad4347503a180
push id76538
push usermozilla@christophkerschbaumer.com
push dateWed, 11 May 2016 12:11:46 +0000
treeherdermozilla-inbound@ece69108baef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1246725
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1246725 - Remove SEC_NORMAL from addon-sdk (r=sicking)
addon-sdk/source/lib/sdk/url.js
addon-sdk/source/test/test-private-browsing.js
--- a/addon-sdk/source/lib/sdk/url.js
+++ b/addon-sdk/source/lib/sdk/url.js
@@ -65,17 +65,17 @@ var toFilename = exports.toFilename = fu
   var uri = newURI(url);
   if (uri.scheme == "resource")
     uri = newURI(resolveResourceURI(uri));
   if (uri.scheme == "chrome") {
     var channel = ios.newChannelFromURI2(uri,
                                          null,      // aLoadingNode
                                          Services.scriptSecurityManager.getSystemPrincipal(),
                                          null,      // aTriggeringPrincipal
-                                         Ci.nsILoadInfo.SEC_NORMAL,
+                                         Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                          Ci.nsIContentPolicy.TYPE_OTHER);
     try {
       channel = channel.QueryInterface(Ci.nsIFileChannel);
       return channel.file.path;
     }
     catch (e) {
       if (e.result == Cr.NS_NOINTERFACE) {
         throw new Error("chrome url isn't on filesystem: " + url);
--- a/addon-sdk/source/test/test-private-browsing.js
+++ b/addon-sdk/source/test/test-private-browsing.js
@@ -12,17 +12,17 @@ const { isWindowPrivate } = winUtils;
 const { isPrivateBrowsingSupported } = require('sdk/self');
 const { is } = require('sdk/system/xul-app');
 const { isPrivate } = require('sdk/private-browsing');
 const { LoaderWithHookedConsole } = require("sdk/test/loader");
 const { getMode, isWindowPBSupported, isTabPBSupported } = require('sdk/private-browsing/utils');
 const { pb } = require('./private-browsing/helper');
 const prefs = require('sdk/preferences/service');
 
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
+const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
 
 const kAutoStartPref = "browser.privatebrowsing.autostart";
 
 if (isWindowPBSupported) {
   safeMerge(module.exports, require('./private-browsing/windows'));
 
   exports.testPWOnlyOnFirefox = function(assert) {
     assert.ok(is("Firefox"), "isWindowPBSupported is only true on Firefox");
@@ -61,24 +61,20 @@ exports.testWindowDefaults = function(as
 };
 
 exports.testIsPrivateBrowsingFalseDefault = function(assert) {
   assert.equal(isPrivateBrowsingSupported, false,
   	               'isPrivateBrowsingSupported property is false by default');
 };
 
 exports.testNSIPrivateBrowsingChannel = function(assert) {
-  let channel = Services.io.newChannel2("about:blank",
-                                        null,
-                                        null,
-                                        null,      // aLoadingNode
-                                        Services.scriptSecurityManager.getSystemPrincipal(),
-                                        null,      // aTriggeringPrincipal
-                                        Ci.nsILoadInfo.SEC_NORMAL,
-                                        Ci.nsIContentPolicy.TYPE_OTHER);
+  let channel = NetUtil.newChannel({
+    uri: "about:blank",
+    loadUsingSystemPrincipal: true
+  });
   channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
   assert.equal(isPrivate(channel), false, 'isPrivate detects non-private channels');
   channel.setPrivate(true);
   assert.ok(isPrivate(channel), 'isPrivate detects private channels');
 }
 
 exports.testNewGlobalPBService = function(assert) {
   assert.equal(isPrivate(), false, 'isPrivate() is false by default');