From e08e89c4a5eacce7674112bbc05282cea9f001d0 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Mon, 30 Nov 2015 20:23:55 -0800 Subject: [PATCH] Bug 1225355 - Use channel.asyncOpen2 in toolkit/components/aboutmemory/content/aboutMemory.js (r=sicking) --- .../components/aboutmemory/content/aboutMemory.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index 86541a2ec31..465260d2d1e 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -34,6 +34,7 @@ const UNITS_PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/NetUtil.jsm"); XPCOMUtils.defineLazyGetter(this, "nsBinaryStream", () => CC("@mozilla.org/binaryinputstream;1", @@ -670,13 +671,11 @@ function loadMemoryReportsFromFile(aFilename, aTitleNote, aFn) }, null); let file = new nsFile(aFilename); - let fileChan = Services.io.newChannelFromURI2(Services.io.newFileURI(file), - null, // aLoadingNode - Services.scriptSecurityManager.getSystemPrincipal(), - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER); - fileChan.asyncOpen(converter, null); + let fileChan = NetUtil.newChannel({ + uri: Services.io.newFileURI(file), + loadUsingSystemPrincipal: true + }); + fileChan.asyncOpen2(converter); } catch (ex) { handleException(ex);