Backout de7b9f15cd2e due to build bustage on all platforms.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 09 Oct 2012 21:21:38 -0400
changeset 14017 d1c0ff3c2690718232034b3030317115233feb6d
parent 14016 ccb28f98f40a637af3cd43b4a9b4f3eb1be82806
child 14018 796aa4b31867e1ffaab187309240f4cf078de725
push id804
push userbugzilla@standard8.plus.com
push dateMon, 07 Jan 2013 21:31:35 +0000
treeherdercomm-beta@9fdc5c67cdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
backs outde7b9f15cd2ed1f4d2c455ab737773bfff99b96e
Backout de7b9f15cd2e due to build bustage on all platforms.
mailnews/import/src/nsImportAddressBooks.cpp
mailnews/import/src/nsImportMail.cpp
--- a/mailnews/import/src/nsImportAddressBooks.cpp
+++ b/mailnews/import/src/nsImportAddressBooks.cpp
@@ -425,40 +425,41 @@ void nsImportGenericAddressBooks::GetDef
     NS_IF_RELEASE(m_pFieldMap);
   }
 }
 
 
 NS_IMETHODIMP nsImportGenericAddressBooks::WantsProgress(bool *_retval)
 {
   NS_PRECONDITION(_retval != nullptr, "null ptr");
-  NS_ENSURE_ARG_POINTER(_retval);
+    if (!_retval)
+        return NS_ERROR_NULL_POINTER;
 
   GetDefaultLocation();
   GetDefaultBooks();
 
-  bool result = false;
+  uint32_t    totalSize = 0;
+  bool        result = false;
 
   if (m_pBooks) {
     uint32_t    count = 0;
+    nsresult     rv = m_pBooks->Count(&count);
     uint32_t    i;
     bool        import;
     uint32_t    size;
-    uint32_t    totalSize = 0;
-
-    (void) m_pBooks->Count(&count);
 
     for (i = 0; i < count; i++) {
-      nsCOMPtr<nsIImportABDescriptor> book = do_QueryElementAt(m_pBooks, i);
+      nsCOMPtr<nsIImportABDescriptor> book =
+        do_QueryElementAt(m_pBooks, i);
       if (book) {
         import = false;
         size = 0;
-        nsresult rv = book->GetImport(&import);
-        if (NS_SUCCEEDED(rv) && import) {
-          (void) book->GetSize(&size);
+        rv = book->GetImport(&import);
+        if (import) {
+          rv = book->GetSize(&size);
           result = true;
         }
         totalSize += size;
       }
     }
 
     m_totalSize = totalSize;
   }
@@ -798,37 +799,36 @@ void nsImportGenericAddressBooks::Report
   pStream->AppendLiteral(MSG_LINEBREAK);
 }
 
 static void ImportAddressThread(void *stuff)
 {
   IMPORT_LOG0("In Begin ImportAddressThread\n");
 
   AddressThreadData *pData = (AddressThreadData *)stuff;
-  uint32_t          count = 0;
+  uint32_t  count = 0;
+  nsresult   rv = pData->books->Count(&count);
   uint32_t          i;
   bool              import;
   uint32_t          size;
 
   nsString          success;
   nsString          error;
 
-  (void) pData->books->Count(&count);
-
   for (i = 0; (i < count) && !(pData->abort); i++) {
     nsCOMPtr<nsIImportABDescriptor> book =
       do_QueryElementAt(pData->books, i);
     if (book) {
       import = false;
       size = 0;
       rv = book->GetImport(&import);
-      if (NS_SUCCEEDED(rv) && import)
+      if (import)
         rv = book->GetSize(&size);
 
-      if (NS_SUCCEEDED(rv) && size && import) {
+      if (size && import) {
         nsString name;
         book->GetPreferredName(name);
 
         nsCOMPtr<nsIAddrDatabase> db = pData->dBs->ObjectAt(i);
 
         bool fatalError = false;
         pData->currentSize = size;
         if (db) {
@@ -852,17 +852,17 @@ static void ImportAddressThread(void *st
 
           rv = pData->addressImport->ImportAddressBook(book,
                                                        db,
                                                        pData->fieldMap,
                                                        pData->ldifService,
                                                        &pError,
                                                        &pSuccess,
                                                        &fatalError);
-          if (NS_SUCCEEDED(rv) && pSuccess) {
+          if (pSuccess) {
             success.Append(pSuccess);
             NS_Free(pSuccess);
           }
           if (pError) {
             error.Append(pError);
             NS_Free(pError);
           }
         }
--- a/mailnews/import/src/nsImportMail.cpp
+++ b/mailnews/import/src/nsImportMail.cpp
@@ -385,51 +385,54 @@ void nsImportGenericMail::GetDefaultDest
     return;
   }
   IMPORT_LOG0("*** GetDefaultDestination: Failed to create a default import destination folder.");
 }
 
 NS_IMETHODIMP nsImportGenericMail::WantsProgress(bool *_retval)
 {
   NS_PRECONDITION(_retval != nullptr, "null ptr");
-  NS_ENSURE_ARG_POINTER(_retval);
+    if (!_retval)
+        return NS_ERROR_NULL_POINTER;
 
   if (m_pThreadData) {
     m_pThreadData->DriverAbort();
     m_pThreadData = nullptr;
   }
 
   if (!m_pMailboxes) {
     GetDefaultLocation();
     GetDefaultMailboxes();
   }
 
   if (!m_pDestFolder) {
     GetDefaultDestination();
   }
 
-  bool result = false;
+  uint32_t    totalSize = 0;
+  bool        result = false;
 
   if (m_pMailboxes) {
     uint32_t    i;
     bool        import;
     uint32_t    count = 0;
+    nsresult    rv;
     uint32_t    size;
-    uint32_t    totalSize = 0;
 
-    (void) m_pMailboxes->Count(&count);
+    rv = m_pMailboxes->Count(&count);
+
     for (i = 0; i < count; i++) {
       nsCOMPtr<nsIImportMailboxDescriptor> box =
         do_QueryElementAt(m_pMailboxes, i);
       if (box) {
         import = false;
         size = 0;
-        nsresult rv = box->GetImport(&import);
-        if (NS_SUCCEEDED(rv) && import) {
-          (void) box->GetSize(&size);
+        rv = box->GetImport(&import);
+        if (import) {
+          rv = box->GetSize(&size);
           result = true;
         }
         totalSize += size;
       }
     }
 
     m_totalSize = totalSize;
   }