Bug 1485275 - Port bug 1484118: replace XPCOM use of nsTransactionManager in mailnews/. r=masayuki
authorJorg K <jorgk@jorgk.com>
Thu, 23 Aug 2018 00:09:46 +0200
changeset 24543 fd4696b16ee2860e4a27608b84609523978c2c10
parent 24542 b94f1e4b62e6effb2d18941caf6787394ca29cba
child 24544 a8bd1c32fd2d217f660bd11216e8e59ad37739a6
push id14775
push usermozilla@jorgk.com
push dateWed, 22 Aug 2018 22:12:24 +0000
treeherdercomm-central@fd4696b16ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1485275, 1484118
Bug 1485275 - Port bug 1484118: replace XPCOM use of nsTransactionManager in mailnews/. r=masayuki
mailnews/base/src/nsMsgWindow.cpp
--- a/mailnews/base/src/nsMsgWindow.cpp
+++ b/mailnews/base/src/nsMsgWindow.cpp
@@ -28,18 +28,17 @@
 #include "nsMsgI18N.h"
 #include "nsIWebNavigation.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);
+#include "mozilla/TransactionManager.h"
 
 NS_IMPL_ISUPPORTS(nsMsgWindow,
                               nsIMsgWindow,
                               nsIURIContentListener,
                               nsISupportsWeakReference,
                               nsIMsgWindowTest)
 
 nsMsgWindow::nsMsgWindow()
@@ -61,18 +60,17 @@ nsresult nsMsgWindow::Init()
            do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = dispatcher->RegisterContentListener(this);
   if (NS_FAILED(rv))
     return rv;
 
   // create Undo/Redo Transaction Manager
-  mTransactionManager = do_CreateInstance(kTransactionManagerCID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
+  mTransactionManager = new mozilla::TransactionManager();
   return mTransactionManager->SetMaxTransactionCount(-1);
 }
 
 NS_IMETHODIMP nsMsgWindow::GetMessageWindowDocShell(nsIDocShell ** aDocShell)
 {
   *aDocShell = nullptr;
   nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mMessageWindowDocShellWeak));
   if (!docShell)