Bug 1406574 - Use system principal in DisplayHTMLInMessagePane(). r=bz
authorJorg K <jorgk@jorgk.com>
Mon, 09 Oct 2017 21:28:03 +0200
changeset 29152 2d369ce1129600896b538f89e453e350d2e83b46
parent 29151 f36d55df71e9ac1657af9b482011073f624082df
child 29153 3b1059c2b846e729b74a8188d8edc66b9ebfb7d7
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1406574
Bug 1406574 - Use system principal in DisplayHTMLInMessagePane(). r=bz
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)