Port bug 1127201 (s/NS_ABORT_IF_FALSE/MOZ_ASSERT/g) to comm-central, rs=bustage-fix
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 05 Feb 2015 22:42:30 -0600
changeset 21788 9d72c364c82b1bb2f50e41d7c0ef25e1142b981a
parent 21787 baa8c010ffb3bd88f824164e05e5ea024f9d189b
child 21789 abbb2e4ab3bab750d4a0deab12301c7a115d7de8
push id1326
push usermbanner@mozilla.com
push dateMon, 30 Mar 2015 20:10:12 +0000
treeherdercomm-beta@69663dd6f687 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1127201
Port bug 1127201 (s/NS_ABORT_IF_FALSE/MOZ_ASSERT/g) to comm-central, rs=bustage-fix
mailnews/base/src/nsMessenger.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/mime/src/nsStreamConverter.cpp
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2304,18 +2304,18 @@ static int CompareAttachmentPartId(const
     partIdLeft = "0";
 
   if(!partIdRight)
     partIdRight = "0";
 
   long idLeft, idRight;
   do
   {
-    NS_ABORT_IF_FALSE(partIdLeft && IS_DIGIT(*partIdLeft), "Invalid character in part id string");
-    NS_ABORT_IF_FALSE(partIdRight && IS_DIGIT(*partIdRight), "Invalid character in part id string");
+    MOZ_ASSERT(partIdLeft && IS_DIGIT(*partIdLeft), "Invalid character in part id string");
+    MOZ_ASSERT(partIdRight && IS_DIGIT(*partIdRight), "Invalid character in part id string");
 
     // if the part numbers are different then the numerically smaller one is first
     char *fixConstLoss;
     idLeft  = strtol(partIdLeft, &fixConstLoss, 10);
     partIdLeft = fixConstLoss;
     idRight = strtol(partIdRight, &fixConstLoss, 10);
     partIdRight = fixConstLoss;
     if (idLeft != idRight)
@@ -2326,18 +2326,18 @@ static int CompareAttachmentPartId(const
     if (*partIdLeft != *partIdRight)
       return *partIdRight ? -2 : 2;
 
     // if both part ids are complete (*partIdLeft == *partIdRight now) then
     // they are equal
     if (!*partIdLeft)
       return 0;
 
-    NS_ABORT_IF_FALSE(*partIdLeft == '.', "Invalid character in part id string");
-    NS_ABORT_IF_FALSE(*partIdRight == '.', "Invalid character in part id string");
+    MOZ_ASSERT(*partIdLeft == '.', "Invalid character in part id string");
+    MOZ_ASSERT(*partIdRight == '.', "Invalid character in part id string");
 
     ++partIdLeft;
     ++partIdRight;
   }
   while (true);
   return 0;
 }
 
@@ -2440,17 +2440,17 @@ nsAttachmentState::~nsAttachmentState()
   delete[] mAttachmentArray;
 }
 
 nsresult
 nsAttachmentState::Init(uint32_t aCount, const char ** aContentTypeArray,
                         const char ** aUrlArray, const char ** aDisplayNameArray,
                         const char ** aMessageUriArray)
 {
-  NS_ABORT_IF_FALSE(aCount > 0, "count is invalid");
+  MOZ_ASSERT(aCount > 0, "count is invalid");
 
   mCount = aCount;
   mCurIndex = 0;
   delete[] mAttachmentArray;
 
   mAttachmentArray = new msgAttachment[aCount];
   if (!mAttachmentArray)
     return NS_ERROR_OUT_OF_MEMORY;
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -1087,17 +1087,17 @@ NS_IMETHODIMP nsImapProtocol::Run()
 }
 
 //
 // Must be called from UI thread only
 //
 NS_IMETHODIMP nsImapProtocol::CloseStreams()
 {
   // make sure that it is called by the UI thread
-  NS_ABORT_IF_FALSE(NS_IsMainThread(), "CloseStreams() should not be called from an off UI thread");
+  MOZ_ASSERT(NS_IsMainThread(), "CloseStreams() should not be called from an off UI thread");
 
   {
     MutexAutoLock mon(mLock);
     if (m_transport)
     {
         // make sure the transport closes (even if someone is still indirectly
         // referencing it).
         m_transport->Close(NS_ERROR_ABORT);
--- a/mailnews/mime/src/nsStreamConverter.cpp
+++ b/mailnews/mime/src/nsStreamConverter.cpp
@@ -343,17 +343,17 @@ nsStreamConverter::DetermineOutputFormat
   const char *format = FindQueryElementData(queryPart, "outformat=");
   if (format)
   {
     //NOTE: I've done a file contents search of every file (*.*) in the mozilla
     // directory tree and there is not a single location where the string "outformat"
     // is added to any URL. It appears that this code has been orphaned off by a change
     // elsewhere and is no longer required. It will be removed in the future unless
     // someone complains.
-    NS_ABORT_IF_FALSE(false, "Is this code actually being used?");
+    MOZ_ASSERT(false, "Is this code actually being used?");
 
     while (*format == ' ')
       ++format;
 
     if (*format)
     {
       mOverrideFormat = "raw";