Bug 575156 Apply the needed NS_NEWXPCOM/NS_DELETEXPCOM changes from Bug 562387 to Comm-Central (replace with new/delete). r=Neil,sr=Standard8,a=Standard8 for bustage fix checkin to CLOSED TREE
authorEdmund Wong <ewong@pw-wspx.org>
Mon, 05 Jul 2010 12:06:54 +0100
changeset 5932 5550f06d4b836ef86c32b973f95ebe4e63795b94
parent 5931 70696b52390af62ec32d59cfbcf61288c070a544
child 5933 4178007c058c64f7aedce736c2bd87eac3d2acc9
push idunknown
push userunknown
push dateunknown
reviewersNeil, Standard8, Standard8
bugs575156, 562387
Bug 575156 Apply the needed NS_NEWXPCOM/NS_DELETEXPCOM changes from Bug 562387 to Comm-Central (replace with new/delete). r=Neil,sr=Standard8,a=Standard8 for bustage fix checkin to CLOSED TREE
mailnews/addrbook/src/nsAddrDatabase.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgQuickSearchDBView.cpp
mailnews/base/src/nsMsgSearchDBView.cpp
mailnews/base/src/nsMsgSpecialViews.cpp
mailnews/base/src/nsMsgThreadedDBView.cpp
mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendReport.cpp
--- a/mailnews/addrbook/src/nsAddrDatabase.cpp
+++ b/mailnews/addrbook/src/nsAddrDatabase.cpp
@@ -195,17 +195,17 @@ NS_IMETHODIMP_(nsrefcnt) nsAddrDatabase:
     RemoveFromCache(this);
     // clean up after ourself!
     if (m_mdbPabTable)
       m_mdbPabTable->Release();
     if (m_mdbDeletedCardsTable)
       m_mdbDeletedCardsTable->Release();
     NS_IF_RELEASE(m_mdbStore);
     NS_IF_RELEASE(m_mdbEnv);
-    NS_DELETEXPCOM(this);
+    delete this;
     return 0;
   }
   return count;
 }
 
 NS_IMETHODIMP nsAddrDatabase::QueryInterface(REFNSIID aIID, void** aResult)
 {
     if (aResult == NULL)
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -7184,19 +7184,18 @@ NS_IMETHODIMP nsMsgDBView::SelectMsgByKe
   rv = RestoreSelection(aKey, keyArray);
   NS_ENSURE_SUCCESS(rv,rv);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgDBView* newMsgDBView;
-
-  NS_NEWXPCOM(newMsgDBView, nsMsgDBView);
+  nsMsgDBView* newMsgDBView = new nsMsgDBView();
+
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
   return NS_OK;
--- a/mailnews/base/src/nsMsgQuickSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgQuickSearchDBView.cpp
@@ -76,18 +76,17 @@ NS_IMETHODIMP nsMsgQuickSearchDBView::Op
 }
 
 NS_IMETHODIMP
 nsMsgQuickSearchDBView::CloneDBView(nsIMessenger *aMessengerInstance,
                                     nsIMsgWindow *aMsgWindow,
                                     nsIMsgDBViewCommandUpdater *aCmdUpdater,
                                     nsIMsgDBView **_retval)
 {
-  nsMsgQuickSearchDBView* newMsgDBView;
-  NS_NEWXPCOM(newMsgDBView, nsMsgQuickSearchDBView);
+  nsMsgQuickSearchDBView* newMsgDBView = new nsMsgQuickSearchDBView();
 
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
--- a/mailnews/base/src/nsMsgSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgSearchDBView.cpp
@@ -124,19 +124,18 @@ nsMsgSearchDBView::MsgHdrTableCloner(con
   nsMsgSearchDBView* view = static_cast<nsMsgSearchDBView*>(aArg);
   nsresult rv = view->m_hdrsTable.Put(aKey, aMsgHdr);
   return NS_SUCCEEDED(rv) ? PL_DHASH_NEXT : PL_DHASH_STOP;
 }
 
 NS_IMETHODIMP
 nsMsgSearchDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgSearchDBView* newMsgDBView;
+  nsMsgSearchDBView* newMsgDBView = new nsMsgSearchDBView();
 
-  NS_NEWXPCOM(newMsgDBView, nsMsgSearchDBView);
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
   return NS_OK;
--- a/mailnews/base/src/nsMsgSpecialViews.cpp
+++ b/mailnews/base/src/nsMsgSpecialViews.cpp
@@ -91,18 +91,17 @@ nsresult nsMsgThreadsWithUnreadDBView::A
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgThreadsWithUnreadDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgThreadsWithUnreadDBView* newMsgDBView;
-  NS_NEWXPCOM(newMsgDBView, nsMsgThreadsWithUnreadDBView);
+  nsMsgThreadsWithUnreadDBView* newMsgDBView = new nsMsgThreadsWithUnreadDBView();
 
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
@@ -163,18 +162,17 @@ nsresult nsMsgWatchedThreadsWithUnreadDB
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgWatchedThreadsWithUnreadDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgWatchedThreadsWithUnreadDBView* newMsgDBView;
-  NS_NEWXPCOM(newMsgDBView, nsMsgWatchedThreadsWithUnreadDBView);
+  nsMsgWatchedThreadsWithUnreadDBView* newMsgDBView = new nsMsgWatchedThreadsWithUnreadDBView();
 
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
--- a/mailnews/base/src/nsMsgThreadedDBView.cpp
+++ b/mailnews/base/src/nsMsgThreadedDBView.cpp
@@ -982,18 +982,17 @@ NS_IMETHODIMP nsMsgThreadedDBView::GetVi
     NS_ENSURE_ARG_POINTER(aViewType);
     *aViewType = nsMsgViewType::eShowAllThreads; 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgThreadedDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow, nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgThreadedDBView* newMsgDBView;
-  NS_NEWXPCOM(newMsgDBView, nsMsgThreadedDBView);
+  nsMsgThreadedDBView* newMsgDBView = new nsMsgThreadedDBView();
 
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
--- a/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
+++ b/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
@@ -88,18 +88,17 @@ NS_IMETHODIMP nsMsgXFVirtualFolderDBView
   RemovePendingDBListeners();
   return nsMsgSearchDBView::Close();
 }
 
 NS_IMETHODIMP
 nsMsgXFVirtualFolderDBView::CloneDBView(nsIMessenger *aMessengerInstance, nsIMsgWindow *aMsgWindow,
                                         nsIMsgDBViewCommandUpdater *aCmdUpdater, nsIMsgDBView **_retval)
 {
-  nsMsgXFVirtualFolderDBView* newMsgDBView;
-  NS_NEWXPCOM(newMsgDBView, nsMsgXFVirtualFolderDBView);
+  nsMsgXFVirtualFolderDBView* newMsgDBView = new nsMsgXFVirtualFolderDBView();
 
   if (!newMsgDBView)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv = CopyDBView(newMsgDBView, aMessengerInstance, aMsgWindow, aCmdUpdater);
   NS_ENSURE_SUCCESS(rv,rv);
 
   NS_IF_ADDREF(*_retval = newMsgDBView);
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -1210,18 +1210,18 @@ NS_IMETHODIMP nsMsgAsyncWriteProtocol::C
   if (mAsyncOutStream)
     mAsyncOutStream->CloseWithStatus(status);
 
   return NS_OK;
 }
 
 nsresult nsMsgAsyncWriteProtocol::PostMessage(nsIURI* url, nsIFile *file)
 {
-  nsCOMPtr<nsIStreamListener> listener;
-  NS_NEWXPCOM(listener, nsMsgFilePostHelper);
+  nsCOMPtr<nsIStreamListener> listener = new nsMsgFilePostHelper();
+
   if (!listener) return NS_ERROR_OUT_OF_MEMORY;
 
   // be sure to initialize some state before posting
   mSuspendedReadBytes = 0;
   mNumBytesPosted = 0;
   file->GetFileSize(&mFilePostSize);
   mSuspendedRead = PR_FALSE;
   mInsertPeriodRequired = PR_FALSE;
@@ -1430,18 +1430,18 @@ nsresult nsMsgAsyncWriteProtocol::SetupT
     mInStream = dont_AddRef(static_cast<nsIInputStream *>(inputStream));
 
     nsIAsyncOutputStream *outputStream = nsnull;
     pipe->GetOutputStream(&outputStream);
     m_outputStream = dont_AddRef(static_cast<nsIOutputStream *>(outputStream));
 
     mProviderThread = do_GetCurrentThread();
 
-    nsMsgProtocolStreamProvider *provider;
-    NS_NEWXPCOM(provider, nsMsgProtocolStreamProvider);
+    nsMsgProtocolStreamProvider *provider = new nsMsgProtocolStreamProvider();
+
     if (!provider) return NS_ERROR_OUT_OF_MEMORY;
 
     provider->Init(this, mInStream);
     mProvider = provider; // ADDREF
 
     nsCOMPtr<nsIOutputStream> stream;
     rv = m_transport->OpenOutputStream(0, 0, 0, getter_AddRefs(stream));
     if (NS_FAILED(rv)) return rv;
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1605,17 +1605,17 @@ nsresult nsMsgCompose::CreateMessage(con
   if (compFields)
   {
     NS_IF_RELEASE(m_compFields);
     m_compFields = reinterpret_cast<nsMsgCompFields*>(compFields);
     NS_ADDREF(m_compFields);
   }
   else
   {
-    NS_NEWXPCOM(m_compFields, nsMsgCompFields);
+    m_compFields = new nsMsgCompFields();
     if (m_compFields)
       NS_ADDREF(m_compFields);
     else
       return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsCOMPtr<nsIMsgHeaderParser> parser =
     do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -315,17 +315,17 @@ nsMsgComposeAndSend::nsMsgComposeAndSend
   mNeedToPerformSecondFCC = PR_FALSE;
 
   mPreloadedAttachmentCount = 0;
   mRemoteAttachmentCount = 0;
   mCompFieldLocalAttachments = 0;
   mCompFieldRemoteAttachments = 0;
   mMessageWarningSize = 0;
 
-  NS_NEWXPCOM(mSendReport, nsMsgSendReport);
+  mSendReport = new nsMsgSendReport();
 }
 
 nsMsgComposeAndSend::~nsMsgComposeAndSend()
 {
 #ifdef NS_DEBUG
   printf("\nTHE DESTRUCTOR FOR nsMsgComposeAndSend() WAS CALLED\n");
 #endif
   PR_Free(m_attachment1_type);
--- a/mailnews/compose/src/nsMsgSendReport.cpp
+++ b/mailnews/compose/src/nsMsgSendReport.cpp
@@ -109,17 +109,17 @@ NS_IMETHODIMP nsMsgProcessReport::Reset(
 
 
 NS_IMPL_ISUPPORTS1(nsMsgSendReport, nsIMsgSendReport)
 
 nsMsgSendReport::nsMsgSendReport()
 {
   PRUint32 i;
   for (i = 0; i <= SEND_LAST_PROCESS; i ++)
-    NS_NEWXPCOM(mProcessReport[i], nsMsgProcessReport);
+    mProcessReport[i] = new nsMsgProcessReport();
 
   Reset(); 
 }
 
 nsMsgSendReport::~nsMsgSendReport()
 {
   PRUint32 i;
   for (i = 0; i <= SEND_LAST_PROCESS; i ++)