Bug 1376414 - Port bug 1372405 to mailnews [Name all runnables]. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Tue, 27 Jun 2017 16:31:22 +0200
changeset 28391 6ccad3aa817af34d04fd8585ba0ce642f0b9193b
parent 28390 c12eb289096742bbea17a9a2b423fa58f15d689a
child 28392 5fa28162667593695c42a6709bc814dbcbc29cf5
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1376414, 1372405
Bug 1376414 - Port bug 1372405 to mailnews [Name all runnables]. rs=bustage-fix
calendar/base/backend/libical/calICSService.h
ldap/xpcom/src/nsLDAPConnection.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgContentPolicy.cpp
mailnews/base/src/nsMsgPrintEngine.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsSyncRunnableHelpers.cpp
mailnews/import/becky/src/nsBeckyMail.cpp
mailnews/import/src/nsImportMail.cpp
mailnews/import/src/nsImportService.cpp
mailnews/mime/src/mimecms.cpp
--- a/calendar/base/backend/libical/calICSService.h
+++ b/calendar/base/backend/libical/calICSService.h
@@ -23,16 +23,17 @@ protected:
     virtual ~calICSService() {}
     class ParserWorker : public mozilla::Runnable {
     public:
       ParserWorker(nsIThread *mainThread,
                    nsIThread *workerThread,
                    const nsACString &icsString,
                    calITimezoneProvider *tzProvider,
                    calIIcsComponentParsingListener *listener) :
+        mozilla::Runnable("ParserWorker"),
         mString(icsString), mProvider(tzProvider),
         mMainThread(mainThread), mWorkerThread(workerThread)
       {
         mListener = new nsMainThreadPtrHolder<calIIcsComponentParsingListener>("calICSService::mListener", listener);
       }
 
       NS_DECL_NSIRUNNABLE
 
@@ -44,16 +45,17 @@ protected:
       nsCOMPtr<nsIThread> mWorkerThread;
 
       class ParserWorkerCompleter : public mozilla::Runnable {
       public:
         ParserWorkerCompleter(nsIThread *workerThread,
                               nsresult status,
                               calIIcalComponent *component,
                               const nsMainThreadPtrHandle<calIIcsComponentParsingListener> &listener) :
+          mozilla::Runnable("ParserWorkerCompleter"),
           mWorkerThread(workerThread), mListener(listener),
           mComp(component), mStatus(status)
         {
         }
 
         NS_DECL_NSIRUNNABLE
       protected:
         nsCOMPtr<nsIThread> mWorkerThread;
--- a/ldap/xpcom/src/nsLDAPConnection.cpp
+++ b/ldap/xpcom/src/nsLDAPConnection.cpp
@@ -377,17 +377,18 @@ nsLDAPConnection::RemovePendingOperation
 
   return NS_OK;
 }
 
 class nsOnLDAPMessageRunnable : public Runnable
 {
 public:
   nsOnLDAPMessageRunnable(nsLDAPMessage *aMsg, bool aClear)
-    : m_msg(aMsg)
+    : Runnable("nsOnLDAPMessageRunnable")
+    , m_msg(aMsg)
     , m_clear(aClear)
   {}
   NS_DECL_NSIRUNNABLE
 private:
   RefPtr<nsLDAPMessage> m_msg;
   bool m_clear;
 };
 
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -2503,17 +2503,18 @@ nsMsgAccountManager::GetChromePackageNam
   return NS_ERROR_UNEXPECTED;
 }
 
 class VFChangeListenerEvent : public mozilla::Runnable
 {
 public:
   VFChangeListenerEvent(VirtualFolderChangeListener *vfChangeListener,
                         nsIMsgFolder *virtFolder, nsIMsgDatabase *virtDB)
-    : mVFChangeListener(vfChangeListener), mFolder(virtFolder), mDB(virtDB)
+    : mozilla::Runnable("VFChangeListenerEvent")
+    , mVFChangeListener(vfChangeListener), mFolder(virtFolder), mDB(virtDB)
   {}
 
   NS_IMETHOD Run()
   {
     if (mVFChangeListener)
       mVFChangeListener->ProcessUpdateEvent(mFolder, mDB);
     return NS_OK;
   }
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -526,17 +526,18 @@ nsMsgContentPolicy::ShouldAcceptRemoteCo
   return result;
 }
 
 class RemoteContentNotifierEvent : public mozilla::Runnable
 {
 public:
   RemoteContentNotifierEvent(nsIMsgWindow *aMsgWindow, nsIMsgDBHdr *aMsgHdr,
                              nsIURI *aContentURI)
-    : mMsgWindow(aMsgWindow), mMsgHdr(aMsgHdr), mContentURI(aContentURI)
+    : mozilla::Runnable("RemoteContentNotifierEvent")
+    , mMsgWindow(aMsgWindow), mMsgHdr(aMsgHdr), mContentURI(aContentURI)
   {}
 
   NS_IMETHOD Run()
   {
     if (mMsgWindow)
     {
       nsCOMPtr<nsIMsgHeaderSink> msgHdrSink;
       (void)mMsgWindow->GetMsgHeaderSink(getter_AddRefs(msgHdrSink));
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -651,17 +651,17 @@ nsMsgPrintEngine::PrintMsgWindow()
 //-- Event Notification
 //---------------------------------------------------------------
 
 //---------------------------------------------------------------
 class nsPrintMsgWindowEvent : public mozilla::Runnable
 {
 public:
   nsPrintMsgWindowEvent(nsMsgPrintEngine *mpe)
-    : mMsgPrintEngine(mpe)
+    : mozilla::Runnable("nsPrintMsgWindowEvent"), mMsgPrintEngine(mpe)
   {}
 
   NS_IMETHOD Run()
   {
     if (mMsgPrintEngine) 
       mMsgPrintEngine->PrintMsgWindow();
     return NS_OK;
   }
@@ -670,17 +670,17 @@ private:
   RefPtr<nsMsgPrintEngine> mMsgPrintEngine;
 };
 
 //-----------------------------------------------------------
 class nsStartNextPrintOpEvent : public mozilla::Runnable
 {
 public:
   nsStartNextPrintOpEvent(nsMsgPrintEngine *mpe)
-    : mMsgPrintEngine(mpe)
+    : mozilla::Runnable("nsStartNextPrintOpEvent"), mMsgPrintEngine(mpe)
   {}
 
   NS_IMETHOD Run()
   {
     if (mMsgPrintEngine) 
       mMsgPrintEngine->StartNextPrintOperation();
     return NS_OK;
   }
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -1795,17 +1795,18 @@ nsresult nsMsgDBFolder::CompactOfflineSt
   NS_ENSURE_SUCCESS(rv, rv);
   return folderCompactor->Compact(this, true, aListener, inWindow);
 }
 
 class AutoCompactEvent : public mozilla::Runnable
 {
 public:
   AutoCompactEvent(nsIMsgWindow *aMsgWindow, nsMsgDBFolder *aFolder)
-    : mMsgWindow(aMsgWindow), mFolder(aFolder)
+    : mozilla::Runnable("AutoCompactEvent")
+    , mMsgWindow(aMsgWindow), mFolder(aFolder)
   {}
 
   NS_IMETHOD Run()
   {
     if (mFolder)
       mFolder->HandleAutoCompactEvent(mMsgWindow);
     return NS_OK;
   }
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -1037,29 +1037,31 @@ void nsImapProtocol::ReleaseUrlState(boo
     NS_ReleaseOnMainThread("nsImapProtocol::m_runningUrl", mailnewsurl.forget());
   }
   saveFolderSink = nullptr;
 }
 
 
 class nsImapThreadShutdownEvent : public mozilla::Runnable {
 public:
-  nsImapThreadShutdownEvent(nsIThread *thread) : mThread(thread) {
+  nsImapThreadShutdownEvent(nsIThread *thread)
+    : mozilla::Runnable("nsImapThreadShutdownEvent"), mThread(thread) {
   }
   NS_IMETHOD Run() {
     mThread->Shutdown();
     return NS_OK;
   }
 private:
   nsCOMPtr<nsIThread> mThread;
 };
 
 class nsImapCancelProxy : public mozilla::Runnable {
 public:
-  nsImapCancelProxy(nsICancelable *aProxyRequest) : m_proxyRequest(aProxyRequest) {
+  nsImapCancelProxy(nsICancelable *aProxyRequest)
+    : mozilla::Runnable("nsImapCancelProxy"), m_proxyRequest(aProxyRequest) {
   }
   NS_IMETHOD Run() {
     m_proxyRequest->Cancel(NS_BINDING_ABORTED);
     return NS_OK;
   }
 private:
   nsCOMPtr<nsICancelable> m_proxyRequest;
 };
@@ -2065,17 +2067,18 @@ nsresult nsImapProtocol::ProcessProtocol
 {
   return NS_OK;
 }
 
 class UrlListenerNotifierEvent : public mozilla::Runnable
 {
 public:
   UrlListenerNotifierEvent(nsIMsgMailNewsUrl *aUrl, nsIImapProtocol *aProtocol)
-    : mUrl(aUrl), mProtocol(aProtocol)
+    : mozilla::Runnable("UrlListenerNotifierEvent")
+    , mUrl(aUrl), mProtocol(aProtocol)
   {}
 
   NS_IMETHOD Run()
   {
     if (mUrl)
     {
       nsCOMPtr<nsIMsgFolder> folder;
       mUrl->GetFolder(getter_AddRefs(folder));
@@ -9621,17 +9624,18 @@ nsresult nsImapMockChannel::ReadFromMemC
 
   return rv;
 }
 
 class nsReadFromImapConnectionFailure : public mozilla::Runnable
 {
 public:
   nsReadFromImapConnectionFailure(nsImapMockChannel *aChannel)
-    : mImapMockChannel(aChannel)
+    : mozilla::Runnable("nsReadFromImapConnectionFailure")
+    , mImapMockChannel(aChannel)
   {}
 
   NS_IMETHOD Run()
   {
     if (mImapMockChannel) {
       mImapMockChannel->RunOnStopRequestFailure();
     }
     return NS_OK;
--- a/mailnews/imap/src/nsSyncRunnableHelpers.cpp
+++ b/mailnews/imap/src/nsSyncRunnableHelpers.cpp
@@ -64,17 +64,18 @@ public:
   }
 
   mozilla::Monitor& Monitor() {
     return mMonitor;
   }
 
 protected:
   SyncRunnableBase()
-    : mResult(NS_ERROR_UNEXPECTED)
+    : mozilla::Runnable("SyncRunnableBase")
+    , mResult(NS_ERROR_UNEXPECTED)
     , mMonitor("SyncRunnableBase")
   { }
 
   nsresult mResult;
   mozilla::Monitor mMonitor;
 };
 
 template<typename Receiver>
@@ -497,17 +498,17 @@ bool OAuth2ThreadHelper::SupportsOAuth2(
   if (NS_IsMainThread())
   {
     MonitorAutoUnlock lockGuard(mMonitor);
     Init();
   }
   else
   {
     nsCOMPtr<nsIRunnable> runInit =
-      NewRunnableMethod(this, &OAuth2ThreadHelper::Init);
+      NewRunnableMethod("OAuth2ThreadHelper::SupportsOAuth2", this, &OAuth2ThreadHelper::Init);
     NS_DispatchToMainThread(runInit);
     mMonitor.Wait();
   }
 
   // After synchronously initializing, if we didn't get an object, then we don't
   // support XOAuth2.
   return mOAuth2Support != nullptr;
 }
@@ -520,17 +521,17 @@ void OAuth2ThreadHelper::GetXOAuth2Strin
   // issues.
   MonitorAutoLock lockGuard(mMonitor);
 
   // Umm... what are you trying to do?
   if (!mOAuth2Support)
     return;
 
   nsCOMPtr<nsIRunnable> runInit =
-    NewRunnableMethod(this, &OAuth2ThreadHelper::Connect);
+    NewRunnableMethod("OAuth2ThreadHelper::GetXOAuth2String", this, &OAuth2ThreadHelper::Connect);
   NS_DispatchToMainThread(runInit);
   mMonitor.Wait();
 
   // Now we either have the string, or we failed (in which case the string is
   // empty).
   base64Str = mOAuth2String;
 }
 
--- a/mailnews/import/becky/src/nsBeckyMail.cpp
+++ b/mailnews/import/becky/src/nsBeckyMail.cpp
@@ -384,16 +384,17 @@ private:
                                nsIOutputStream *aOutputStream);
 
   nsCOMPtr<nsIFile> mMessageFile;
   nsCOMPtr<nsIMsgFolder> mFolder;
 };
 
 ImportMessageRunnable::ImportMessageRunnable(nsIFile *aMessageFile,
                                              nsIMsgFolder *aFolder) :
+  mozilla::Runnable("ImportMessageRunnable"),
   mMessageFile(aMessageFile), mFolder(aFolder)
 {
 }
 
 nsresult
 ImportMessageRunnable::WriteHeaders(nsCString &aHeaders,
                                     nsIOutputStream *aOutputStream)
 {
--- a/mailnews/import/src/nsImportMail.cpp
+++ b/mailnews/import/src/nsImportMail.cpp
@@ -991,17 +991,17 @@ class GetSubFoldersRunnable : public moz
 public:
   GetSubFoldersRunnable(nsIMsgFolder *aFolder);
   NS_DECL_NSIRUNNABLE
 private:
   nsCOMPtr<nsIMsgFolder> m_folder;
 };
 
 GetSubFoldersRunnable::GetSubFoldersRunnable(nsIMsgFolder *aFolder) :
-  m_folder(aFolder)
+  mozilla::Runnable("GetSubFoldersRunnable"), m_folder(aFolder)
 {
 }
 
 NS_IMETHODIMP GetSubFoldersRunnable::Run()
 {
   nsCOMPtr<nsISimpleEnumerator> dummy;
   return m_folder->GetSubFolders(getter_AddRefs(dummy));
 }
@@ -1023,16 +1023,17 @@ protected:
   nsCOMPtr<nsIMsgFolder> m_folder;
   nsString m_name;
   nsIMsgFolder **m_child;
 };
 
 GetChildNamedRunnable::GetChildNamedRunnable(nsIMsgFolder *aFolder,
                                              const nsAString & aName,
                                              nsIMsgFolder **aChild) :
+  mozilla::Runnable("GetChildNamedRunnable"),
   m_folder(aFolder), m_name(aName), m_child(aChild)
 {
 }
 
 NS_IMETHODIMP GetChildNamedRunnable::Run()
 {
   return m_folder->GetChildNamed(m_name, m_child);
 }
@@ -1052,17 +1053,17 @@ public:
   GetParentRunnable(nsIMsgFolder *aFolder, nsIMsgFolder **aParent);
   NS_DECL_NSIRUNNABLE
 protected:
   nsCOMPtr<nsIMsgFolder> m_folder;
   nsIMsgFolder **m_parent;
 };
 
 GetParentRunnable::GetParentRunnable(nsIMsgFolder *aFolder, nsIMsgFolder **aParent) :
-  m_folder(aFolder), m_parent(aParent)
+  mozilla::Runnable("GetParentRunnable"), m_folder(aFolder), m_parent(aParent)
 {
 }
 
 NS_IMETHODIMP GetParentRunnable::Run()
 {
   return m_folder->GetParent(m_parent);
 }
 
@@ -1083,16 +1084,17 @@ protected:
   nsCOMPtr<nsIMsgFolder> m_folder;
   nsString m_name;
   bool *m_result;
 };
 
 ContainsChildNamedRunnable::ContainsChildNamedRunnable(nsIMsgFolder *aFolder,
                                                        const nsAString &aName,
                                                        bool *aResult) :
+  mozilla::Runnable("ContainsChildNamedRunnable"),
   m_folder(aFolder), m_name(aName), m_result(aResult)
 {
 }
 
 NS_IMETHODIMP ContainsChildNamedRunnable::Run()
 {
   return m_folder->ContainsChildNamed(m_name, m_result);
 }
@@ -1120,17 +1122,18 @@ protected:
   nsString m_prefix;
   nsCOMPtr<nsIMsgFolder> m_otherFolder;
   nsString m_name;
 };
 
 GenerateUniqueSubfolderNameRunnable::GenerateUniqueSubfolderNameRunnable(
   nsIMsgFolder *aFolder, const nsAString& aPrefix, nsIMsgFolder *aOtherFolder,
   nsAString& aName)
-  : m_folder(aFolder), m_prefix(aPrefix), m_otherFolder(aOtherFolder), m_name(aName)
+  : mozilla::Runnable("GenerateUniqueSubfolderNameRunnable")
+  , m_folder(aFolder), m_prefix(aPrefix), m_otherFolder(aOtherFolder), m_name(aName)
 {
 }
 
 NS_IMETHODIMP GenerateUniqueSubfolderNameRunnable::Run()
 {
   return m_folder->GenerateUniqueSubfolderName(m_prefix, m_otherFolder, m_name);
 }
 
@@ -1153,17 +1156,17 @@ public:
   NS_DECL_NSIRUNNABLE
 protected:
   nsCOMPtr<nsIMsgFolder> m_folder;
   nsString m_name;
 };
 
 CreateSubfolderRunnable::CreateSubfolderRunnable(nsIMsgFolder *aFolder,
                                                  const nsAString &aName) :
-  m_folder(aFolder), m_name(aName)
+  mozilla::Runnable("CreateSubfolderRunnable"), m_folder(aFolder), m_name(aName)
 {
 }
 
 NS_IMETHODIMP CreateSubfolderRunnable::Run()
 {
   return m_folder->CreateSubfolder(m_name, nullptr);
 }
 
@@ -1180,17 +1183,17 @@ class ForceDBClosedRunnable : public moz
 public:
   ForceDBClosedRunnable(nsIMsgFolder *aFolder);
   NS_DECL_NSIRUNNABLE
 protected:
   nsCOMPtr<nsIMsgFolder> m_folder;
 };
 
 ForceDBClosedRunnable::ForceDBClosedRunnable(nsIMsgFolder *aFolder) :
-  m_folder(aFolder)
+  mozilla::Runnable("ForceDBClosedRunnable"), m_folder(aFolder)
 {
 }
 
 NS_IMETHODIMP ForceDBClosedRunnable::Run()
 {
   return m_folder->ForceDBClosed();
 }
 
--- a/mailnews/import/src/nsImportService.cpp
+++ b/mailnews/import/src/nsImportService.cpp
@@ -299,16 +299,17 @@ private:
 nsProxySendRunnable::nsProxySendRunnable(nsIMsgIdentity *aIdentity,
                                          nsIMsgCompFields *aMsgFields,
                                          const char *aBodyType,
                                          const nsACString &aBody,
                                          bool aIsDraft,
                                          nsIArray *aLoadedAttachments,
                                          nsIArray *aEmbeddedAttachments,
                                          nsIMsgSendListener *aListener) :
+  mozilla::Runnable("nsProxySendRunnable"),
   m_identity(aIdentity), m_compFields(aMsgFields),
   m_isDraft(aIsDraft), m_bodyType(aBodyType),
   m_body(aBody), m_loadedAttachments(aLoadedAttachments),
   m_embeddedAttachments(aEmbeddedAttachments),
   m_listener(aListener)
 {
 }
 
--- a/mailnews/mime/src/mimecms.cpp
+++ b/mailnews/mime/src/mimecms.cpp
@@ -253,16 +253,17 @@ protected:
   int32_t m_signatureStatus;
   nsCOMPtr<nsIX509Cert> m_signerCert;
 };
 
 SignedStatusRunnable::SignedStatusRunnable(const nsMainThreadPtrHandle<nsIMsgSMIMEHeaderSink> &aSink,
                                            int32_t aNestingLevel,
                                            int32_t aSignatureStatus,
                                            nsIX509Cert *aSignerCert) :
+  mozilla::Runnable("SignedStatusRunnable"),
   m_sink(aSink), m_nestingLevel(aNestingLevel),
   m_signatureStatus(aSignatureStatus), m_signerCert(aSignerCert)
 {
 }
 
 NS_IMETHODIMP SignedStatusRunnable::Run()
 {
   return m_sink->SignedStatus(m_nestingLevel, m_signatureStatus, m_signerCert);