Bug 1407229 - Backed out changeset 2ca8d8d56941: Backout of temporary fix. a=jorgk
authorJorg K
Wed, 11 Oct 2017 11:55:55 +0200
changeset 29162 dd2c759074f472fa204b2d4b2a8321eabd28d9c2
parent 29161 18c81073537a36ba78bd68adb45a3cf5f1976a9b
child 29163 bd0f723f1c32a6f9024af430a90620b1e744c96c
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)
reviewersjorgk
bugs1407229
Bug 1407229 - Backed out changeset 2ca8d8d56941: Backout of temporary fix. a=jorgk
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgSend.cpp
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -77,17 +77,16 @@
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "nsStreamConverter.h"
 #include "nsISelection.h"
 #include "nsJSEnvironment.h"
 #include "nsIObserverService.h"
 #include "nsIProtocolHandler.h"
 #include "nsContentUtils.h"
 #include "nsIFileURL.h"
-#include "nsIPrincipal.h" // XXX TEMPORARY
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::mailnews;
 
 static nsresult GetReplyHeaderInfo(int32_t* reply_header_type,
                                    nsString& reply_header_authorwrote,
                                    nsString& reply_header_ondateauthorwrote,
@@ -267,17 +266,17 @@ bool nsMsgCompose::IsEmbeddedObjectSafe(
     return false;
 
   nsCOMPtr<Element> objectAsElement = do_QueryInterface(object);
   RefPtr<HTMLImageElement>  image  = HTMLImageElement::FromContentOrNull(objectAsElement);
   RefPtr<HTMLLinkElement>   link   = HTMLLinkElement::FromContentOrNull(objectAsElement);
   RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::FromContentOrNull(objectAsElement);
 
   if (image)
-    { uint64_t ignored; image->GetSrc(objURL, *(nsIPrincipal*)(&ignored)); } // XXX TEMPORARY
+    image->GetSrc(objURL);
   else if (link)
     link->GetHref(objURL);
   else if (anchor)
     anchor->GetHref(objURL);
   else
     return false;
 
   if (!objURL.IsEmpty())
@@ -370,17 +369,17 @@ nsresult nsMsgCompose::ResetUrisForEmbed
         RefPtr<mozilla::dom::HTMLImageElement> image =
           mozilla::dom::HTMLImageElement::FromContentOrNull(imageElement);
         if (!image)
           continue;
         nsCString partNum;
         mMsgSend->GetPartForDomIndex(i, partNum);
         // do we care about anything besides images?
         nsAutoString objURL;
-        uint64_t ignored; image->GetSrc(objURL, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
+        image->GetSrc(objURL);
 
         // First we need to make sure that the URL is associated with a message
         // protocol so we don't accidentally manipulate a URL like:
         // http://www.site.com/retrieve.html?C=image.jpg.
         nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         nsAutoCString scheme;
         ioService->ExtractScheme(NS_ConvertUTF16toUTF8(objURL), scheme);
@@ -438,17 +437,17 @@ nsresult nsMsgCompose::ResetUrisForEmbed
         bool specHasQ = (spec.FindChar('?') != kNotFound);
         if (specHasQ && restOfUrl.CharAt(0) == '?')
           restOfUrl.SetCharAt('&', 0);
         else if (!specHasQ && restOfUrl.CharAt(0) == '&')
           restOfUrl.SetCharAt('?', 0);
         AppendUTF8toUTF16(spec, newSrc);
         newSrc.Append(restOfUrl);
         IgnoredErrorResult rv2;
-        image->SetSrc(newSrc, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
+        image->SetSrc(newSrc, rv2);
       }
     }
   }
 
   return NS_OK;
 }
 
 
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -78,17 +78,16 @@
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "mozilla/dom/HTMLLinkElement.h"
 #include "nsIMutableArray.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgProtocolInfo.h"
 #include "mozIDOMWindow.h"
 #include "mozilla/Preferences.h"
-#include "nsIPrincipal.h" // XXX TEMPORARY
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::mailnews;
 
 static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
 
 #define PREF_MAIL_SEND_STRUCT "mail.send_struct"
@@ -1310,17 +1309,17 @@ nsMsgComposeAndSend::GetEmbeddedObjectIn
   }
   else if (image)        // Is this an image?
   {
     nsString    tUrl;
     nsString    tName;
     nsString    tDesc;
 
     // Create the URI
-    uint64_t ignored; image->GetSrc(tUrl, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
+    image->GetSrc(tUrl);
     if (tUrl.IsEmpty())
       return NS_OK;
 
     nsAutoCString turlC;
     CopyUTF16toUTF8(tUrl, turlC);
     if (NS_FAILED(nsMsgNewURL(getter_AddRefs(attachment->m_url), turlC)))
     {
       // Well, the first time failed...which means we probably didn't get
@@ -1834,22 +1833,22 @@ nsMsgComposeAndSend::ProcessMultipartRel
       if (anchor)
       {
         anchor->GetHref(domURL);
         anchor->SetHref(newSpec, rv2);
       }
       else if (link)
       {
         link->GetHref(domURL);
-        link->SetHref(newSpec, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
+        link->SetHref(newSpec, rv2);
       }
       else if (image)
       {
-        uint64_t ignored; image->GetSrc(domURL, *(nsIPrincipal*)(&ignored)); // XXX TEMPORARY
-        image->SetSrc(newSpec, *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
+        image->GetSrc(domURL);
+        image->SetSrc(newSpec, rv2);
       }
       else if (body)
       {
         body->GetBackground(domURL);
         body->SetBackground(newSpec, rv2);
       }
 
       if (!domURL.IsEmpty())
@@ -1878,19 +1877,19 @@ nsMsgComposeAndSend::ProcessMultipartRel
     RefPtr<HTMLBodyElement>   body   = HTMLBodyElement::FromContentOrNull(nodeAsElement);
 
       // STRING USE WARNING: hoisting the following conversion might save code-space, since it happens along every path
 
     IgnoredErrorResult rv2;
     if (anchor) {
       anchor->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
     } else if (link) {
-      link->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
+      link->SetHref(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
     } else if (image) {
-      image->SetSrc(NS_ConvertASCIItoUTF16(domSaveArray[i].url), *nsContentUtils::GetSystemPrincipal(), rv2); // XXX TEMPORARY
+      image->SetSrc(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
     }
     else if (body) {
       body->SetBackground(NS_ConvertASCIItoUTF16(domSaveArray[i].url), rv2);
     }
 
     free(domSaveArray[i].url);
   }