Bug 1272590 - Remove SEC_NORMAL from toolkit/content/contentAreaUtils.js (r=sicking)
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Tue, 17 May 2016 10:00:45 +0200
changeset 297636 5d9313e120f37bdae170915f0b38b1dba249e4c6
parent 297635 659a951ea9ee1c6974950917c0c74e6f2d8e4c05
child 297637 85540f68837ead0d6552d3fcc3a1d8e90a850f8e
push id76833
push usermozilla@christophkerschbaumer.com
push dateTue, 17 May 2016 08:03:28 +0000
treeherdermozilla-inbound@5d9313e120f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1272590
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 1272590 - Remove SEC_NORMAL from toolkit/content/contentAreaUtils.js (r=sicking)
toolkit/content/contentAreaUtils.js
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -21,16 +21,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
                                   "resource://gre/modules/Deprecated.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
                                   "resource://gre/modules/AppConstants.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
+                                  "resource://gre/modules/NetUtil.jsm");
 
 var ContentAreaUtils = {
 
   // this is for backwards compatibility.
   get ioService() {
     return Services.io;
   },
 
@@ -1309,21 +1311,20 @@ function openURL(aURL)
         if (iid.equals(Components.interfaces.nsIURIContentListener))
           return this;
         if (iid.equals(Components.interfaces.nsILoadGroup))
           return loadgroup;
         throw Components.results.NS_ERROR_NO_INTERFACE;
       }
     }
 
-    var channel = Services.io.newChannelFromURI2(uri,
-                                                 null,      // aLoadingNode
-                                                 Services.scriptSecurityManager.getSystemPrincipal(),
-                                                 null,      // aTriggeringPrincipal
-                                                 Components.interfaces.nsILoadInfo.SEC_NORMAL,
-                                                 Components.interfaces.nsIContentPolicy.TYPE_OTHER);
+    var channel = NetUtil.newChannel({
+      uri: uri,
+      loadUsingSystemPrincipal: true
+    });
+
     var uriLoader = Components.classes["@mozilla.org/uriloader;1"]
                               .getService(Components.interfaces.nsIURILoader);
     uriLoader.openURI(channel,
                       Components.interfaces.nsIURILoader.IS_CONTENT_PREFERRED,
                       uriListener);
   }
 }