Bug 884061 - Part 3s: Use NS_DECL_THREADSAFE_ISUPPORTS in security/, r=bsmith
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 18 Jul 2013 21:24:14 -0500
changeset 151902 81a52416513ec0afc616ed0befc2839d1f3d08dc
parent 151901 3bd71784e8a01a6acbb827a21189e2252cef3c74
child 151903 f3e3a8389cdf19d286f46a62543929e524c4ff28
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmith
bugs884061
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 884061 - Part 3s: Use NS_DECL_THREADSAFE_ISUPPORTS in security/, r=bsmith
security/manager/boot/src/nsEntropyCollector.cpp
security/manager/boot/src/nsEntropyCollector.h
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
security/manager/boot/src/nsSecureBrowserUIImpl.h
security/manager/boot/src/nsSecurityWarningDialogs.cpp
security/manager/boot/src/nsSecurityWarningDialogs.h
security/manager/boot/src/nsStrictTransportSecurityService.cpp
security/manager/boot/src/nsStrictTransportSecurityService.h
security/manager/pki/src/nsASN1Tree.cpp
security/manager/pki/src/nsASN1Tree.h
security/manager/pki/src/nsFormSigningDialog.cpp
security/manager/pki/src/nsFormSigningDialog.h
security/manager/pki/src/nsNSSDialogs.cpp
security/manager/pki/src/nsNSSDialogs.h
security/manager/pki/src/nsPKIParamBlock.cpp
security/manager/pki/src/nsPKIParamBlock.h
security/manager/ssl/src/TransportSecurityInfo.cpp
security/manager/ssl/src/TransportSecurityInfo.h
security/manager/ssl/src/nsCMS.cpp
security/manager/ssl/src/nsCMS.h
security/manager/ssl/src/nsCertOverrideService.cpp
security/manager/ssl/src/nsCertOverrideService.h
security/manager/ssl/src/nsCertVerificationThread.cpp
security/manager/ssl/src/nsClientAuthRemember.cpp
security/manager/ssl/src/nsClientAuthRemember.h
security/manager/ssl/src/nsKeyModule.cpp
security/manager/ssl/src/nsKeyModule.h
security/manager/ssl/src/nsKeygenHandler.cpp
security/manager/ssl/src/nsKeygenHandler.h
security/manager/ssl/src/nsKeygenThread.cpp
security/manager/ssl/src/nsKeygenThread.h
security/manager/ssl/src/nsNSSASN1Object.cpp
security/manager/ssl/src/nsNSSASN1Object.h
security/manager/ssl/src/nsNSSCallbacks.cpp
security/manager/ssl/src/nsNSSCallbacks.h
security/manager/ssl/src/nsNSSCertCache.cpp
security/manager/ssl/src/nsNSSCertCache.h
security/manager/ssl/src/nsNSSCertValidity.cpp
security/manager/ssl/src/nsNSSCertValidity.h
security/manager/ssl/src/nsNSSCertificate.cpp
security/manager/ssl/src/nsNSSCertificate.h
security/manager/ssl/src/nsNSSCertificateDB.cpp
security/manager/ssl/src/nsNSSCertificateDB.h
security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
security/manager/ssl/src/nsNSSCertificateFakeTransport.h
security/manager/ssl/src/nsNSSComponent.cpp
security/manager/ssl/src/nsNSSComponent.h
security/manager/ssl/src/nsNSSHelper.h
security/manager/ssl/src/nsNSSIOLayer.cpp
security/manager/ssl/src/nsProtectedAuthThread.cpp
security/manager/ssl/src/nsProtectedAuthThread.h
security/manager/ssl/src/nsRandomGenerator.cpp
security/manager/ssl/src/nsRandomGenerator.h
security/manager/ssl/src/nsRecentBadCerts.cpp
security/manager/ssl/src/nsRecentBadCerts.h
security/manager/ssl/src/nsSSLSocketProvider.cpp
security/manager/ssl/src/nsSSLSocketProvider.h
security/manager/ssl/src/nsSSLStatus.cpp
security/manager/ssl/src/nsSSLStatus.h
security/manager/ssl/src/nsTLSSocketProvider.cpp
security/manager/ssl/src/nsTLSSocketProvider.h
security/manager/ssl/src/nsVerificationJob.h
--- a/security/manager/boot/src/nsEntropyCollector.cpp
+++ b/security/manager/boot/src/nsEntropyCollector.cpp
@@ -18,19 +18,19 @@ nsEntropyCollector::nsEntropyCollector()
   // entropy.
   memset(mEntropyCache, 0, sizeof(mEntropyCache));
 }
 
 nsEntropyCollector::~nsEntropyCollector()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsEntropyCollector,
-                              nsIEntropyCollector,
-                              nsIBufEntropyCollector)
+NS_IMPL_ISUPPORTS2(nsEntropyCollector,
+                   nsIEntropyCollector,
+                   nsIBufEntropyCollector)
 
 NS_IMETHODIMP
 nsEntropyCollector::RandomUpdate(void *new_entropy, int32_t bufLen)
 {
   if (bufLen > 0) {
     if (mForwardTarget) {
       return mForwardTarget->RandomUpdate(new_entropy, bufLen);
     }
--- a/security/manager/boot/src/nsEntropyCollector.h
+++ b/security/manager/boot/src/nsEntropyCollector.h
@@ -15,17 +15,17 @@
  {0x91, 0x12, 0xb7, 0x82, 0xb0, 0x8c, 0x0a, 0xdd} }
 
 class nsEntropyCollector : public nsIBufEntropyCollector
 {
   public:
     nsEntropyCollector();
     virtual ~nsEntropyCollector();
 
-    NS_DECL_ISUPPORTS
+    NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIENTROPYCOLLECTOR
     NS_DECL_NSIBUFENTROPYCOLLECTOR
 
     enum { entropy_buffer_size = 1024 };
 
   protected:
     unsigned char mEntropyCache[entropy_buffer_size];
     int32_t mBytesCollected;
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -145,23 +145,23 @@ nsSecureBrowserUIImpl::nsSecureBrowserUI
 nsSecureBrowserUIImpl::~nsSecureBrowserUIImpl()
 {
   if (mTransferringRequests.ops) {
     PL_DHashTableFinish(&mTransferringRequests);
     mTransferringRequests.ops = nullptr;
   }
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS6(nsSecureBrowserUIImpl,
-                              nsISecureBrowserUI,
-                              nsIWebProgressListener,
-                              nsIFormSubmitObserver,
-                              nsIObserver,
-                              nsISupportsWeakReference,
-                              nsISSLStatusProvider)
+NS_IMPL_ISUPPORTS6(nsSecureBrowserUIImpl,
+                   nsISecureBrowserUI,
+                   nsIWebProgressListener,
+                   nsIFormSubmitObserver,
+                   nsIObserver,
+                   nsISupportsWeakReference,
+                   nsISSLStatusProvider)
 
 NS_IMETHODIMP
 nsSecureBrowserUIImpl::Init(nsIDOMWindow *aWindow)
 {
 
 #ifdef PR_LOGGING
   nsCOMPtr<nsIDOMWindow> window(do_QueryReferent(mWindow));
 
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.h
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.h
@@ -43,17 +43,17 @@ class nsSecureBrowserUIImpl : public nsI
                               public nsSupportsWeakReference,
                               public nsISSLStatusProvider
 {
 public:
   
   nsSecureBrowserUIImpl();
   virtual ~nsSecureBrowserUIImpl();
   
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIWEBPROGRESSLISTENER
   NS_DECL_NSISECUREBROWSERUI
   
   // nsIObserver
   NS_DECL_NSIOBSERVER
   NS_DECL_NSISSLSTATUSPROVIDER
 
   NS_IMETHOD Notify(nsIDOMHTMLFormElement* formNode, nsIDOMWindow* window,
--- a/security/manager/boot/src/nsSecurityWarningDialogs.cpp
+++ b/security/manager/boot/src/nsSecurityWarningDialogs.cpp
@@ -14,17 +14,17 @@
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsThreadUtils.h"
 
 #include "mozilla/Telemetry.h"
 #include "nsISecurityUITelemetry.h"
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsSecurityWarningDialogs, nsISecurityWarningDialogs)
+NS_IMPL_ISUPPORTS1(nsSecurityWarningDialogs, nsISecurityWarningDialogs)
 
 #define STRING_BUNDLE_URL    "chrome://pipnss/locale/security.properties"
 
 nsSecurityWarningDialogs::nsSecurityWarningDialogs()
 {
 }
 
 nsSecurityWarningDialogs::~nsSecurityWarningDialogs()
--- a/security/manager/boot/src/nsSecurityWarningDialogs.h
+++ b/security/manager/boot/src/nsSecurityWarningDialogs.h
@@ -10,17 +10,17 @@
 #include "nsISecurityWarningDialogs.h"
 #include "nsIPrefBranch.h"
 #include "nsIStringBundle.h"
 #include "nsCOMPtr.h"
 
 class nsSecurityWarningDialogs : public nsISecurityWarningDialogs
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISECURITYWARNINGDIALOGS
 
   nsSecurityWarningDialogs();
   virtual ~nsSecurityWarningDialogs();
 
   nsresult Init();
 
 protected:
--- a/security/manager/boot/src/nsStrictTransportSecurityService.cpp
+++ b/security/manager/boot/src/nsStrictTransportSecurityService.cpp
@@ -78,19 +78,19 @@ nsStrictTransportSecurityService::nsStri
   : mUsePreloadList(true)
 {
 }
 
 nsStrictTransportSecurityService::~nsStrictTransportSecurityService()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsStrictTransportSecurityService,
-                              nsIObserver,
-                              nsIStrictTransportSecurityService)
+NS_IMPL_ISUPPORTS2(nsStrictTransportSecurityService,
+                   nsIObserver,
+                   nsIStrictTransportSecurityService)
 
 nsresult
 nsStrictTransportSecurityService::Init()
 {
    nsresult rv;
 
    mPermMgr = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);
--- a/security/manager/boot/src/nsStrictTransportSecurityService.h
+++ b/security/manager/boot/src/nsStrictTransportSecurityService.h
@@ -120,17 +120,17 @@ class nsSTSHostEntry : public PLDHashEnt
 ////////////////////////////////////////////////////////////////////////////////
 
 class nsSTSPreload;
 
 class nsStrictTransportSecurityService : public nsIStrictTransportSecurityService
                                        , public nsIObserver
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSISTRICTTRANSPORTSECURITYSERVICE
 
   nsStrictTransportSecurityService();
   nsresult Init();
   virtual ~nsStrictTransportSecurityService();
 
 private:
--- a/security/manager/pki/src/nsASN1Tree.cpp
+++ b/security/manager/pki/src/nsASN1Tree.cpp
@@ -3,18 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsASN1Tree.h"
 #include "nsIComponentManager.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSASN1Tree, nsIASN1Tree, 
-                                                 nsITreeView)
+NS_IMPL_ISUPPORTS2(nsNSSASN1Tree, nsIASN1Tree, nsITreeView)
 
 nsNSSASN1Tree::nsNSSASN1Tree() 
 :mTopNode(nullptr)
 {
 }
 
 nsNSSASN1Tree::~nsNSSASN1Tree()
 {
--- a/security/manager/pki/src/nsASN1Tree.h
+++ b/security/manager/pki/src/nsASN1Tree.h
@@ -21,17 +21,17 @@
    0x11b2,                                   \
    {0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \
   }
   
 
 class nsNSSASN1Tree : public nsIASN1Tree
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIASN1TREE
   NS_DECL_NSITREEVIEW
   
   nsNSSASN1Tree();
   virtual ~nsNSSASN1Tree();
 protected:
 
   class myNode
--- a/security/manager/pki/src/nsFormSigningDialog.cpp
+++ b/security/manager/pki/src/nsFormSigningDialog.cpp
@@ -16,17 +16,17 @@
 nsFormSigningDialog::nsFormSigningDialog()
 {
 }
 
 nsFormSigningDialog::~nsFormSigningDialog()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsFormSigningDialog, nsIFormSigningDialog)
+NS_IMPL_ISUPPORTS1(nsFormSigningDialog, nsIFormSigningDialog)
 
 NS_IMETHODIMP
 nsFormSigningDialog::ConfirmSignText(nsIInterfaceRequestor *aContext, 
                                      const nsAString &aHost,
                                      const nsAString &aSignText,
                                      const PRUnichar **aCertNickList,
                                      const PRUnichar **aCertDetailsList,
                                      uint32_t aCount, int32_t *aSelectedIndex,
--- a/security/manager/pki/src/nsFormSigningDialog.h
+++ b/security/manager/pki/src/nsFormSigningDialog.h
@@ -13,13 +13,13 @@
     { 0x8d, 0x5a, 0x31, 0x11, 0xa6, 0xd1, 0x7e, 0xc7 }}
 
 class nsFormSigningDialog MOZ_FINAL : public nsIFormSigningDialog
 {
 public:
   nsFormSigningDialog();
   ~nsFormSigningDialog();
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIFORMSIGNINGDIALOG
 };
 
 #endif
--- a/security/manager/pki/src/nsNSSDialogs.cpp
+++ b/security/manager/pki/src/nsNSSDialogs.cpp
@@ -42,24 +42,24 @@
 nsNSSDialogs::nsNSSDialogs()
 {
 }
 
 nsNSSDialogs::~nsNSSDialogs()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS8(nsNSSDialogs, nsITokenPasswordDialogs,
-                                            nsICertificateDialogs,
-                                            nsIClientAuthDialogs,
-                                            nsICertPickDialogs,
-                                            nsITokenDialogs,
-                                            nsIDOMCryptoDialogs,
-                                            nsIGeneratingKeypairInfoDialogs,
-                                            nsISSLCertErrorDialog)
+NS_IMPL_ISUPPORTS8(nsNSSDialogs, nsITokenPasswordDialogs,
+                   nsICertificateDialogs,
+                   nsIClientAuthDialogs,
+                   nsICertPickDialogs,
+                   nsITokenDialogs,
+                   nsIDOMCryptoDialogs,
+                   nsIGeneratingKeypairInfoDialogs,
+                   nsISSLCertErrorDialog)
 
 nsresult
 nsNSSDialogs::Init()
 {
   nsresult rv;
 
   nsCOMPtr<nsIStringBundleService> service =
            do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
--- a/security/manager/pki/src/nsNSSDialogs.h
+++ b/security/manager/pki/src/nsNSSDialogs.h
@@ -29,17 +29,17 @@ class nsNSSDialogs
   public nsIClientAuthDialogs,
   public nsICertPickDialogs,
   public nsITokenDialogs,
   public nsIDOMCryptoDialogs,
   public nsIGeneratingKeypairInfoDialogs,
   public nsISSLCertErrorDialog
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITOKENPASSWORDDIALOGS
   NS_DECL_NSICERTIFICATEDIALOGS
   NS_DECL_NSICLIENTAUTHDIALOGS
   NS_DECL_NSICERTPICKDIALOGS
   NS_DECL_NSITOKENDIALOGS
   NS_DECL_NSIDOMCRYPTODIALOGS
   NS_DECL_NSIGENERATINGKEYPAIRINFODIALOGS
   NS_DECL_NSISSLCERTERRORDIALOG
--- a/security/manager/pki/src/nsPKIParamBlock.cpp
+++ b/security/manager/pki/src/nsPKIParamBlock.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPKIParamBlock.h"
 #include "nsIServiceManager.h"
 #include "nsIDialogParamBlock.h"
 #include "nsIMutableArray.h"
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsPKIParamBlock, nsIPKIParamBlock,
-                                               nsIDialogParamBlock)
+NS_IMPL_ISUPPORTS2(nsPKIParamBlock, nsIPKIParamBlock, nsIDialogParamBlock)
 
 nsPKIParamBlock::nsPKIParamBlock()
 {
 }
 
 nsresult
 nsPKIParamBlock::Init()
 {
--- a/security/manager/pki/src/nsPKIParamBlock.h
+++ b/security/manager/pki/src/nsPKIParamBlock.h
@@ -22,15 +22,15 @@ class nsPKIParamBlock : public nsIPKIPar
 public:
  
   nsPKIParamBlock();
   virtual ~nsPKIParamBlock();
   nsresult Init();
 
   NS_DECL_NSIPKIPARAMBLOCK
   NS_DECL_NSIDIALOGPARAMBLOCK
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
 private:
   nsCOMPtr<nsIDialogParamBlock> mDialogParamBlock;
   nsCOMPtr<nsISupportsArray>    mSupports;
 };
 
 #endif //_NSPKIPARAMBLOCK_
--- a/security/manager/ssl/src/TransportSecurityInfo.cpp
+++ b/security/manager/ssl/src/TransportSecurityInfo.cpp
@@ -63,23 +63,23 @@ TransportSecurityInfo::~TransportSecurit
   shutdown(calledFromObject);
 }
 
 void
 TransportSecurityInfo::virtualDestroyNSSReference()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS6(TransportSecurityInfo,
-                              nsITransportSecurityInfo,
-                              nsIInterfaceRequestor,
-                              nsISSLStatusProvider,
-                              nsIAssociatedContentSecurity,
-                              nsISerializable,
-                              nsIClassInfo)
+NS_IMPL_ISUPPORTS6(TransportSecurityInfo,
+                   nsITransportSecurityInfo,
+                   nsIInterfaceRequestor,
+                   nsISSLStatusProvider,
+                   nsIAssociatedContentSecurity,
+                   nsISerializable,
+                   nsIClassInfo)
 
 nsresult
 TransportSecurityInfo::SetHostName(const char* host)
 {
   mHostName.Adopt(host ? NS_strdup(host) : 0);
   return NS_OK;
 }
 
--- a/security/manager/ssl/src/TransportSecurityInfo.h
+++ b/security/manager/ssl/src/TransportSecurityInfo.h
@@ -33,17 +33,17 @@ class TransportSecurityInfo : public nsI
                               public nsIClassInfo,
                               public nsNSSShutDownObject,
                               public nsOnPK11LogoutCancelObject
 {
 public:
   TransportSecurityInfo();
   virtual ~TransportSecurityInfo();
   
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITRANSPORTSECURITYINFO
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSISSLSTATUSPROVIDER
   NS_DECL_NSIASSOCIATEDCONTENTSECURITY
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
   nsresult SetSecurityState(uint32_t aState);
--- a/security/manager/ssl/src/nsCMS.cpp
+++ b/security/manager/ssl/src/nsCMS.cpp
@@ -24,18 +24,17 @@ using namespace mozilla::psm;
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
 #endif
 
 using namespace mozilla;
 
 static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID);
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsCMSMessage, nsICMSMessage, 
-                                            nsICMSMessage2)
+NS_IMPL_ISUPPORTS2(nsCMSMessage, nsICMSMessage, nsICMSMessage2)
 
 nsCMSMessage::nsCMSMessage()
 {
   m_cmsMsg = nullptr;
 }
 nsCMSMessage::nsCMSMessage(NSSCMSMessage *aCMSMsg)
 {
   m_cmsMsg = aCMSMsg;
@@ -721,17 +720,17 @@ NS_IMETHODIMP nsCMSMessage::CreateSigned
 loser:
   if (m_cmsMsg) {
     NSS_CMSMessage_Destroy(m_cmsMsg);
     m_cmsMsg = nullptr;
   }
   return rv;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsCMSDecoder, nsICMSDecoder)
+NS_IMPL_ISUPPORTS1(nsCMSDecoder, nsICMSDecoder)
 
 nsCMSDecoder::nsCMSDecoder()
 : m_dcx(nullptr)
 {
 }
 
 nsCMSDecoder::~nsCMSDecoder()
 {
@@ -807,17 +806,17 @@ NS_IMETHODIMP nsCMSDecoder::Finish(nsICM
     // Make sure the context will live long enough.
     obj->referenceContext(m_ctx);
     *aCMSMsg = obj;
     NS_ADDREF(*aCMSMsg);
   }
   return NS_OK;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsCMSEncoder, nsICMSEncoder)
+NS_IMPL_ISUPPORTS1(nsCMSEncoder, nsICMSEncoder)
 
 nsCMSEncoder::nsCMSEncoder()
 : m_ecx(nullptr)
 {
 }
 
 nsCMSEncoder::~nsCMSEncoder()
 {
--- a/security/manager/ssl/src/nsCMS.h
+++ b/security/manager/ssl/src/nsCMS.h
@@ -23,17 +23,17 @@
 #define NS_CMSMESSAGE_CID \
   { 0xa4557478, 0xae16, 0x11d5, { 0xba,0x4b,0x00,0x10,0x83,0x03,0xb1,0x17 } }
 
 class nsCMSMessage : public nsICMSMessage,
                      public nsICMSMessage2,
                      public nsNSSShutDownObject
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICMSMESSAGE
   NS_DECL_NSICMSMESSAGE2
 
   nsCMSMessage();
   nsCMSMessage(NSSCMSMessage* aCMSMsg);
   virtual ~nsCMSMessage();
   
   void referenceContext(nsIInterfaceRequestor* aContext) {m_ctx = aContext;}
@@ -59,17 +59,17 @@ friend class nsSMimeVerificationJob;
 
 #define NS_CMSDECODER_CID \
   { 0x9dcef3a4, 0xa3bc, 0x11d5, { 0xba, 0x47, 0x00, 0x10, 0x83, 0x03, 0xb1, 0x17 } }
 
 class nsCMSDecoder : public nsICMSDecoder,
                      public nsNSSShutDownObject
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICMSDECODER
 
   nsCMSDecoder();
   virtual ~nsCMSDecoder();
 
 private:
   nsCOMPtr<nsIInterfaceRequestor> m_ctx;
   NSSCMSDecoderContext *m_dcx;
@@ -82,17 +82,17 @@ private:
 // ===============================================
 
 #define NS_CMSENCODER_CID \
   { 0xa15789aa, 0x8903, 0x462b, { 0x81, 0xe9, 0x4a, 0xa2, 0xcf, 0xf4, 0xd5, 0xcb } }
 class nsCMSEncoder : public nsICMSEncoder,
                      public nsNSSShutDownObject
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICMSENCODER
 
   nsCMSEncoder();
   virtual ~nsCMSEncoder();
 
 private:
   nsCOMPtr<nsIInterfaceRequestor> m_ctx;
   NSSCMSEncoderContext *m_ecx;
--- a/security/manager/ssl/src/nsCertOverrideService.cpp
+++ b/security/manager/ssl/src/nsCertOverrideService.cpp
@@ -76,20 +76,20 @@ nsCertOverride::convertStringToBits(cons
         break;
 
       default:
         break;
     }
   }
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsCertOverrideService, 
-                              nsICertOverrideService,
-                              nsIObserver,
-                              nsISupportsWeakReference)
+NS_IMPL_ISUPPORTS3(nsCertOverrideService,
+                   nsICertOverrideService,
+                   nsIObserver,
+                   nsISupportsWeakReference)
 
 nsCertOverrideService::nsCertOverrideService()
   : monitor("nsCertOverrideService.monitor")
 {
 }
 
 nsCertOverrideService::~nsCertOverrideService()
 {
--- a/security/manager/ssl/src/nsCertOverrideService.h
+++ b/security/manager/ssl/src/nsCertOverrideService.h
@@ -126,17 +126,17 @@ class nsCertOverrideEntry MOZ_FINAL : pu
     nsCString mHostWithPort;
 };
 
 class nsCertOverrideService MOZ_FINAL : public nsICertOverrideService
                                       , public nsIObserver
                                       , public nsSupportsWeakReference
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICERTOVERRIDESERVICE
   NS_DECL_NSIOBSERVER
 
   nsCertOverrideService();
   ~nsCertOverrideService();
 
   nsresult Init();
   void RemoveAllTemporaryOverrides();
--- a/security/manager/ssl/src/nsCertVerificationThread.cpp
+++ b/security/manager/ssl/src/nsCertVerificationThread.cpp
@@ -5,17 +5,17 @@
 #include "nsCertVerificationThread.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 
 using namespace mozilla;
 
 nsCertVerificationThread *nsCertVerificationThread::verification_thread_singleton;
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsCertVerificationResult, nsICertVerificationResult)
+NS_IMPL_ISUPPORTS1(nsCertVerificationResult, nsICertVerificationResult)
 
 namespace {
 class DispatchCertVerificationResult : public nsRunnable
 {
 public:
   DispatchCertVerificationResult(const nsMainThreadPtrHandle<nsICertVerificationListener>& aListener,
                                  nsIX509Cert3* aCert,
                                  nsICertVerificationResult* aResult)
--- a/security/manager/ssl/src/nsClientAuthRemember.cpp
+++ b/security/manager/ssl/src/nsClientAuthRemember.cpp
@@ -22,19 +22,19 @@
 #include "pk11pub.h"
 #include "certdb.h"
 #include "sechash.h"
 #include "SharedSSLState.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsClientAuthRememberService, 
-                              nsIObserver,
-                              nsISupportsWeakReference)
+NS_IMPL_ISUPPORTS2(nsClientAuthRememberService,
+                   nsIObserver,
+                   nsISupportsWeakReference)
 
 nsClientAuthRememberService::nsClientAuthRememberService()
   : monitor("nsClientAuthRememberService.monitor")
 {
 }
 
 nsClientAuthRememberService::~nsClientAuthRememberService()
 {
--- a/security/manager/ssl/src/nsClientAuthRemember.h
+++ b/security/manager/ssl/src/nsClientAuthRemember.h
@@ -105,17 +105,17 @@ class nsClientAuthRememberEntry MOZ_FINA
     nsClientAuthRemember mSettings;
     nsCString mHostWithCert;
 };
 
 class nsClientAuthRememberService MOZ_FINAL : public nsIObserver,
                                               public nsSupportsWeakReference
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   nsClientAuthRememberService();
   ~nsClientAuthRememberService();
 
   nsresult Init();
 
   static void GetHostWithCert(const nsACString & aHostName, 
--- a/security/manager/ssl/src/nsKeyModule.cpp
+++ b/security/manager/ssl/src/nsKeyModule.cpp
@@ -119,17 +119,17 @@ nsKeyObject::GetType(int16_t *_retval)
 
   *_retval = mKeyType;
   return NS_OK;
 }
 
 //////////////////////////////////////////////////////////////////////////////
 // nsIKeyObjectFactory
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsKeyObjectFactory, nsIKeyObjectFactory)
+NS_IMPL_ISUPPORTS1(nsKeyObjectFactory, nsIKeyObjectFactory)
 
 nsKeyObjectFactory::nsKeyObjectFactory()
 {
 }
 
 /* nsIKeyObject lookupKeyByName (in ACString aName); */
 NS_IMETHODIMP
 nsKeyObjectFactory::LookupKeyByName(const nsACString & aName,
--- a/security/manager/ssl/src/nsKeyModule.h
+++ b/security/manager/ssl/src/nsKeyModule.h
@@ -47,17 +47,17 @@ private:
 };
 
 
 class nsKeyObjectFactory MOZ_FINAL : public nsIKeyObjectFactory
 {
 public:
   nsKeyObjectFactory();
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIKEYOBJECTFACTORY
 
 private:
   ~nsKeyObjectFactory() {}
 
   // Disallow copy constructor
   nsKeyObjectFactory(nsKeyObjectFactory&);
 };
--- a/security/manager/ssl/src/nsKeygenHandler.cpp
+++ b/security/manager/ssl/src/nsKeygenHandler.cpp
@@ -253,17 +253,17 @@ decode_ec_params(const char *curve)
      */
     ecparams->data[0] = SEC_ASN1_OBJECT_ID;
     ecparams->data[1] = oidData->oid.len;
     memcpy(ecparams->data + 2, oidData->oid.data, oidData->oid.len);
 
     return ecparams;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsKeygenFormProcessor, nsIFormProcessor)
+NS_IMPL_ISUPPORTS1(nsKeygenFormProcessor, nsIFormProcessor)
 
 nsKeygenFormProcessor::nsKeygenFormProcessor()
 { 
    m_ctx = new PipUIContext();
 
 } 
 
 nsKeygenFormProcessor::~nsKeygenFormProcessor()
--- a/security/manager/ssl/src/nsKeygenHandler.h
+++ b/security/manager/ssl/src/nsKeygenHandler.h
@@ -28,17 +28,17 @@ public:
 
   NS_IMETHOD ProcessValue(nsIDOMHTMLElement *aElement, 
                           const nsAString& aName, 
                           nsAString& aValue); 
 
   NS_IMETHOD ProvideContent(const nsAString& aFormType, 
                             nsTArray<nsString>& aContent, 
                             nsAString& aAttribute); 
-  NS_DECL_ISUPPORTS 
+  NS_DECL_THREADSAFE_ISUPPORTS
 
   static nsresult Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
 
 protected:
   nsresult GetPublicKey(nsAString& aValue, nsAString& aChallenge, 
 			nsAFlatString& akeyType, nsAString& aOutPublicKey,
 			nsAString& aPqg);
   nsresult GetSlot(uint32_t aMechanism, PK11SlotInfo** aSlot);
--- a/security/manager/ssl/src/nsKeygenThread.cpp
+++ b/security/manager/ssl/src/nsKeygenThread.cpp
@@ -11,17 +11,17 @@
 #include "nsIObserver.h"
 #include "nsNSSShutDown.h"
 #include "PSMRunnable.h"
 #include "mozilla/DebugOnly.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsKeygenThread, nsIKeygenThread)
+NS_IMPL_ISUPPORTS1(nsKeygenThread, nsIKeygenThread)
 
 
 nsKeygenThread::nsKeygenThread()
 :mutex("nsKeygenThread.mutex"),
  iAmRunning(false),
  keygenReady(false),
  statusDialogClosed(false),
  alreadyReceivedParams(false),
--- a/security/manager/ssl/src/nsKeygenThread.h
+++ b/security/manager/ssl/src/nsKeygenThread.h
@@ -41,17 +41,17 @@ private:
 
   PRThread *threadHandle;
   
 public:
   nsKeygenThread();
   virtual ~nsKeygenThread();
   
   NS_DECL_NSIKEYGENTHREAD
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
 
   void SetParams(
     PK11SlotInfo *a_slot,
     PK11AttrFlags a_flags,
     PK11SlotInfo *a_alternative_slot,
     PK11AttrFlags a_alternative_flags,
     uint32_t a_keyGenMechanism,
     void *a_params,
--- a/security/manager/ssl/src/nsNSSASN1Object.cpp
+++ b/security/manager/ssl/src/nsNSSASN1Object.cpp
@@ -4,20 +4,18 @@
 #include "nsNSSASN1Object.h"
 #include "nsIComponentManager.h"
 #include "secasn1.h"
 #include "nsReadableUtils.h"
 #include "nsIMutableArray.h"
 #include "nsArrayUtils.h"
 #include "nsXPCOMCID.h"
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSASN1Sequence, nsIASN1Sequence, 
-                                                 nsIASN1Object)
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSASN1PrintableItem, nsIASN1PrintableItem,
-                                                      nsIASN1Object)
+NS_IMPL_ISUPPORTS2(nsNSSASN1Sequence, nsIASN1Sequence, nsIASN1Object)
+NS_IMPL_ISUPPORTS2(nsNSSASN1PrintableItem, nsIASN1PrintableItem, nsIASN1Object)
 
 // This function is used to interpret an integer that
 // was encoded in a DER buffer. This function is used
 // when converting a DER buffer into a nsIASN1Object 
 // structure.  This interprets the buffer in data
 // as defined by the DER (Distinguised Encoding Rules) of
 // ASN1.
 static int
--- a/security/manager/ssl/src/nsNSSASN1Object.h
+++ b/security/manager/ssl/src/nsNSSASN1Object.h
@@ -15,17 +15,17 @@
 //
 // Read comments in nsIX509Cert.idl for a description of the desired
 // purpose for this ASN1 interface implementation.
 //
 
 class nsNSSASN1Sequence : public nsIASN1Sequence
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIASN1SEQUENCE
   NS_DECL_NSIASN1OBJECT
 
   nsNSSASN1Sequence();
   virtual ~nsNSSASN1Sequence();
   /* additional members */
 private:
   nsCOMPtr<nsIMutableArray> mASN1Objects;
@@ -35,17 +35,17 @@ private:
   uint32_t mTag;
   bool     mIsValidContainer;
   bool     mIsExpanded;
 };
 
 class nsNSSASN1PrintableItem : public nsIASN1PrintableItem
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIASN1PRINTABLEITEM
   NS_DECL_NSIASN1OBJECT
 
   nsNSSASN1PrintableItem();
   virtual ~nsNSSASN1PrintableItem();
   /* additional members */
 private:
   nsString mDisplayName;
--- a/security/manager/ssl/src/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/src/nsNSSCallbacks.cpp
@@ -293,23 +293,23 @@ SECStatus nsNSSHttpRequestSession::trySe
 #endif
 
   return result_sec_status;
 }
 
 void
 nsNSSHttpRequestSession::AddRef()
 {
-  NS_AtomicIncrementRefcnt(mRefCount);
+  ++mRefCount;
 }
 
 void
 nsNSSHttpRequestSession::Release()
 {
-  int32_t newRefCount = NS_AtomicDecrementRefcnt(mRefCount);
+  int32_t newRefCount = --mRefCount;
   if (!newRefCount) {
     delete this;
   }
 }
 
 SECStatus
 nsNSSHttpRequestSession::internal_send_receive_attempt(bool &retryable_error,
                                                        PRPollDesc **pPollDesc,
@@ -564,17 +564,17 @@ nsHTTPListener::~nsHTTPListener()
     send_done_signal();
 
   if (mLoader) {
     nsCOMPtr<nsIThread> mainThread(do_GetMainThread());
     NS_ProxyRelease(mainThread, mLoader);
   }
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsHTTPListener, nsIStreamLoaderObserver)
+NS_IMPL_ISUPPORTS1(nsHTTPListener, nsIStreamLoaderObserver)
 
 void
 nsHTTPListener::FreeLoadGroup(bool aCancelLoad)
 {
   nsILoadGroup *lg = nullptr;
 
   MutexAutoLock locker(mLock);
 
--- a/security/manager/ssl/src/nsNSSCallbacks.h
+++ b/security/manager/ssl/src/nsNSSCallbacks.h
@@ -32,17 +32,17 @@ private:
   // For XPCOM implementations that are not a base class for some other
   // class, it is good practice to make the destructor non-virtual and
   // private.  Then the only way to delete the object is via Release.
   ~nsHTTPListener();
 
 public:
   nsHTTPListener();
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISTREAMLOADEROBSERVER
 
   nsCOMPtr<nsIStreamLoader> mLoader;
 
   nsresult mResultCode;
 
   bool mHttpRequestSucceeded;
   uint16_t mHttpResponseCode;
@@ -76,17 +76,17 @@ public:
   static SECStatus createSessionFcn(const char *host,
                                     uint16_t portnum,
                                     SEC_HTTP_SERVER_SESSION *pSession);
 };
 
 class nsNSSHttpRequestSession
 {
 protected:
-  int32_t mRefCount;
+  mozilla::ThreadSafeAutoRefCnt mRefCount;
 
 public:
   static SECStatus createFcn(SEC_HTTP_SERVER_SESSION session,
                              const char *http_protocol_variant,
                              const char *path_and_query_string,
                              const char *http_request_method, 
                              const PRIntervalTime timeout, 
                              SEC_HTTP_REQUEST_SESSION *pRequest);
--- a/security/manager/ssl/src/nsNSSCertCache.cpp
+++ b/security/manager/ssl/src/nsNSSCertCache.cpp
@@ -6,17 +6,17 @@
 #include "nsNSSCertificate.h"
 #include "cert.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsNSSHelper.h"
 
 using namespace mozilla;
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsNSSCertCache, nsINSSCertCache)
+NS_IMPL_ISUPPORTS1(nsNSSCertCache, nsINSSCertCache)
 
 nsNSSCertCache::nsNSSCertCache()
 :mutex("nsNSSCertCache.mutex"), mCertList(nullptr)
 {
 }
 
 nsNSSCertCache::~nsNSSCertCache()
 {
--- a/security/manager/ssl/src/nsNSSCertCache.h
+++ b/security/manager/ssl/src/nsNSSCertCache.h
@@ -11,17 +11,17 @@
 #include "mozilla/Mutex.h"
 #include "nsNSSShutDown.h"
 #include "nsCOMPtr.h"
 
 class nsNSSCertCache : public nsINSSCertCache,
                        public nsNSSShutDownObject
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSINSSCERTCACHE
 
   nsNSSCertCache();
   virtual ~nsNSSCertCache();
 
 private:
   mozilla::Mutex mutex;
   nsCOMPtr<nsIX509CertList> mCertList;
--- a/security/manager/ssl/src/nsNSSCertValidity.cpp
+++ b/security/manager/ssl/src/nsNSSCertValidity.cpp
@@ -7,17 +7,17 @@
 #include "nsIDateTimeFormat.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsReadableUtils.h"
 #include "nsNSSShutDown.h"
 #include "cert.h"
 
 /* Implementation file */
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsX509CertValidity, nsIX509CertValidity)
+NS_IMPL_ISUPPORTS1(nsX509CertValidity, nsIX509CertValidity)
 
 nsX509CertValidity::nsX509CertValidity() : mTimesInitialized(false)
 {
   /* member initializers and constructor code */
 }
 
 nsX509CertValidity::nsX509CertValidity(CERTCertificate *cert) : 
                                            mTimesInitialized(false)
--- a/security/manager/ssl/src/nsNSSCertValidity.h
+++ b/security/manager/ssl/src/nsNSSCertValidity.h
@@ -7,17 +7,17 @@
 
 #include "nsIX509CertValidity.h"
 
 #include "certt.h"
 
 class nsX509CertValidity : public nsIX509CertValidity
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERTVALIDITY
 
   nsX509CertValidity();
   nsX509CertValidity(CERTCertificate *cert);
   virtual ~nsX509CertValidity();
   /* additional members */
 
 private:
--- a/security/manager/ssl/src/nsNSSCertificate.cpp
+++ b/security/manager/ssl/src/nsNSSCertificate.cpp
@@ -63,23 +63,24 @@ NSSCleanupAutoPtrClass_WithParam(PLArena
 // This is being stored in an uint32_t that can otherwise
 // only take values from nsIX509Cert's list of cert types.
 // As nsIX509Cert is frozen, we choose a value not contained
 // in the list to mean not yet initialized.
 #define CERT_TYPE_NOT_YET_INITIALIZED (1 << 30)
 
 /* nsNSSCertificate */
 
-NS_IMPL_THREADSAFE_ISUPPORTS7(nsNSSCertificate, nsIX509Cert,
-                                                nsIX509Cert2,
-                                                nsIX509Cert3,
-                                                nsIIdentityInfo,
-                                                nsISMimeCert,
-                                                nsISerializable,
-                                                nsIClassInfo)
+NS_IMPL_ISUPPORTS7(nsNSSCertificate,
+                   nsIX509Cert,
+                   nsIX509Cert2,
+                   nsIX509Cert3,
+                   nsIIdentityInfo,
+                   nsISMimeCert,
+                   nsISerializable,
+                   nsIClassInfo)
 
 /* static */
 nsNSSCertificate*
 nsNSSCertificate::Create(CERTCertificate *cert, SECOidTag *evOidPolicy)
 {
   if (GeckoProcessType_Default != XRE_GetProcessType()) {
     NS_ERROR("Trying to initialize nsNSSCertificate in a non-chrome process!");
     return nullptr;
@@ -1471,17 +1472,17 @@ char* nsNSSCertificate::defaultServerNic
     }
     PR_Free(nickname);
     count++;
   }
   PR_FREEIF(servername);
   return nickname;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsNSSCertList, nsIX509CertList)
+NS_IMPL_ISUPPORTS1(nsNSSCertList, nsIX509CertList)
 
 nsNSSCertList::nsNSSCertList(CERTCertList *certList, bool adopt)
 {
   if (certList) {
     if (adopt) {
       mCertList = certList;
     } else {
       mCertList = DupCertList(certList);
@@ -1577,18 +1578,17 @@ nsNSSCertList::GetEnumerator(nsISimpleEn
 {
   nsCOMPtr<nsISimpleEnumerator> enumerator = new nsNSSCertListEnumerator(mCertList);
 
   *_retval = enumerator;
   NS_ADDREF(*_retval);
   return NS_OK;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsNSSCertListEnumerator, 
-                              nsISimpleEnumerator)
+NS_IMPL_ISUPPORTS1(nsNSSCertListEnumerator, nsISimpleEnumerator)
 
 nsNSSCertListEnumerator::nsNSSCertListEnumerator(CERTCertList *certList)
 {
   mCertList = nsNSSCertList::DupCertList(certList);
 }
 
 /* boolean hasMoreElements (); */
 NS_IMETHODIMP
--- a/security/manager/ssl/src/nsNSSCertificate.h
+++ b/security/manager/ssl/src/nsNSSCertificate.h
@@ -30,17 +30,17 @@ class nsIASN1Sequence;
 class nsNSSCertificate : public nsIX509Cert3,
                          public nsIIdentityInfo,
                          public nsISMimeCert,
                          public nsISerializable,
                          public nsIClassInfo,
                          public nsNSSShutDownObject
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERT
   NS_DECL_NSIX509CERT2
   NS_DECL_NSIX509CERT3
   NS_DECL_NSIIDENTITYINFO
   NS_DECL_NSISMIMECERT
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
@@ -75,17 +75,17 @@ private:
   SECOidTag mCachedEVOidTag;
   nsresult hasValidEVOidTag(SECOidTag &resultOidTag, bool &validEV);
   nsresult getValidEVOidTag(SECOidTag &resultOidTag, bool &validEV);
 };
 
 class nsNSSCertList: public nsIX509CertList
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERTLIST
 
   nsNSSCertList(CERTCertList *certList = nullptr, bool adopt = false);
 
   static CERTCertList *DupCertList(CERTCertList *aCertList);
 private:
    virtual ~nsNSSCertList() { }
 
@@ -93,17 +93,17 @@ private:
 
    nsNSSCertList(const nsNSSCertList &) MOZ_DELETE;
    void operator=(const nsNSSCertList &) MOZ_DELETE;
 };
 
 class nsNSSCertListEnumerator: public nsISimpleEnumerator
 {
 public:
-   NS_DECL_ISUPPORTS
+   NS_DECL_THREADSAFE_ISUPPORTS
    NS_DECL_NSISIMPLEENUMERATOR
 
    nsNSSCertListEnumerator(CERTCertList *certList);
 private:
    virtual ~nsNSSCertListEnumerator() { }
 
    mozilla::ScopedCERTCertList mCertList;
 
--- a/security/manager/ssl/src/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateDB.cpp
@@ -53,17 +53,17 @@ using mozilla::psm::SharedSSLState;
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
 #endif
 
 static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID);
 
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSCertificateDB, nsIX509CertDB, nsIX509CertDB2)
+NS_IMPL_ISUPPORTS2(nsNSSCertificateDB, nsIX509CertDB, nsIX509CertDB2)
 
 nsNSSCertificateDB::nsNSSCertificateDB()
 : mBadCertsLock("nsNSSCertificateDB::mBadCertsLock")
 {
   SharedSSLState::NoteCertDBServiceInstantiated();
 }
 
 nsNSSCertificateDB::~nsNSSCertificateDB()
--- a/security/manager/ssl/src/nsNSSCertificateDB.h
+++ b/security/manager/ssl/src/nsNSSCertificateDB.h
@@ -13,17 +13,17 @@
 
 class nsCString;
 class nsIArray;
 class nsRecentBadCerts;
 
 class nsNSSCertificateDB : public nsIX509CertDB, public nsIX509CertDB2
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERTDB
   NS_DECL_NSIX509CERTDB2
 
   nsNSSCertificateDB(); 
   virtual ~nsNSSCertificateDB();
 
   // Use this function to generate a default nickname for a user
   // certificate that is to be imported onto a token.
--- a/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
@@ -15,19 +15,20 @@
 #include "nsIObjectInputStream.h"
 
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gPIPNSSLog;
 #endif
 
 /* nsNSSCertificateFakeTransport */
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsNSSCertificateFakeTransport, nsIX509Cert,
-                                                nsISerializable,
-                                                nsIClassInfo)
+NS_IMPL_ISUPPORTS3(nsNSSCertificateFakeTransport,
+                   nsIX509Cert,
+                   nsISerializable,
+                   nsIClassInfo)
 
 nsNSSCertificateFakeTransport::nsNSSCertificateFakeTransport() :
   mCertSerialization(nullptr)
 {
 }
 
 nsNSSCertificateFakeTransport::~nsNSSCertificateFakeTransport()
 {
--- a/security/manager/ssl/src/nsNSSCertificateFakeTransport.h
+++ b/security/manager/ssl/src/nsNSSCertificateFakeTransport.h
@@ -12,17 +12,17 @@
 #include "secitem.h"
 
 /* Certificate */
 class nsNSSCertificateFakeTransport : public nsIX509Cert,
                               public nsISerializable,
                               public nsIClassInfo
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERT
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
   nsNSSCertificateFakeTransport();
   virtual ~nsNSSCertificateFakeTransport();
 
 private:
--- a/security/manager/ssl/src/nsNSSComponent.cpp
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
@@ -90,24 +90,24 @@ extern char* pk11PasswordPrompt(PK11Slot
 //This class is used to run the callback code
 //passed to the event handlers for smart card notification
 class nsTokenEventRunnable : public nsIRunnable {
 public:
   nsTokenEventRunnable(const nsAString &aType, const nsAString &aTokenName);
   virtual ~nsTokenEventRunnable();
 
   NS_IMETHOD Run ();
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
 private:
   nsString mType;
   nsString mTokenName;
 };
 
 // ISuuports implementation for nsTokenEventRunnable
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsTokenEventRunnable, nsIRunnable)
+NS_IMPL_ISUPPORTS1(nsTokenEventRunnable, nsIRunnable)
 
 nsTokenEventRunnable::nsTokenEventRunnable(const nsAString &aType, 
    const nsAString &aTokenName): mType(aType), mTokenName(aTokenName) { }
 
 nsTokenEventRunnable::~nsTokenEventRunnable() { }
 
 //Implementation that runs the callback passed to 
 //crypto.generateCRMFRequest as an event.
@@ -1406,22 +1406,22 @@ nsNSSComponent::Init()
   if (bec) {
     bec->ForwardTo(this);
   }
 
   return rv;
 }
 
 /* nsISupports Implementation for the class */
-NS_IMPL_THREADSAFE_ISUPPORTS5(nsNSSComponent,
-                              nsISignatureVerifier,
-                              nsIEntropyCollector,
-                              nsINSSComponent,
-                              nsIObserver,
-                              nsISupportsWeakReference)
+NS_IMPL_ISUPPORTS5(nsNSSComponent,
+                   nsISignatureVerifier,
+                   nsIEntropyCollector,
+                   nsINSSComponent,
+                   nsIObserver,
+                   nsISupportsWeakReference)
 
 
 /* Callback functions for decoder. For now, use empty/default functions. */
 static void ContentCallback(void *arg, 
                                            const char *buf,
                                            unsigned long len)
 {
 }
@@ -1881,17 +1881,17 @@ nsNSSComponent::GetDefaultCertVerifier(R
 {
   MutexAutoLock lock(mutex);
   if (!mNSSInitialized)
       return NS_ERROR_NOT_INITIALIZED;
   out = mDefaultCertVerifier;
   return NS_OK;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(PipUIContext, nsIInterfaceRequestor)
+NS_IMPL_ISUPPORTS1(PipUIContext, nsIInterfaceRequestor)
 
 PipUIContext::PipUIContext()
 {
 }
 
 PipUIContext::~PipUIContext()
 {
 }
--- a/security/manager/ssl/src/nsNSSComponent.h
+++ b/security/manager/ssl/src/nsNSSComponent.h
@@ -128,17 +128,17 @@ class nsNSSComponent : public nsISignatu
   typedef mozilla::Mutex Mutex;
 
 public:
   NS_DEFINE_STATIC_CID_ACCESSOR( NS_NSSCOMPONENT_CID )
 
   nsNSSComponent();
   virtual ~nsNSSComponent();
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISIGNATUREVERIFIER
   NS_DECL_NSIENTROPYCOLLECTOR
   NS_DECL_NSIOBSERVER
 
   NS_METHOD Init();
 
   static nsresult GetNewPrompter(nsIPrompt ** result);
   static nsresult ShowAlertWithConstructedString(const nsString & message);
--- a/security/manager/ssl/src/nsNSSHelper.h
+++ b/security/manager/ssl/src/nsNSSHelper.h
@@ -13,17 +13,17 @@
 
 //
 // Implementation of an nsIInterfaceRequestor for use
 // as context for NSS calls
 //
 class PipUIContext : public nsIInterfaceRequestor
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIINTERFACEREQUESTOR
 
   PipUIContext();
   virtual ~PipUIContext();
 
 };
 
 //
--- a/security/manager/ssl/src/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/src/nsNSSIOLayer.cpp
@@ -1316,26 +1316,26 @@ static int64_t PSMAvailable64(void)
   // This is called through PR_Available(), but is not implemented in PSM
   PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
   return -1;
 }
 
 namespace {
 class PrefObserver : public nsIObserver {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   PrefObserver(nsSSLIOLayerHelpers* aOwner) : mOwner(aOwner) {}
   virtual ~PrefObserver() {}
 private:
   nsSSLIOLayerHelpers* mOwner;
 };
 } // namespace anonymous
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(PrefObserver, nsIObserver)
+NS_IMPL_ISUPPORTS1(PrefObserver, nsIObserver)
 
 NS_IMETHODIMP
 PrefObserver::Observe(nsISupports *aSubject, const char *aTopic, 
                       const PRUnichar *someData)
 {
   if (nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0) {
     NS_ConvertUTF16toUTF8 prefName(someData);
 
--- a/security/manager/ssl/src/nsProtectedAuthThread.cpp
+++ b/security/manager/ssl/src/nsProtectedAuthThread.cpp
@@ -10,17 +10,17 @@
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsPKCS11Slot.h"
 #include "nsProtectedAuthThread.h"
 
 using namespace mozilla;
 using namespace mozilla::psm;
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsProtectedAuthThread, nsIProtectedAuthThread)
+NS_IMPL_ISUPPORTS1(nsProtectedAuthThread, nsIProtectedAuthThread)
 
 static void nsProtectedAuthThreadRunner(void *arg)
 {
     PR_SetCurrentThreadName("Protected Auth");
 
     nsProtectedAuthThread *self = static_cast<nsProtectedAuthThread *>(arg);
     self->Run();
 }
--- a/security/manager/ssl/src/nsProtectedAuthThread.h
+++ b/security/manager/ssl/src/nsProtectedAuthThread.h
@@ -32,17 +32,17 @@ private:
     // Result of the authentication
     SECStatus       mLoginResult;
 
 public:
 
     nsProtectedAuthThread();
     virtual ~nsProtectedAuthThread();
 
-    NS_DECL_ISUPPORTS
+    NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIPROTECTEDAUTHTHREAD
 
     // Sets parameters for the thread
     void SetParams(PK11SlotInfo *slot);
 
     // Gets result of the protected authentication operation
     SECStatus GetResult();
 
--- a/security/manager/ssl/src/nsRandomGenerator.cpp
+++ b/security/manager/ssl/src/nsRandomGenerator.cpp
@@ -6,17 +6,17 @@
 #include "pk11pub.h"
 #include "secerr.h"
 #include "prerror.h"
 #include "nsNSSComponent.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsRandomGenerator
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsRandomGenerator, nsIRandomGenerator)
+NS_IMPL_ISUPPORTS1(nsRandomGenerator, nsIRandomGenerator)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIRandomGenerator
 
 /* void generateRandomBytes(in unsigned long aLength,
                             [retval, array, size_is(aLength)] out octet aBuffer) */
 NS_IMETHODIMP
 nsRandomGenerator::GenerateRandomBytes(uint32_t aLength,
--- a/security/manager/ssl/src/nsRandomGenerator.h
+++ b/security/manager/ssl/src/nsRandomGenerator.h
@@ -12,13 +12,13 @@
   {0xbe65e2b7, 0xfe46, 0x4e0f, {0x88, 0xe0, 0x4b, 0x38, 0x5d, 0xb4, 0xd6, 0x8a}}
 
 #define NS_RANDOMGENERATOR_CONTRACTID \
   "@mozilla.org/security/random-generator;1"
 
 class nsRandomGenerator MOZ_FINAL : public nsIRandomGenerator
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRANDOMGENERATOR
 };
 
 #endif // _NSRANDOMGENERATOR_H_
--- a/security/manager/ssl/src/nsRecentBadCerts.cpp
+++ b/security/manager/ssl/src/nsRecentBadCerts.cpp
@@ -17,18 +17,17 @@
 #include "nsStringBuffer.h"
 #include "nspr.h"
 #include "pk11pub.h"
 #include "certdb.h"
 #include "sechash.h"
 
 using namespace mozilla;
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsRecentBadCerts,
-                              nsIRecentBadCerts)
+NS_IMPL_ISUPPORTS1(nsRecentBadCerts, nsIRecentBadCerts)
 
 nsRecentBadCerts::nsRecentBadCerts()
 :monitor("nsRecentBadCerts.monitor")
 ,mNextStorePosition(0)
 {
 }
 
 nsRecentBadCerts::~nsRecentBadCerts()
--- a/security/manager/ssl/src/nsRecentBadCerts.h
+++ b/security/manager/ssl/src/nsRecentBadCerts.h
@@ -52,17 +52,17 @@ public:
 private:
   RecentBadCert(const RecentBadCert &other) MOZ_DELETE;
   RecentBadCert &operator=(const RecentBadCert &other) MOZ_DELETE;
 };
 
 class nsRecentBadCerts MOZ_FINAL : public nsIRecentBadCerts
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRECENTBADCERTS
 
   nsRecentBadCerts();
   ~nsRecentBadCerts();
 
 protected:
     mozilla::ReentrantMonitor monitor;
 
--- a/security/manager/ssl/src/nsSSLSocketProvider.cpp
+++ b/security/manager/ssl/src/nsSSLSocketProvider.cpp
@@ -11,17 +11,17 @@
 nsSSLSocketProvider::nsSSLSocketProvider()
 {
 }
 
 nsSSLSocketProvider::~nsSSLSocketProvider()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsSSLSocketProvider, nsISocketProvider)
+NS_IMPL_ISUPPORTS1(nsSSLSocketProvider, nsISocketProvider)
 
 NS_IMETHODIMP
 nsSSLSocketProvider::NewSocket(int32_t family,
                                const char *host,
                                int32_t port,
                                const char *proxyHost,
                                int32_t proxyPort,
                                uint32_t flags,
--- a/security/manager/ssl/src/nsSSLSocketProvider.h
+++ b/security/manager/ssl/src/nsSSLSocketProvider.h
@@ -12,17 +12,17 @@
 /* 217d014a-1dd2-11b2-999c-b0c4df79b324 */
 #define NS_SSLSOCKETPROVIDER_CID   \
 { 0x217d014a, 0x1dd2, 0x11b2, {0x99, 0x9c, 0xb0, 0xc4, 0xdf, 0x79, 0xb3, 0x24}}
 
 
 class nsSSLSocketProvider : public nsISocketProvider
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISOCKETPROVIDER
   
   // nsSSLSocketProvider methods:
   nsSSLSocketProvider();
   virtual ~nsSSLSocketProvider();
 };
 
 #endif /* _NSSSLSOCKETPROVIDER_H_ */
--- a/security/manager/ssl/src/nsSSLStatus.cpp
+++ b/security/manager/ssl/src/nsSSLStatus.cpp
@@ -218,13 +218,13 @@ nsSSLStatus::nsSSLStatus()
 , mIsNotValidAtThisTime(false)
 , mIsUntrusted(false)
 , mHaveKeyLengthAndCipher(false)
 , mHaveCertErrorBits(false)
 {
   mCipherName = "";
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsSSLStatus, nsISSLStatus, nsISerializable, nsIClassInfo)
+NS_IMPL_ISUPPORTS3(nsSSLStatus, nsISSLStatus, nsISerializable, nsIClassInfo)
 
 nsSSLStatus::~nsSSLStatus()
 {
 }
--- a/security/manager/ssl/src/nsSSLStatus.h
+++ b/security/manager/ssl/src/nsSSLStatus.h
@@ -15,17 +15,17 @@
 #include "nsIClassInfo.h"
 
 class nsSSLStatus
   : public nsISSLStatus
   , public nsISerializable
   , public nsIClassInfo
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISSLSTATUS
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
   nsSSLStatus();
   virtual ~nsSSLStatus();
 
   /* public for initilization in this file */
--- a/security/manager/ssl/src/nsTLSSocketProvider.cpp
+++ b/security/manager/ssl/src/nsTLSSocketProvider.cpp
@@ -11,17 +11,17 @@
 nsTLSSocketProvider::nsTLSSocketProvider()
 {
 }
 
 nsTLSSocketProvider::~nsTLSSocketProvider()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsTLSSocketProvider, nsISocketProvider)
+NS_IMPL_ISUPPORTS1(nsTLSSocketProvider, nsISocketProvider)
 
 NS_IMETHODIMP
 nsTLSSocketProvider::NewSocket(int32_t family,
                                const char *host,
                                int32_t port,
                                const char *proxyHost,
                                int32_t proxyPort,
                                uint32_t flags,
--- a/security/manager/ssl/src/nsTLSSocketProvider.h
+++ b/security/manager/ssl/src/nsTLSSocketProvider.h
@@ -16,17 +16,17 @@
      0x1dd1,                                         \
      0x11b2,                                         \
     {0x8c, 0xd5, 0xc4, 0x8e, 0xe0, 0xc5, 0x03, 0x07} \
 }
 
 class nsTLSSocketProvider : public nsISocketProvider
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISOCKETPROVIDER
 
   // nsTLSSocketProvider methods:
   nsTLSSocketProvider();
   virtual ~nsTLSSocketProvider();
 };
 
 #endif /* _NSTLSSOCKETPROVIDER_H_ */
--- a/security/manager/ssl/src/nsVerificationJob.h
+++ b/security/manager/ssl/src/nsVerificationJob.h
@@ -32,17 +32,17 @@ public:
 };
 
 class nsCertVerificationResult : public nsICertVerificationResult
 {
 public:
   nsCertVerificationResult();
   virtual ~nsCertVerificationResult();
 
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSICERTVERIFICATIONRESULT
 
 private:
   nsresult mRV;
   uint32_t mVerified;
   uint32_t mCount;
   PRUnichar **mUsages;