Bug 1406574 - Use system principal in DisplayHTMLInMessagePane(). r=bz a=jorgk
authorJorg K <jorgk@jorgk.com>
Mon, 09 Oct 2017 21:28:03 +0200
changeset 29805 4f4a1a13796ca8048894cbc664289c979cdec28c
parent 29804 624e38d6b4e3045ab5cffedc4470ca16ce062ef2
child 29806 c2ea76e8472e7a539d63e23cb408d8b47dd6123b
push id378
push userclokep@gmail.com
push dateMon, 13 Nov 2017 18:45:35 +0000
reviewersbz, jorgk
bugs1406574
Bug 1406574 - Use system principal in DisplayHTMLInMessagePane(). r=bz a=jorgk
mailnews/base/src/nsMsgWindow.cpp
--- a/mailnews/base/src/nsMsgWindow.cpp
+++ b/mailnews/base/src/nsMsgWindow.cpp
@@ -23,17 +23,17 @@
 #include "nsICharsetConverterManager.h"
 #include "nsIChannel.h"
 #include "nsIRequestObserver.h"
 #include "netCore.h"
 #include "prmem.h"
 #include "plbase64.h"
 #include "nsMsgI18N.h"
 #include "nsIWebNavigation.h"
-#include "NullPrincipal.h"
+#include "nsContentUtils.h"
 #include "nsMsgContentPolicy.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIAuthPrompt.h"
 #include "nsMsgUtils.h"
 
 static NS_DEFINE_CID(kTransactionManagerCID, NS_TRANSACTIONMANAGER_CID);
 
@@ -526,18 +526,13 @@ nsMsgWindow::DisplayHTMLInMessagePane(co
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsCString dataSpec;
   dataSpec = "data:text/html;base64,";
   dataSpec += encodedHtml;
 
   PR_FREEIF(encodedHtml);
 
-  nsresult rv;
-  nsCOMPtr<nsIPrincipal> nullPrincipal =
-    do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
   return DisplayURIInMessagePane(NS_ConvertASCIItoUTF16(dataSpec).get(),
-                                 clearMsgHdr, nullPrincipal);
+                                 clearMsgHdr, nsContentUtils::GetSystemPrincipal());
 }
 
 NS_IMPL_GETSET(nsMsgWindow, Stopped, bool, m_stopped)