Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm
authorBevis Tseng <btseng@mozilla.com>
Wed, 14 Jun 2017 09:27:17 +0800
changeset 364765 89963ba78c353b23feab0042ebe264049f8d4533
parent 364764 9509d601accda3598e7bbe47fe976729b6d82c10
child 364766 301e80f200463e138a5a532ffeabebddee79b9de
push id91628
push userbtseng@mozilla.com
push dateTue, 20 Jun 2017 05:11:14 +0000
treeherdermozilla-inbound@89963ba78c35 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1372453
milestone56.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 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm MozReview-Commit-ID: LYhSWnZkq0i
dom/base/DocGroup.cpp
dom/base/WebSocket.cpp
dom/base/nsDOMDataChannel.cpp
dom/cache/Context.cpp
dom/cache/ManagerId.cpp
dom/console/Console.cpp
dom/crypto/WebCryptoTask.cpp
dom/fetch/Fetch.cpp
dom/file/MutableBlobStorage.cpp
dom/filesystem/FileSystemRequestParent.cpp
dom/filesystem/FileSystemTaskBase.cpp
dom/filesystem/GetFilesHelper.cpp
dom/media/MediaSegment.h
dom/media/MediaStreamGraph.cpp
dom/media/mediasource/TrackBuffersManager.cpp
dom/media/webspeech/recognition/SpeechStreamListener.cpp
dom/notification/Notification.cpp
dom/script/ScriptLoader.cpp
dom/u2f/U2F.cpp
dom/workers/ServiceWorkerJob.cpp
dom/workers/ServiceWorkerPrivate.cpp
dom/workers/ServiceWorkerRegistrationInfo.cpp
dom/workers/ServiceWorkerUpdateJob.cpp
dom/workers/WorkerPrivate.cpp
extensions/spellcheck/src/mozPersonalDictionary.cpp
image/ImageURL.h
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/decoders/icon/win/nsIconChannel.cpp
ipc/mscom/MainThreadHandoff.cpp
ipc/mscom/WeakRef.cpp
js/xpconnect/loader/ScriptPreloader.cpp
layout/style/URLExtraData.cpp
layout/style/nsCSSValue.cpp
layout/style/nsStyleStruct.cpp
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
modules/libjar/nsJARChannel.cpp
netwerk/base/Dashboard.cpp
netwerk/base/TLSServerSocket.cpp
netwerk/base/nsBaseChannel.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsRequestObserverProxy.cpp
netwerk/base/nsServerSocket.cpp
netwerk/base/nsStreamListenerTee.cpp
netwerk/base/nsTransportUtils.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache2/AppCacheStorage.cpp
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheIndex.h
netwerk/cache2/CacheStorageService.cpp
netwerk/cache2/CacheStorageService.h
netwerk/cache2/OldWrappers.cpp
netwerk/dns/DNSListenerProxy.h
netwerk/protocol/file/nsFileChannel.cpp
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/nsHttpActivityDistributor.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/websocket/BaseWebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
netwerk/sctp/datachannel/DataChannel.cpp
netwerk/wifi/nsWifiMonitor.cpp
security/apps/AppSignatureVerification.cpp
security/manager/ssl/LocalCertService.cpp
security/manager/ssl/PSMRunnable.h
security/manager/ssl/nsNSSCallbacks.cpp
security/manager/ssl/nsNSSCertificateDB.cpp
services/crypto/component/IdentityCryptoService.cpp
storage/StorageBaseStatementInternal.cpp
storage/mozStorageAsyncStatement.cpp
storage/mozStorageAsyncStatementJSHelper.cpp
storage/mozStorageConnection.cpp
storage/mozStorageService.cpp
storage/mozStorageStatementData.h
storage/mozStorageStatementJSHelper.cpp
toolkit/components/filewatcher/NativeFileWatcherWin.cpp
toolkit/components/osfile/NativeOSFileInternals.cpp
toolkit/components/places/FaviconHelpers.cpp
toolkit/components/places/Helpers.h
toolkit/components/places/History.cpp
toolkit/components/places/Shutdown.cpp
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierProxies.h
xpcom/base/nsConsoleService.cpp
xpcom/base/nsInterfaceRequestorAgg.cpp
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -44,17 +44,17 @@ DocGroup::DocGroup(TabGroup* aTabGroup, 
   // This method does not add itself to mTabGroup->mDocGroups as the caller does it for us.
 }
 
 DocGroup::~DocGroup()
 {
   MOZ_ASSERT(mDocuments.IsEmpty());
   if (!NS_IsMainThread()) {
     nsIEventTarget* target = EventTargetFor(TaskCategory::Other);
-    NS_ProxyRelease(target, mReactionsStack.forget());
+    NS_ProxyRelease("DocGroup::mReactionsStack", target, mReactionsStack.forget());
   }
 
   mTabGroup->mDocGroups.RemoveEntry(mKey);
 }
 
 nsresult
 DocGroup::Dispatch(const char* aName,
                    TaskCategory aCategory,
--- a/dom/base/WebSocket.cpp
+++ b/dom/base/WebSocket.cpp
@@ -634,18 +634,18 @@ WebSocketImpl::Disconnect()
     // where to, exactly?
     rv.SuppressException();
   }
 
   // DontKeepAliveAnyMore() can release the object. So hold a reference to this
   // until the end of the method.
   RefPtr<WebSocketImpl> kungfuDeathGrip = this;
 
-  NS_ReleaseOnMainThread(mChannel.forget());
-  NS_ReleaseOnMainThread(mService.forget());
+  NS_ReleaseOnMainThread("WebSocketImpl::mChannel", mChannel.forget());
+  NS_ReleaseOnMainThread("WebSocketImpl::mService", mService.forget());
 
   mWebSocket->DontKeepAliveAnyMore();
   mWebSocket->mImpl = nullptr;
 
   if (mWorkerPrivate && mWorkerHolder) {
     UnregisterWorkerHolder();
   }
 
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -573,30 +573,30 @@ nsDOMDataChannel::UpdateMustKeepAlive()
     case DataChannel::CLOSED:
     {
       shouldKeepAlive = false;
     }
   }
 
   if (mSelfRef && !shouldKeepAlive) {
     // release our self-reference (safely) by putting it in an event (always)
-    NS_ReleaseOnMainThread(mSelfRef.forget(), true);
+    NS_ReleaseOnMainThread("nsDOMDataChannel::mSelfRef", mSelfRef.forget(), true);
   } else if (!mSelfRef && shouldKeepAlive) {
     mSelfRef = this;
   }
 }
 
 void
 nsDOMDataChannel::DontKeepAliveAnyMore()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mSelfRef) {
     // Since we're on MainThread, force an eventloop trip to avoid deleting ourselves.
-    NS_ReleaseOnMainThread(mSelfRef.forget(), true);
+    NS_ReleaseOnMainThread("nsDOMDataChannel::mSelfRef", mSelfRef.forget(), true);
   }
 
   mCheckMustKeepAlive = false;
 }
 
 void
 nsDOMDataChannel::EventListenerAdded(nsIAtom* aType)
 {
--- a/dom/cache/Context.cpp
+++ b/dom/cache/Context.cpp
@@ -772,17 +772,18 @@ Context::ThreadsafeHandle::~ThreadsafeHa
   // always holding a strong ref to the ThreadsafeHandle via the owning
   // runnable.  So we cannot run the ThreadsafeHandle destructor simultaneously.
   if (!mStrongRef || mOwningEventTarget->IsOnCurrentThread()) {
     return;
   }
 
   // Dispatch is guaranteed to succeed here because we block shutdown until
   // all Contexts have been destroyed.
-  NS_ProxyRelease(mOwningEventTarget, mStrongRef.forget());
+  NS_ProxyRelease(
+    "Context::ThreadsafeHandle::mStrongRef", mOwningEventTarget, mStrongRef.forget());
 }
 
 void
 Context::ThreadsafeHandle::AllowToCloseOnOwningThread()
 {
   MOZ_ASSERT(mOwningEventTarget->IsOnCurrentThread());
 
   // A Context "closes" when its ref count drops to zero.  Dropping this
--- a/dom/cache/ManagerId.cpp
+++ b/dom/cache/ManagerId.cpp
@@ -60,14 +60,15 @@ ManagerId::~ManagerId()
   if (NS_IsMainThread()) {
     return;
   }
 
   // Otherwise we need to proxy to main thread to do the release
 
   // The PBackground worker thread shouldn't be running after the main thread
   // is stopped.  So main thread is guaranteed to exist here.
-  NS_ReleaseOnMainThread(mPrincipal.forget());
+  NS_ReleaseOnMainThread(
+    "ManagerId::mPrincipal", mPrincipal.forget());
 }
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -881,18 +881,20 @@ Console::Shutdown()
   if (NS_IsMainThread()) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
       obs->RemoveObserver(this, "inner-window-destroyed");
       obs->RemoveObserver(this, "memory-pressure");
     }
   }
 
-  NS_ReleaseOnMainThread(mStorage.forget());
-  NS_ReleaseOnMainThread(mSandbox.forget());
+  NS_ReleaseOnMainThread(
+    "Console::mStorage", mStorage.forget());
+  NS_ReleaseOnMainThread(
+    "Console::mSandbox", mSandbox.forget());
 
   mTimerRegistry.Clear();
   mCounterRegistry.Clear();
 
   mCallDataStorage.Clear();
   mCallDataStoragePending.Clear();
 
   mStatus = eShuttingDown;
--- a/dom/crypto/WebCryptoTask.cpp
+++ b/dom/crypto/WebCryptoTask.cpp
@@ -3740,14 +3740,16 @@ WebCryptoTask::~WebCryptoTask()
   MOZ_ASSERT(mReleasedNSSResources);
 
   nsNSSShutDownPreventionLock lock;
   if (!isAlreadyShutDown()) {
     shutdown(ShutdownCalledFrom::Object);
   }
 
   if (mWorkerHolder) {
-    NS_ProxyRelease(mOriginalEventTarget, mWorkerHolder.forget());
+    NS_ProxyRelease(
+      "WebCryptoTask::mWorkerHolder",
+      mOriginalEventTarget, mWorkerHolder.forget());
   }
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/fetch/Fetch.cpp
+++ b/dom/fetch/Fetch.cpp
@@ -119,17 +119,19 @@ public:
   Shutdown()
   {
     Unfollow();
   }
 
 private:
   ~FetchSignalProxy()
   {
-    NS_ProxyRelease(mMainThreadEventTarget, mSignalMainThread.forget());
+    NS_ProxyRelease(
+      "FetchSignalProxy::mSignalMainThread",
+      mMainThreadEventTarget, mSignalMainThread.forget());
   }
 };
 
 class WorkerFetchResolver final : public FetchDriverObserver
 {
   friend class MainThreadFetchRunnable;
   friend class WorkerDataAvailableRunnable;
   friend class WorkerFetchResponseEndBase;
@@ -1299,17 +1301,18 @@ FetchBody<Derived>::BeginConsumeBodyMain
   rv = pump->AsyncRead(listener, nullptr);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   // Now that everything succeeded, we can assign the pump to a pointer that
   // stays alive for the lifetime of the FetchBody.
   mConsumeBodyPump =
-    new nsMainThreadPtrHolder<nsIInputStreamPump>(pump, mMainThreadEventTarget);
+    new nsMainThreadPtrHolder<nsIInputStreamPump>(
+      "FetchBody::mConsumeBodyPump", pump, mMainThreadEventTarget);
   // It is ok for retargeting to fail and reads to happen on the main thread.
   autoReject.DontFail();
 
   // Try to retarget, otherwise fall back to main thread.
   nsCOMPtr<nsIThreadRetargetableRequest> rr = do_QueryInterface(pump);
   if (rr) {
     nsCOMPtr<nsIEventTarget> sts = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
     rv = rr->RetargetDeliveryTo(sts);
--- a/dom/file/MutableBlobStorage.cpp
+++ b/dom/file/MutableBlobStorage.cpp
@@ -54,18 +54,22 @@ public:
   }
 
 private:
   ~BlobCreationDoneRunnable()
   {
     MOZ_ASSERT(mBlobStorage);
     // If something when wrong, we still have to release these objects in the
     // correct thread.
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mCallback.forget());
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mBlob.forget());
+    NS_ProxyRelease(
+      "BlobCreationDoneRunnable::mCallback",
+      mBlobStorage->EventTarget(), mCallback.forget());
+    NS_ProxyRelease(
+      "BlobCreationDoneRunnable::mBlob",
+      mBlobStorage->EventTarget(), mBlob.forget());
   }
 
   RefPtr<MutableBlobStorage> mBlobStorage;
   RefPtr<MutableBlobStorageCallback> mCallback;
   RefPtr<Blob> mBlob;
   nsresult mRv;
 };
 
@@ -295,18 +299,22 @@ public:
   }
 
 private:
   ~CreateBlobRunnable()
   {
     MOZ_ASSERT(mBlobStorage);
     // If something when wrong, we still have to release data in the correct
     // thread.
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mParent.forget());
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mCallback.forget());
+    NS_ProxyRelease(
+      "CreateBlobRunnable::mParent",
+      mBlobStorage->EventTarget(), mParent.forget());
+    NS_ProxyRelease(
+      "CreateBlobRunnable::mCallback",
+      mBlobStorage->EventTarget(), mCallback.forget());
   }
 
   RefPtr<MutableBlobStorage> mBlobStorage;
   nsCOMPtr<nsISupports> mParent;
   nsCString mContentType;
   RefPtr<MutableBlobStorageCallback> mCallback;
 };
 
@@ -341,18 +349,22 @@ public:
   }
 
 private:
   ~LastRunnable()
   {
     MOZ_ASSERT(mBlobStorage);
     // If something when wrong, we still have to release data in the correct
     // thread.
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mParent.forget());
-    NS_ProxyRelease(mBlobStorage->EventTarget(), mCallback.forget());
+    NS_ProxyRelease(
+      "LastRunnable::mParent",
+      mBlobStorage->EventTarget(), mParent.forget());
+    NS_ProxyRelease(
+      "LastRunnable::mCallback",
+      mBlobStorage->EventTarget(), mCallback.forget());
   }
 
   RefPtr<MutableBlobStorage> mBlobStorage;
   nsCOMPtr<nsISupports> mParent;
   nsCString mContentType;
   RefPtr<MutableBlobStorageCallback> mCallback;
 };
 
--- a/dom/filesystem/FileSystemRequestParent.cpp
+++ b/dom/filesystem/FileSystemRequestParent.cpp
@@ -126,17 +126,18 @@ public:
     }
 
     return NS_OK;
   }
 
 private:
   ~CheckPermissionRunnable()
   {
-     NS_ProxyRelease(mBackgroundEventTarget, mActor.forget());
+     NS_ProxyRelease(
+       "CheckPermissionRunnable::mActor", mBackgroundEventTarget, mActor.forget());
   }
 
   RefPtr<ContentParent> mContentParent;
   RefPtr<FileSystemRequestParent> mActor;
   RefPtr<FileSystemTaskParentBase> mTask;
   const nsString mPath;
 
   nsCOMPtr<nsIEventTarget> mBackgroundEventTarget;
--- a/dom/filesystem/FileSystemTaskBase.cpp
+++ b/dom/filesystem/FileSystemTaskBase.cpp
@@ -246,18 +246,22 @@ FileSystemTaskParentBase::FileSystemTask
   MOZ_ASSERT(mBackgroundEventTarget);
   AssertIsOnBackgroundThread();
 }
 
 FileSystemTaskParentBase::~FileSystemTaskParentBase()
 {
   // This task can be released on different threads because we dispatch it (as
   // runnable) to main-thread, I/O and then back to the PBackground thread.
-  NS_ProxyRelease(mBackgroundEventTarget, mFileSystem.forget());
-  NS_ProxyRelease(mBackgroundEventTarget, mRequestParent.forget());
+  NS_ProxyRelease(
+    "FileSystemTaskParentBase::mFileSystem",
+    mBackgroundEventTarget, mFileSystem.forget());
+  NS_ProxyRelease(
+    "FileSystemTaskParentBase::mRequestParent",
+    mBackgroundEventTarget, mRequestParent.forget());
 }
 
 void
 FileSystemTaskParentBase::Start()
 {
   AssertIsOnBackgroundThread();
   mFileSystem->AssertIsOnOwningThread();
 
--- a/dom/filesystem/GetFilesHelper.cpp
+++ b/dom/filesystem/GetFilesHelper.cpp
@@ -616,17 +616,18 @@ GetFilesHelperParent::GetFilesHelperPare
                                            bool aRecursiveFlag)
   : GetFilesHelper(nullptr, aRecursiveFlag)
   , mContentParent(aContentParent)
   , mUUID(aUUID)
 {}
 
 GetFilesHelperParent::~GetFilesHelperParent()
 {
-  NS_ReleaseOnMainThread(mContentParent.forget());
+  NS_ReleaseOnMainThread(
+    "GetFilesHelperParent::mContentParent", mContentParent.forget());
 }
 
 /* static */ already_AddRefed<GetFilesHelperParent>
 GetFilesHelperParent::Create(const nsID& aUUID, const nsAString& aDirectoryPath,
                              bool aRecursiveFlag, ContentParent* aContentParent,
                              ErrorResult& aRv)
 {
   MOZ_ASSERT(aContentParent);
--- a/dom/media/MediaSegment.h
+++ b/dom/media/MediaSegment.h
@@ -62,17 +62,18 @@ const GraphTime GRAPH_TIME_MAX = MEDIA_T
  * thread. We can compare two PrincipalHandles to each other on any thread, but
  * they can only be created and converted back to nsIPrincipal* on main thread.
  */
 typedef nsMainThreadPtrHandle<nsIPrincipal> PrincipalHandle;
 
 inline PrincipalHandle MakePrincipalHandle(nsIPrincipal* aPrincipal)
 {
   RefPtr<nsMainThreadPtrHolder<nsIPrincipal>> holder =
-    new nsMainThreadPtrHolder<nsIPrincipal>(aPrincipal);
+    new nsMainThreadPtrHolder<nsIPrincipal>(
+      "MakePrincipalHandle::nsIPrincipal", aPrincipal);
   return PrincipalHandle(holder);
 }
 
 #define PRINCIPAL_HANDLE_NONE nullptr
 
 inline nsIPrincipal* GetPrincipalFromHandle(PrincipalHandle& aPrincipalHandle)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1779,17 +1779,19 @@ MediaStreamGraphImpl::RunInStableState(b
              CurrentDriver()->AsAudioCallbackDriver() ? "AudioDriver"
                                                       : "SystemDriver"));
         RefPtr<GraphDriver> driver = CurrentDriver();
         MonitorAutoUnlock unlock(mMonitor);
         driver->Start();
         // It's not safe to Shutdown() a thread from StableState, and
         // releasing this may shutdown a SystemClockDriver thread.
         // Proxy the release to outside of StableState.
-        NS_ReleaseOnMainThread(driver.forget(), true); // always proxy
+        NS_ReleaseOnMainThread(
+          "MediaStreamGraphImpl::CurrentDriver", driver.forget(),
+          true); // always proxy
       }
     }
 
     if ((mForceShutDown || !mRealtime) &&
         mLifecycleState == LIFECYCLE_WAITING_FOR_MAIN_THREAD_CLEANUP) {
       // Defer calls to RunDuringShutdown() to happen while mMonitor is not held.
       for (uint32_t i = 0; i < mBackMessageQueue.Length(); ++i) {
         MessageBlock& mb = mBackMessageQueue[i];
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -92,17 +92,19 @@ TrackBuffersManager::TrackBuffersManager
   , mBufferFull(false)
   , mFirstInitializationSegmentReceived(false)
   , mNewMediaSegmentStarted(false)
   , mActiveTrack(false)
   , mType(aType)
   , mParser(ContainerParser::CreateForMIMEType(aType))
   , mProcessedInput(0)
   , mTaskQueue(aParentDecoder->GetDemuxer()->GetTaskQueue())
-  , mParentDecoder(new nsMainThreadPtrHolder<MediaSourceDecoder>(aParentDecoder, false /* strict */))
+  , mParentDecoder(
+      new nsMainThreadPtrHolder<MediaSourceDecoder>(
+        "TrackBuffersManager::mParentDecoder", aParentDecoder, false /* strict */))
   , mAbstractMainThread(aParentDecoder->AbstractMainThread())
   , mEnded(false)
   , mVideoEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.video",
                                                  100 * 1024 * 1024))
   , mAudioEvictionThreshold(Preferences::GetUint("media.mediasource.eviction_threshold.audio",
                                                  20 * 1024 * 1024))
   , mEvictionState(EvictionState::NO_EVICTION_NEEDED)
   , mMonitor("TrackBuffersManager")
--- a/dom/media/webspeech/recognition/SpeechStreamListener.cpp
+++ b/dom/media/webspeech/recognition/SpeechStreamListener.cpp
@@ -14,17 +14,18 @@ namespace dom {
 
 SpeechStreamListener::SpeechStreamListener(SpeechRecognition* aRecognition)
   : mRecognition(aRecognition)
 {
 }
 
 SpeechStreamListener::~SpeechStreamListener()
 {
-  NS_ReleaseOnMainThread(mRecognition.forget());
+  NS_ReleaseOnMainThread(
+    "SpeechStreamListener::mRecognition", mRecognition.forget());
 }
 
 void
 SpeechStreamListener::NotifyQueuedAudioData(MediaStreamGraph* aGraph, TrackID aID,
                                             StreamTime aTrackOffset,
                                             const AudioSegment& aQueuedMedia,
                                             MediaStream* aInputStream,
                                             TrackID aInputTrackID)
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -1474,17 +1474,18 @@ WorkerNotificationObserver::Observe(nsIS
         // Window has been closed, this observer is not valid anymore
         return NS_ERROR_FAILURE;
       }
     }
 
     // Instead of bothering with adding features and other worker lifecycle
     // management, we simply hold strongrefs to the window and document.
     nsMainThreadPtrHandle<nsPIDOMWindowInner> windowHandle(
-      new nsMainThreadPtrHolder<nsPIDOMWindowInner>(window));
+      new nsMainThreadPtrHolder<nsPIDOMWindowInner>(
+        "WorkerNotificationObserver::Observe::nsPIDOMWindowInner", window));
 
     r = new NotificationClickWorkerRunnable(notification, windowHandle);
   } else if (!strcmp("alertfinished", aTopic)) {
     notification->UnpersistNotification();
     notification->mIsClosed = true;
     r = new NotificationEventWorkerRunnable(notification,
                                             NS_LITERAL_STRING("close"));
   } else if (!strcmp("alertshow", aTopic)) {
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1495,18 +1495,20 @@ ScriptLoader::ProcessOffThreadRequest(Sc
   nsresult rv = ProcessRequest(aRequest);
   mDocument->UnblockOnload(false);
   return rv;
 }
 
 NotifyOffThreadScriptLoadCompletedRunnable::~NotifyOffThreadScriptLoadCompletedRunnable()
 {
   if (MOZ_UNLIKELY(mRequest || mLoader) && !NS_IsMainThread()) {
-    NS_ReleaseOnMainThread(mRequest.forget());
-    NS_ReleaseOnMainThread(mLoader.forget());
+    NS_ReleaseOnMainThread(
+      "NotifyOffThreadScriptLoadCompletedRunnable::mRequest", mRequest.forget());
+    NS_ReleaseOnMainThread(
+      "NotifyOffThreadScriptLoadCompletedRunnable::mLoader", mLoader.forget());
   }
 }
 
 NS_IMETHODIMP
 NotifyOffThreadScriptLoadCompletedRunnable::Run()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
--- a/dom/u2f/U2F.cpp
+++ b/dom/u2f/U2F.cpp
@@ -529,17 +529,18 @@ U2FRegisterRunnable::U2FRegisterRunnable
                                          const Sequence<RegisteredKey>& aRegisteredKeys,
                                          const Sequence<Authenticator>& aAuthenticators,
                                          U2FRegisterCallback* aCallback,
                                          nsISerialEventTarget* aEventTarget)
   : U2FRunnable(aOrigin, aAppId, aEventTarget)
   , mAuthenticators(aAuthenticators)
   // U2FRegisterCallback does not support threadsafe refcounting, and must be
   // used and destroyed on main.
-  , mCallback(new nsMainThreadPtrHolder<U2FRegisterCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<U2FRegisterCallback>(
+      "U2FRegisterRunnable::mCallback", aCallback))
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // The WebIDL dictionary types RegisterRequest and RegisteredKey cannot
   // be copied to this thread, so store them serialized.
   for (const RegisterRequest& req : aRegisterRequests) {
     // Check for required attributes
     if (!req.mChallenge.WasPassed() || !req.mVersion.WasPassed()) {
@@ -763,17 +764,18 @@ U2FSignRunnable::U2FSignRunnable(const n
                                  const Sequence<RegisteredKey>& aRegisteredKeys,
                                  const Sequence<Authenticator>& aAuthenticators,
                                  U2FSignCallback* aCallback,
                                  nsISerialEventTarget* aEventTarget)
   : U2FRunnable(aOrigin, aAppId, aEventTarget)
   , mAuthenticators(aAuthenticators)
   // U2FSignCallback does not support threadsafe refcounting, and must be used
   // and destroyed on main.
-  , mCallback(new nsMainThreadPtrHolder<U2FSignCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<U2FSignCallback>(
+      "U2FSignRunnable::mCallback", aCallback))
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Convert WebIDL objects to generic structs to pass between threads
   for (const RegisteredKey& key : aRegisteredKeys) {
     // Check for required attributes
     if (!key.mVersion.WasPassed() || !key.mKeyHandle.WasPassed()) {
       continue;
--- a/dom/workers/ServiceWorkerJob.cpp
+++ b/dom/workers/ServiceWorkerJob.cpp
@@ -227,17 +227,18 @@ ServiceWorkerJob::Finish(ErrorResult& aR
     mFinalCallback = nullptr;
   }
 
   // The callback might not consume the error.
   aRv.SuppressException();
 
   // Async release this object to ensure that our caller methods complete
   // as well.
-  NS_ReleaseOnMainThread(kungFuDeathGrip.forget(), true /* always proxy */);
+  NS_ReleaseOnMainThread("ServiceWorkerJob",
+    kungFuDeathGrip.forget(), true /* always proxy */);
 }
 
 void
 ServiceWorkerJob::Finish(nsresult aRv)
 {
   ErrorResult converted(aRv);
   Finish(converted);
 }
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -118,18 +118,20 @@ class CheckScriptEvaluationWithCallback 
 #endif
 
 public:
   CheckScriptEvaluationWithCallback(WorkerPrivate* aWorkerPrivate,
                                     ServiceWorkerPrivate* aServiceWorkerPrivate,
                                     KeepAliveToken* aKeepAliveToken,
                                     LifeCycleEventCallback* aScriptEvaluationCallback)
     : WorkerRunnable(aWorkerPrivate)
-    , mServiceWorkerPrivate(new nsMainThreadPtrHolder<ServiceWorkerPrivate>(aServiceWorkerPrivate))
-    , mKeepAliveToken(new nsMainThreadPtrHolder<KeepAliveToken>(aKeepAliveToken))
+    , mServiceWorkerPrivate(new nsMainThreadPtrHolder<ServiceWorkerPrivate>(
+        "CheckScriptEvaluationWithCallback::mServiceWorkerPrivate", aServiceWorkerPrivate))
+    , mKeepAliveToken(new nsMainThreadPtrHolder<KeepAliveToken>(
+        "CheckScriptEvaluationWithCallback::mKeepAliveToken", aKeepAliveToken))
     , mScriptEvaluationCallback(aScriptEvaluationCallback)
 #ifdef DEBUG
     , mDone(false)
 #endif
   {
     AssertIsOnMainThread();
   }
 
@@ -417,17 +419,18 @@ public:
                                 KeepAliveToken* aKeepAliveToken)
     : WorkerRunnable(aWorkerPrivate)
   {
     AssertIsOnMainThread();
     MOZ_ASSERT(aWorkerPrivate);
     MOZ_ASSERT(aKeepAliveToken);
 
     mKeepAliveToken =
-      new nsMainThreadPtrHolder<KeepAliveToken>(aKeepAliveToken);
+      new nsMainThreadPtrHolder<KeepAliveToken>(
+        "ExtendableEventWorkerRunnable::mKeepAliveToken", aKeepAliveToken);
   }
 
   nsresult
   DispatchExtendableEventOnWorkerScope(JSContext* aCx,
                                        WorkerGlobalScope* aWorkerScope,
                                        ExtendableEvent* aEvent,
                                        ExtendableEventCallback* aCallback)
   {
@@ -992,17 +995,18 @@ ServiceWorkerPrivate::SendPushEvent(cons
                                     ServiceWorkerRegistrationInfo* aRegistration)
 {
   nsresult rv = SpawnWorkerIfNeeded(PushEvent, nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   RefPtr<KeepAliveToken> token = CreateEventKeepAliveToken();
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> regInfo(
-    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(aRegistration, false));
+    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
+      "ServiceWorkerRegistrationInfo", aRegistration, false));
 
   RefPtr<WorkerRunnable> r = new SendPushEventRunnable(mWorkerPrivate,
                                                        token,
                                                        aMessageId,
                                                        aData,
                                                        regInfo);
 
   if (mInfo->State() == ServiceWorkerState::Activating) {
@@ -1680,20 +1684,22 @@ ServiceWorkerPrivate::SendFetchEvent(nsI
                                     aLoadGroup);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!newWorkerCreated) {
     aChannel->SetLaunchServiceWorkerEnd(TimeStamp::Now());
   }
 
   nsMainThreadPtrHandle<nsIInterceptedChannel> handle(
-    new nsMainThreadPtrHolder<nsIInterceptedChannel>(aChannel, false));
+    new nsMainThreadPtrHolder<nsIInterceptedChannel>(
+      "nsIInterceptedChannel", aChannel, false));
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> regInfo(
-    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(registration, false));
+    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
+      "ServiceWorkerRegistrationInfo", registration, false));
 
   RefPtr<KeepAliveToken> token = CreateEventKeepAliveToken();
 
 
   RefPtr<FetchEventRunnable> r =
     new FetchEventRunnable(mWorkerPrivate, token, handle,
                            mInfo->ScriptSpec(), regInfo,
                            aDocumentId, aIsReload, newWorkerCreated);
--- a/dom/workers/ServiceWorkerRegistrationInfo.cpp
+++ b/dom/workers/ServiceWorkerRegistrationInfo.cpp
@@ -271,17 +271,18 @@ ServiceWorkerRegistrationInfo::Activate(
   NS_DispatchToMainThread(controllerChangeRunnable);
 
   nsCOMPtr<nsIRunnable> failRunnable =
     NewRunnableMethod<bool>(this,
                             &ServiceWorkerRegistrationInfo::FinishActivate,
                             false /* success */);
 
   nsMainThreadPtrHandle<ServiceWorkerRegistrationInfo> handle(
-    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(this));
+    new nsMainThreadPtrHolder<ServiceWorkerRegistrationInfo>(
+      "ServiceWorkerRegistrationInfo", this));
   RefPtr<LifeCycleEventCallback> callback = new ContinueActivateRunnable(handle);
 
   ServiceWorkerPrivate* workerPrivate = mActiveWorker->WorkerPrivate();
   MOZ_ASSERT(workerPrivate);
   nsresult rv = workerPrivate->SendLifeCycleEvent(NS_LITERAL_STRING("activate"),
                                                   callback, failRunnable);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     MOZ_ALWAYS_SUCCEEDS(NS_DispatchToMainThread(failRunnable));
--- a/dom/workers/ServiceWorkerUpdateJob.cpp
+++ b/dom/workers/ServiceWorkerUpdateJob.cpp
@@ -439,17 +439,18 @@ ServiceWorkerUpdateJob::ComparisonResult
                           mRegistration->mScope,
                           mScriptSpec,
                           aNewCacheName,
                           mLoadFlags);
 
   mRegistration->SetEvaluating(sw);
 
   nsMainThreadPtrHandle<ServiceWorkerUpdateJob> handle(
-      new nsMainThreadPtrHolder<ServiceWorkerUpdateJob>(this));
+      new nsMainThreadPtrHolder<ServiceWorkerUpdateJob>(
+        "ServiceWorkerUpdateJob", this));
   RefPtr<LifeCycleEventCallback> callback = new ContinueUpdateRunnable(handle);
 
   ServiceWorkerPrivate* workerPrivate = sw->WorkerPrivate();
   MOZ_ASSERT(workerPrivate);
   rv = workerPrivate->CheckScriptEvaluation(callback);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     FailUpdateJob(NS_ERROR_DOM_ABORT_ERR);
@@ -514,17 +515,18 @@ ServiceWorkerUpdateJob::Install(ServiceW
   NS_DispatchToMainThread(upr);
 
   // Call ContinueAfterInstallEvent(false) on main thread if the SW
   // script fails to load.
   nsCOMPtr<nsIRunnable> failRunnable = NewRunnableMethod<bool>
     (this, &ServiceWorkerUpdateJob::ContinueAfterInstallEvent, false);
 
   nsMainThreadPtrHandle<ServiceWorkerUpdateJob> handle(
-    new nsMainThreadPtrHolder<ServiceWorkerUpdateJob>(this));
+    new nsMainThreadPtrHolder<ServiceWorkerUpdateJob>(
+      "ServiceWorkerUpdateJob", this));
   RefPtr<LifeCycleEventCallback> callback = new ContinueInstallRunnable(handle);
 
   // Send the install event to the worker thread
   ServiceWorkerPrivate* workerPrivate =
     mRegistration->GetInstalling()->WorkerPrivate();
   nsresult rv = workerPrivate->SendLifeCycleEvent(NS_LITERAL_STRING("install"),
                                                   callback, failRunnable);
   if (NS_WARN_IF(NS_FAILED(rv))) {
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -4149,17 +4149,18 @@ WorkerDebugger::WorkerDebugger(WorkerPri
 }
 
 WorkerDebugger::~WorkerDebugger()
 {
   MOZ_ASSERT(!mWorkerPrivate);
 
   if (!NS_IsMainThread()) {
     for (size_t index = 0; index < mListeners.Length(); ++index) {
-      NS_ReleaseOnMainThread(mListeners[index].forget());
+      NS_ReleaseOnMainThread(
+        "WorkerDebugger::mListeners", mListeners[index].forget());
     }
   }
 }
 
 NS_IMPL_ISUPPORTS(WorkerDebugger, nsIWorkerDebugger)
 
 NS_IMETHODIMP
 WorkerDebugger::GetIsClosed(bool* aResult)
--- a/extensions/spellcheck/src/mozPersonalDictionary.cpp
+++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -57,17 +57,19 @@ public:
   {
   }
 
   NS_IMETHOD Run() override
   {
     mDict->SyncLoad();
 
     // Release the dictionary on the main thread
-    NS_ReleaseOnMainThread(mDict.forget().downcast<mozIPersonalDictionary>());
+    NS_ReleaseOnMainThread(
+      "mozPersonalDictionaryLoader::mDict",
+      mDict.forget().downcast<mozIPersonalDictionary>());
 
     return NS_OK;
   }
 
 private:
   RefPtr<mozPersonalDictionary> mDict;
 };
 
@@ -128,17 +130,19 @@ public:
       mDict->mSavePending = false;
       mon.Notify();
 
       // Leaving the block where 'mon' was declared will call the destructor
       // and unlock.
     }
 
     // Release the dictionary on the main thread.
-    NS_ReleaseOnMainThread(mDict.forget().downcast<mozIPersonalDictionary>());
+    NS_ReleaseOnMainThread(
+      "mozPersonalDictionarySave::mDict",
+      mDict.forget().downcast<mozIPersonalDictionary>());
 
     return NS_OK;
   }
 
 private:
   nsTArray<nsString> mDictWords;
   nsCOMPtr<nsIFile> mFile;
   RefPtr<mozPersonalDictionary> mDict;
--- a/image/ImageURL.h
+++ b/image/ImageURL.h
@@ -29,17 +29,17 @@ class ImageCacheKey;
  * By not implementing nsIURI, external code cannot unintentionally be given an
  * nsIURI pointer with this limited class behind it; instead, conversion to a
  * fully implemented nsIURI is required (e.g. through NS_NewURI).
  */
 class ImageURL
 {
 public:
   explicit ImageURL(nsIURI* aURI, nsresult& aRv)
-    : mURI(new nsMainThreadPtrHolder<nsIURI>(aURI))
+    : mURI(new nsMainThreadPtrHolder<nsIURI>("ImageURL::mURI", aURI))
   {
     MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!");
 
     aRv = aURI->GetSpec(mSpec);
     NS_ENSURE_SUCCESS_VOID(aRv);
 
     aRv = aURI->GetScheme(mScheme);
     NS_ENSURE_SUCCESS_VOID(aRv);
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -34,17 +34,18 @@
 // nsIconChannel methods
 nsIconChannel::nsIconChannel()
 {
 }
 
 nsIconChannel::~nsIconChannel()
 {
   if (mLoadInfo) {
-    NS_ReleaseOnMainThread(mLoadInfo.forget());
+    NS_ReleaseOnMainThread(
+      "nsIconChannel::mLoadInfo", mLoadInfo.forget());
   }
 }
 
 NS_IMPL_ISUPPORTS(nsIconChannel,
                   nsIChannel,
                   nsIRequest,
                   nsIRequestObserver,
                   nsIStreamListener)
--- a/image/decoders/icon/win/nsIconChannel.cpp
+++ b/image/decoders/icon/win/nsIconChannel.cpp
@@ -67,17 +67,18 @@ GetStockIconIDForName(const nsACString& 
 // nsIconChannel methods
 nsIconChannel::nsIconChannel()
 {
 }
 
 nsIconChannel::~nsIconChannel()
 {
   if (mLoadInfo) {
-    NS_ReleaseOnMainThread(mLoadInfo.forget());
+    NS_ReleaseOnMainThread(
+      "nsIconChannel::mLoadInfo", mLoadInfo.forget());
   }
 }
 
 NS_IMPL_ISUPPORTS(nsIconChannel,
                   nsIChannel,
                   nsIRequest,
                   nsIRequestObserver,
                   nsIStreamListener)
--- a/ipc/mscom/MainThreadHandoff.cpp
+++ b/ipc/mscom/MainThreadHandoff.cpp
@@ -216,17 +216,18 @@ MainThreadHandoff::Release()
     // If so, we need to dispatch an event to delete ourselves.
     if (NS_IsMainThread()) {
       delete this;
     } else {
       // We need to delete this object on the main thread, but we aren't on the
       // main thread right now, so we send a reference to ourselves to the main
       // thread to be re-released there.
       RefPtr<MainThreadHandoff> self = this;
-      NS_ReleaseOnMainThread(self.forget());
+      NS_ReleaseOnMainThread(
+        "MainThreadHandoff", self.forget());
     }
   }
   return newRefCnt;
 }
 
 HRESULT
 MainThreadHandoff::FixIServiceProvider(ICallFrame* aFrame)
 {
--- a/ipc/mscom/WeakRef.cpp
+++ b/ipc/mscom/WeakRef.cpp
@@ -163,17 +163,18 @@ WeakReferenceSupport::Release()
   if (newRefCnt == 0) {
     if (mFlags != Flags::eDestroyOnMainThread || NS_IsMainThread()) {
       delete this;
     } else {
       // We need to delete this object on the main thread, but we aren't on the
       // main thread right now, so we send a reference to ourselves to the main
       // thread to be re-released there.
       RefPtr<WeakReferenceSupport> self = this;
-      NS_ReleaseOnMainThread(self.forget());
+      NS_ReleaseOnMainThread(
+        "WeakReferenceSupport", self.forget());
     }
   }
   return newRefCnt;
 }
 
 HRESULT
 WeakReferenceSupport::GetWeakReference(IWeakReference** aOutWeakRef)
 {
--- a/js/xpconnect/loader/ScriptPreloader.cpp
+++ b/js/xpconnect/loader/ScriptPreloader.cpp
@@ -645,17 +645,17 @@ ScriptPreloader::Run()
 
     auto result = WriteCache();
     Unused << NS_WARN_IF(result.isErr());
 
     result = mChildCache->WriteCache();
     Unused << NS_WARN_IF(result.isErr());
 
     mSaveComplete = true;
-    NS_ReleaseOnMainThread(mSaveThread.forget());
+    NS_ReleaseOnMainThread("ScriptPreloader::mSaveThread", mSaveThread.forget());
 
     mal.NotifyAll();
     return NS_OK;
 }
 
 void
 ScriptPreloader::NoteScript(const nsCString& url, const nsCString& cachePath,
                             JS::HandleScript jsscript)
--- a/layout/style/URLExtraData.cpp
+++ b/layout/style/URLExtraData.cpp
@@ -27,15 +27,15 @@ URLExtraData::InitDummy()
 URLExtraData::ReleaseDummy()
 {
   sDummy = nullptr;
 }
 
 URLExtraData::~URLExtraData()
 {
   if (!NS_IsMainThread()) {
-    NS_ReleaseOnMainThread(mBaseURI.forget());
-    NS_ReleaseOnMainThread(mReferrer.forget());
-    NS_ReleaseOnMainThread(mPrincipal.forget());
+    NS_ReleaseOnMainThread("URLExtraData::mBaseURI", mBaseURI.forget());
+    NS_ReleaseOnMainThread("URLExtraData::mReferrer", mReferrer.forget());
+    NS_ReleaseOnMainThread("URLExtraData::mPrincipal", mPrincipal.forget());
   }
 }
 
 } // namespace mozilla
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -2866,17 +2866,17 @@ css::URLValueData::GetURI() const
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mURIResolved) {
     MOZ_ASSERT(!mURI);
     nsCOMPtr<nsIURI> newURI;
     NS_NewURI(getter_AddRefs(newURI),
               NS_ConvertUTF16toUTF8(mString),
               nullptr, mExtraData->BaseURI());
-    mURI = new PtrHolder<nsIURI>(newURI.forget());
+    mURI = new PtrHolder<nsIURI>("URLValueData::mURI", newURI.forget());
     mURIResolved = true;
   }
 
   return mURI;
 }
 
 bool
 css::URLValueData::IsLocalRef() const
@@ -3003,17 +3003,17 @@ URLValue::URLValue(const nsAString& aStr
   : URLValueData(aString, do_AddRef(new URLExtraData(aBaseURI, aReferrer,
                                                      aOriginPrincipal)))
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 URLValue::URLValue(nsIURI* aURI, const nsAString& aString, nsIURI* aBaseURI,
                    nsIURI* aReferrer, nsIPrincipal* aOriginPrincipal)
-  : URLValueData(do_AddRef(new PtrHolder<nsIURI>(aURI)),
+  : URLValueData(do_AddRef(new PtrHolder<nsIURI>("URLValueData::mURI", aURI)),
                  aString,
                  do_AddRef(new URLExtraData(aBaseURI, aReferrer,
                                             aOriginPrincipal)))
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 size_t
@@ -3026,17 +3026,17 @@ css::URLValue::SizeOfIncludingThis(mozil
     n += URLValueData::SizeOfExcludingThis(aMallocSizeOf);
   }
   return n;
 }
 
 css::ImageValue::ImageValue(nsIURI* aURI, const nsAString& aString,
                             already_AddRefed<URLExtraData> aExtraData,
                             nsIDocument* aDocument)
-  : URLValueData(do_AddRef(new PtrHolder<nsIURI>(aURI)),
+  : URLValueData(do_AddRef(new PtrHolder<nsIURI>("URLValueData::mURI", aURI)),
                  aString, Move(aExtraData))
 {
   Initialize(aDocument);
 }
 
 css::ImageValue::ImageValue(const nsAString& aString,
                             already_AddRefed<URLExtraData> aExtraData)
   : URLValueData(aString, Move(aExtraData))
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3460,17 +3460,19 @@ nsStyleDisplay::~nsStyleDisplay()
     // whether we're in a Servo traversal, parallel or not. So we
     // unconditionally proxy in debug builds.
     bool alwaysProxy =
 #ifdef DEBUG
       true;
 #else
       false;
 #endif
-    NS_ReleaseOnMainThread(mSpecifiedTransform.forget(), alwaysProxy);
+    NS_ReleaseOnMainThread(
+      "nsStyleDisplay::mSpecifiedTransform",
+      mSpecifiedTransform.forget(), alwaysProxy);
   }
 
   MOZ_COUNT_DTOR(nsStyleDisplay);
 }
 
 nsChangeHint
 nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
 {
@@ -3764,17 +3766,18 @@ nsStyleVisibility::CalcDifference(const 
   return hint;
 }
 
 nsStyleContentData::~nsStyleContentData()
 {
   MOZ_COUNT_DTOR(nsStyleContentData);
 
   if (mType == eStyleContentType_Image) {
-    NS_ReleaseOnMainThread(dont_AddRef(mContent.mImage));
+    NS_ReleaseOnMainThread(
+      "nsStyleContentData::mContent.mImage", dont_AddRef(mContent.mImage));
     mContent.mImage = nullptr;
   } else if (mType == eStyleContentType_Counter ||
              mType == eStyleContentType_Counters) {
     mContent.mCounters->Release();
   } else if (mContent.mString) {
     free(mContent.mString);
   }
 }
@@ -4355,17 +4358,19 @@ nsStyleUIReset::~nsStyleUIReset()
   // See the nsStyleDisplay destructor for why we're doing this.
   if (mSpecifiedWindowTransform && ServoStyleSet::IsInServoTraversal()) {
     bool alwaysProxy =
 #ifdef DEBUG
       true;
 #else
       false;
 #endif
-    NS_ReleaseOnMainThread(mSpecifiedWindowTransform.forget(), alwaysProxy);
+    NS_ReleaseOnMainThread(
+      "nsStyleUIReset::mSpecifiedWindowTransform",
+      mSpecifiedWindowTransform.forget(), alwaysProxy);
   }
 }
 
 nsChangeHint
 nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const
 {
   nsChangeHint hint = nsChangeHint(0);
 
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -540,17 +540,18 @@ public:
   }
 
 protected:
   virtual ~AudioProxyThread()
   {
     // Conduits must be released on MainThread, and we might have the last reference
     // We don't need to worry about runnables still trying to access the conduit, since
     // the runnables hold a ref to AudioProxyThread.
-    NS_ReleaseOnMainThread(mConduit.forget());
+    NS_ReleaseOnMainThread(
+      "AudioProxyThread::mConduit", mConduit.forget());
     MOZ_COUNT_DTOR(AudioProxyThread);
   }
 
   RefPtr<AudioSessionConduit> mConduit;
   nsCOMPtr<nsIEventTarget> mThread;
   // Only accessed on mThread
   nsAutoPtr<AudioPacketizer<int16_t, int16_t>> packetizer_;
   // A buffer to hold a single packet of audio.
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp
@@ -1452,17 +1452,19 @@ PeerConnectionMedia::AddTransportFlow(in
     WrapRunnable(this, &PeerConnectionMedia::ConnectDtlsListener_s, aFlow),
     NS_DISPATCH_NORMAL);
 }
 
 void
 PeerConnectionMedia::RemoveTransportFlow(int aIndex, bool aRtcp)
 {
   int index_inner = GetTransportFlowIndex(aIndex, aRtcp);
-  NS_ProxyRelease(GetSTSThread(), mTransportFlows[index_inner].forget());
+  NS_ProxyRelease(
+    "PeerConnectionMedia::mTransportFlows",
+    GetSTSThread(), mTransportFlows[index_inner].forget());
 }
 
 void
 PeerConnectionMedia::ConnectDtlsListener_s(const RefPtr<TransportFlow>& aFlow)
 {
   TransportLayer* dtls = aFlow->GetLayer(TransportLayerDtls::ID());
   if (dtls) {
     dtls->SignalStateChange.connect(this, &PeerConnectionMedia::DtlsConnected_s);
--- a/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
+++ b/media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
@@ -477,17 +477,18 @@ WebrtcGlobalInformation::GetAllStats(
     return;
   }
 
   MOZ_ASSERT(XRE_IsParentProcess());
 
   // CallbackObject does not support threadsafe refcounting, and must be
   // used and destroyed on main.
   StatsRequestCallback callbackHandle(
-    new nsMainThreadPtrHolder<WebrtcGlobalStatisticsCallback>(&aStatsCallback));
+    new nsMainThreadPtrHolder<WebrtcGlobalStatisticsCallback>(
+      "WebrtcGlobalStatisticsCallback", &aStatsCallback));
 
   nsString filter;
   if (pcIdFilter.WasPassed()) {
     filter = pcIdFilter.Value();
   }
 
   auto* request = StatsRequest::Create(callbackHandle, filter);
 
@@ -619,17 +620,18 @@ WebrtcGlobalInformation::GetLogging(
     return;
   }
 
   MOZ_ASSERT(XRE_IsParentProcess());
 
   // CallbackObject does not support threadsafe refcounting, and must be
   // destroyed on main.
   LogRequestCallback callbackHandle(
-    new nsMainThreadPtrHolder<WebrtcGlobalLoggingCallback>(&aLoggingCallback));
+    new nsMainThreadPtrHolder<WebrtcGlobalLoggingCallback>(
+      "WebrtcGlobalLoggingCallback", &aLoggingCallback));
 
   nsAutoCString pattern;
   CopyUTF16toUTF8(aPattern, pattern);
 
   LogRequest* request = LogRequest::Create(callbackHandle, pattern);
 
   if (!request) {
     aRv.Throw(NS_ERROR_FAILURE);
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -204,17 +204,17 @@ nsJARChannel::nsJARChannel()
     mBlockRemoteFiles = Preferences::GetBool("network.jar.block-remote-files", false);
 
     // hold an owning reference to the jar handler
     NS_ADDREF(gJarHandler);
 }
 
 nsJARChannel::~nsJARChannel()
 {
-    NS_ReleaseOnMainThread(mLoadInfo.forget());
+    NS_ReleaseOnMainThread("nsJARChannel::mLoadInfo", mLoadInfo.forget());
 
     // release owning reference to the jar handler
     nsJARProtocolHandler *handler = gJarHandler;
     NS_RELEASE(handler); // nullptr parameter
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(nsJARChannel,
                             nsHashPropertyBag,
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -368,17 +368,18 @@ Dashboard::~Dashboard()
 {
 }
 
 NS_IMETHODIMP
 Dashboard::RequestSockets(NetDashboardCallback *aCallback)
 {
     RefPtr<SocketData> socketData = new SocketData();
     socketData->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
     socketData->mEventTarget = GetCurrentThreadEventTarget();
     gSocketTransportService->Dispatch(NewRunnableMethod<RefPtr<SocketData>>
 				      (this, &Dashboard::GetSocketsDispatch, socketData),
 				      NS_DISPATCH_NORMAL);
     return NS_OK;
 }
 
 nsresult
@@ -437,17 +438,18 @@ Dashboard::GetSockets(SocketData *aSocke
     return NS_OK;
 }
 
 NS_IMETHODIMP
 Dashboard::RequestHttpConnections(NetDashboardCallback *aCallback)
 {
     RefPtr<HttpData> httpData = new HttpData();
     httpData->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
     httpData->mEventTarget = GetCurrentThreadEventTarget();
 
     gSocketTransportService->Dispatch(NewRunnableMethod<RefPtr<HttpData>>
 				      (this, &Dashboard::GetHttpDispatch, httpData),
 				      NS_DISPATCH_NORMAL);
     return NS_OK;
 }
 
@@ -613,17 +615,18 @@ Dashboard::NewMsgReceived(const nsACStri
     return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 Dashboard::RequestWebsocketConnections(NetDashboardCallback *aCallback)
 {
     RefPtr<WebSocketRequest> wsRequest = new WebSocketRequest();
     wsRequest->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
     wsRequest->mEventTarget = GetCurrentThreadEventTarget();
 
     wsRequest->mEventTarget->Dispatch(NewRunnableMethod<RefPtr<WebSocketRequest>>
                                       (this, &Dashboard::GetWebSocketConnections, wsRequest),
                                       NS_DISPATCH_NORMAL);
     return NS_OK;
 }
 
@@ -664,17 +667,18 @@ Dashboard::GetWebSocketConnections(WebSo
     return NS_OK;
 }
 
 NS_IMETHODIMP
 Dashboard::RequestDNSInfo(NetDashboardCallback *aCallback)
 {
     RefPtr<DnsData> dnsData = new DnsData();
     dnsData->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
 
     nsresult rv;
     dnsData->mData.Clear();
     dnsData->mEventTarget = GetCurrentThreadEventTarget();
 
     if (!mDnsService) {
         mDnsService = do_GetService("@mozilla.org/network/dns-service;1", &rv);
         if (NS_FAILED(rv)) {
@@ -764,32 +768,34 @@ Dashboard::RequestDNSLookup(const nsACSt
         mDnsService = do_GetService("@mozilla.org/network/dns-service;1", &rv);
         if (NS_FAILED(rv)) {
             return rv;
         }
     }
 
     RefPtr<LookupHelper> helper = new LookupHelper();
     helper->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
     helper->mEventTarget = GetCurrentThreadEventTarget();
     OriginAttributes attrs;
     rv = mDnsService->AsyncResolveNative(aHost, 0, helper.get(),
                                          NS_GetCurrentThread(), attrs,
                                          getter_AddRefs(helper->mCancel));
     return rv;
 }
 
 NS_IMETHODIMP
 Dashboard::RequestRcwnStats(NetDashboardCallback *aCallback)
 {
     RefPtr<RcwnData> rcwnData = new RcwnData();
     rcwnData->mEventTarget = GetCurrentThreadEventTarget();
     rcwnData->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
 
     return rcwnData->mEventTarget->Dispatch(
         NewRunnableMethod<RefPtr<RcwnData>>(this, &Dashboard::GetRcwnData, rcwnData),
         NS_DISPATCH_NORMAL);
 }
 
 nsresult
 Dashboard::GetRcwnData(RcwnData *aData)
@@ -856,17 +862,18 @@ Dashboard::RequestConnection(const nsACS
     nsresult rv;
     RefPtr<ConnectionData> connectionData = new ConnectionData(this);
     connectionData->mHost = aHost;
     connectionData->mPort = aPort;
     connectionData->mProtocol = aProtocol;
     connectionData->mTimeout = aTimeout;
 
     connectionData->mCallback =
-        new nsMainThreadPtrHolder<NetDashboardCallback>(aCallback, true);
+        new nsMainThreadPtrHolder<NetDashboardCallback>(
+          "NetDashboardCallback", aCallback, true);
     connectionData->mEventTarget = GetCurrentThreadEventTarget();
 
     rv = TestNewConnection(connectionData);
     if (NS_FAILED(rv)) {
         mozilla::net::GetErrorString(rv, connectionData->mStatus);
         connectionData->mEventTarget->Dispatch(NewRunnableMethod<RefPtr<ConnectionData>>
                                                (this, &Dashboard::GetConnectionStatus, connectionData),
                                                NS_DISPATCH_NORMAL);
--- a/netwerk/base/TLSServerSocket.cpp
+++ b/netwerk/base/TLSServerSocket.cpp
@@ -271,17 +271,18 @@ TLSServerSocket::SetVersionRange(uint16_
 namespace {
 
 class TLSServerSecurityObserverProxy final : public nsITLSServerSecurityObserver
 {
   ~TLSServerSecurityObserverProxy() {}
 
 public:
   explicit TLSServerSecurityObserverProxy(nsITLSServerSecurityObserver* aListener)
-    : mListener(new nsMainThreadPtrHolder<nsITLSServerSecurityObserver>(aListener))
+    : mListener(new nsMainThreadPtrHolder<nsITLSServerSecurityObserver>(
+        "TLSServerSecurityObserverProxy::mListener", aListener))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITLSSERVERSECURITYOBSERVER
 
   class OnHandshakeDoneRunnable : public Runnable
   {
   public:
@@ -350,17 +351,18 @@ TLSServerConnectionInfo::~TLSServerConne
 
   RefPtr<nsITLSServerSecurityObserver> observer;
   {
     MutexAutoLock lock(mLock);
     observer = mSecurityObserver.forget();
   }
 
   if (observer) {
-    NS_ReleaseOnMainThread(observer.forget());
+    NS_ReleaseOnMainThread(
+      "TLSServerConnectionInfo::mSecurityObserver", observer.forget());
   }
 }
 
 NS_IMETHODIMP
 TLSServerConnectionInfo::SetSecurityObserver(nsITLSServerSecurityObserver* aObserver)
 {
   {
     MutexAutoLock lock(mLock);
--- a/netwerk/base/nsBaseChannel.cpp
+++ b/netwerk/base/nsBaseChannel.cpp
@@ -64,17 +64,18 @@ nsBaseChannel::nsBaseChannel()
   , mContentLength(-1)
   , mWasOpened(false)
 {
   mContentType.AssignLiteral(UNKNOWN_CONTENT_TYPE);
 }
 
 nsBaseChannel::~nsBaseChannel()
 {
-  NS_ReleaseOnMainThread(mLoadInfo.forget());
+  NS_ReleaseOnMainThread(
+    "nsBaseChannel::mLoadInfo", mLoadInfo.forget());
 }
 
 nsresult
 nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
                         bool openNewChannel)
 {
   SUSPEND_PUMP_FOR_SCOPE();
 
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -124,29 +124,33 @@ private:
     ~nsAsyncResolveRequest()
     {
         if (!NS_IsMainThread()) {
             // these xpcom pointers might need to be proxied back to the
             // main thread to delete safely, but if this request had its
             // callbacks called normally they will all be null and this is a nop
 
             if (mChannel) {
-                NS_ReleaseOnMainThread(mChannel.forget());
+                NS_ReleaseOnMainThread(
+                  "nsAsyncResolveRequest::mChannel", mChannel.forget());
             }
 
             if (mCallback) {
-                NS_ReleaseOnMainThread(mCallback.forget());
+                NS_ReleaseOnMainThread(
+                  "nsAsyncResolveRequest::mCallback", mCallback.forget());
             }
 
             if (mProxyInfo) {
-                NS_ReleaseOnMainThread(mProxyInfo.forget());
+                NS_ReleaseOnMainThread(
+                  "nsAsyncResolveRequest::mProxyInfo", mProxyInfo.forget());
             }
 
             if (mXPComPPS) {
-                NS_ReleaseOnMainThread(mXPComPPS.forget());
+                NS_ReleaseOnMainThread(
+                  "nsAsyncResolveRequest::mXPComPPS", mXPComPPS.forget());
             }
         }
     }
 
 public:
     void SetResult(nsresult status, nsIProxyInfo *pi)
     {
         mStatus = status;
@@ -357,17 +361,18 @@ public:
 
         return NS_DispatchToMainThread(event);
     }
 
 private:
     ~AsyncGetPACURIRequest()
     {
         MOZ_ASSERT(NS_IsMainThread() == mIsMainThreadOnly);
-        NS_ReleaseOnMainThread(mServiceHolder.forget());
+        NS_ReleaseOnMainThread(
+          "AsyncGetPACURIRequest::mServiceHolder", mServiceHolder.forget());
     }
 
     bool mIsMainThreadOnly;
 
     nsProtocolProxyService* mService; // ref-count is hold by mServiceHolder
     nsCOMPtr<nsIProtocolProxyService2> mServiceHolder;
     CallbackFunc mCallback;
     nsCOMPtr<nsISystemProxySettings> mSystemProxySettings;
--- a/netwerk/base/nsRequestObserverProxy.cpp
+++ b/netwerk/base/nsRequestObserverProxy.cpp
@@ -171,18 +171,20 @@ nsRequestObserverProxy::OnStopRequest(ns
 //-----------------------------------------------------------------------------
 // nsRequestObserverProxy::nsIRequestObserverProxy implementation...
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsRequestObserverProxy::Init(nsIRequestObserver *observer, nsISupports *context)
 {
     NS_ENSURE_ARG_POINTER(observer);
-    mObserver = new nsMainThreadPtrHolder<nsIRequestObserver>(observer);
-    mContext = new nsMainThreadPtrHolder<nsISupports>(context);
+    mObserver = new nsMainThreadPtrHolder<nsIRequestObserver>(
+      "nsRequestObserverProxy::mObserver", observer);
+    mContext = new nsMainThreadPtrHolder<nsISupports>(
+      "nsRequestObserverProxy::mContext", context);
 
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsRequestObserverProxy implementation...
 //-----------------------------------------------------------------------------
 
--- a/netwerk/base/nsServerSocket.cpp
+++ b/netwerk/base/nsServerSocket.cpp
@@ -231,17 +231,18 @@ nsServerSocket::OnSocketDetached(PRFileD
     {
       MutexAutoLock lock(mLock);
       listener = mListener.forget();
     }
 
     // XXX we need to proxy the release to the listener's target thread to work
     // around bug 337492.
     if (listener) {
-      NS_ProxyRelease(mListenerTarget, listener.forget());
+      NS_ProxyRelease(
+        "nsServerSocket::mListener", mListenerTarget, listener.forget());
     }
   }
 }
 
 void
 nsServerSocket::IsLocal(bool *aIsLocal)
 {
 #if defined(XP_UNIX)
@@ -417,17 +418,18 @@ nsServerSocket::Close()
 namespace {
 
 class ServerSocketListenerProxy final : public nsIServerSocketListener
 {
   ~ServerSocketListenerProxy() {}
 
 public:
   explicit ServerSocketListenerProxy(nsIServerSocketListener* aListener)
-    : mListener(new nsMainThreadPtrHolder<nsIServerSocketListener>(aListener))
+    : mListener(new nsMainThreadPtrHolder<nsIServerSocketListener>(
+        "ServerSocketListenerProxy::mListener", aListener))
     , mTarget(GetCurrentThreadEventTarget())
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISERVERSOCKETLISTENER
 
   class OnSocketAcceptedRunnable : public Runnable
   {
--- a/netwerk/base/nsStreamListenerTee.cpp
+++ b/netwerk/base/nsStreamListenerTee.cpp
@@ -37,17 +37,18 @@ nsStreamListenerTee::OnStopRequest(nsIRe
     // it is critical that we close out the input stream tee
     if (mInputTee) {
         mInputTee->SetSink(nullptr);
         mInputTee = nullptr;
     }
 
     // release sink on the same thread where the data was written (bug 716293)
     if (mEventTarget) {
-      NS_ProxyRelease(mEventTarget, mSink.forget());
+      NS_ProxyRelease(
+        "nsStreamListenerTee::mSink", mEventTarget, mSink.forget());
     }
     else {
         mSink = nullptr;
     }
 
     nsresult rv = mListener->OnStopRequest(request, context, status);
     if (mObserver)
         mObserver->OnStopRequest(request, context, status);
--- a/netwerk/base/nsTransportUtils.cpp
+++ b/netwerk/base/nsTransportUtils.cpp
@@ -32,17 +32,18 @@ public:
         NS_ADDREF(mSink);
     }
 
 private:
     virtual ~nsTransportEventSinkProxy()
     {
         // our reference to mSink could be the last, so be sure to release
         // it on the target thread.  otherwise, we could get into trouble.
-        NS_ProxyRelease(mTarget, dont_AddRef(mSink));
+        NS_ProxyRelease(
+          "nsTransportEventSinkProxy::mSink", mTarget, dont_AddRef(mSink));
     }
 
 public:
     nsITransportEventSink           *mSink;
     nsCOMPtr<nsIEventTarget>         mTarget;
     Mutex                            mLock;
     nsTransportStatusEvent          *mLastEvent;
 };
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -526,17 +526,18 @@ nsUDPSocket::OnSocketDetached(PRFileDesc
     RefPtr<nsIUDPSocketListener> listener = nullptr;
     {
       MutexAutoLock lock(mLock);
       listener = mListener.forget();
     }
 
     if (listener) {
       listener->OnStopListening(this, mCondition);
-      NS_ProxyRelease(mListenerTarget, listener.forget());
+      NS_ProxyRelease(
+        "nsUDPSocket::mListener", mListenerTarget, listener.forget());
     }
   }
 }
 
 void
 nsUDPSocket::IsLocal(bool *aIsLocal)
 {
   // If bound to loopback, this UDP socket only accepts local connections.
@@ -841,17 +842,18 @@ namespace {
 // SocketListenerProxy
 //-----------------------------------------------------------------------------
 class SocketListenerProxy final : public nsIUDPSocketListener
 {
   ~SocketListenerProxy() {}
 
 public:
   explicit SocketListenerProxy(nsIUDPSocketListener* aListener)
-    : mListener(new nsMainThreadPtrHolder<nsIUDPSocketListener>(aListener))
+    : mListener(new nsMainThreadPtrHolder<nsIUDPSocketListener>(
+        "SocketListenerProxy::mListener", aListener))
     , mTarget(GetCurrentThreadEventTarget())
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIUDPSOCKETLISTENER
 
   class OnPacketReceivedRunnable : public Runnable
   {
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -2690,17 +2690,18 @@ nsCacheService::ReleaseObject_Locked(nsI
                                      nsIEventTarget * target)
 {
     gService->mLock.AssertCurrentThreadOwns();
 
     bool isCur;
     if (!target || (NS_SUCCEEDED(target->IsOnCurrentThread(&isCur)) && isCur)) {
         gService->mDoomedObjects.AppendElement(obj);
     } else {
-        NS_ProxyRelease(target, dont_AddRef(obj));
+        NS_ProxyRelease(
+          "nsCacheService::ReleaseObject_Locked::obj", target, dont_AddRef(obj));
     }
 }
 
 
 nsresult
 nsCacheService::SetCacheElement(nsCacheEntry * entry, nsISupports * element)
 {
     entry->SetData(element);
--- a/netwerk/cache2/AppCacheStorage.cpp
+++ b/netwerk/cache2/AppCacheStorage.cpp
@@ -27,17 +27,17 @@ AppCacheStorage::AppCacheStorage(nsILoad
                                  nsIApplicationCache* aAppCache)
 : CacheStorage(aInfo, true /* disk */, false /* lookup app cache */, false /* skip size check */, false /* pin */)
 , mAppCache(aAppCache)
 {
 }
 
 AppCacheStorage::~AppCacheStorage()
 {
-  ProxyReleaseMainThread(mAppCache);
+  ProxyReleaseMainThread("AppCacheStorage::mAppCache", mAppCache);
 }
 
 NS_IMETHODIMP AppCacheStorage::AsyncOpenURI(nsIURI *aURI,
                                             const nsACString & aIdExtension,
                                             uint32_t aFlags,
                                             nsICacheEntryOpenCallback *aCallback)
 {
   if (!CacheStorageService::Self())
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -129,17 +129,17 @@ CacheEntry::Callback::Callback(CacheEntr
   // The counter may go from zero to non-null only under the service lock
   // but here we expect it to be already positive.
   MOZ_ASSERT(mEntry->HandlesCount());
   mEntry->AddHandleRef();
 }
 
 CacheEntry::Callback::~Callback()
 {
-  ProxyRelease(mCallback, mTarget);
+  ProxyRelease("CacheEntry::Callback::mCallback", mCallback, mTarget);
 
   mEntry->ReleaseHandleRef();
   MOZ_COUNT_DTOR(CacheEntry::Callback);
 }
 
 void CacheEntry::Callback::ExchangeEntry(CacheEntry* aEntry)
 {
   if (mEntry == aEntry)
--- a/netwerk/cache2/CacheIndex.h
+++ b/netwerk/cache2/CacheIndex.h
@@ -1204,17 +1204,18 @@ private:
       NS_DispatchToMainThread(this);
     }
 
   private:
     explicit DiskConsumptionObserver(nsWeakPtr const &aWeakObserver)
       : mObserver(aWeakObserver) { }
     virtual ~DiskConsumptionObserver() {
       if (mObserver && !NS_IsMainThread()) {
-        NS_ReleaseOnMainThread(mObserver.forget());
+        NS_ReleaseOnMainThread(
+          "DiskConsumptionObserver::mObserver", mObserver.forget());
       }
     }
 
     NS_IMETHOD Run() override
     {
       MOZ_ASSERT(NS_IsMainThread());
 
       nsCOMPtr<nsICacheStorageConsumptionObserver> observer =
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -205,17 +205,18 @@ protected:
     , mCancel(false)
   {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
   virtual ~WalkCacheRunnable()
   {
     if (mCallback) {
-      ProxyReleaseMainThread(mCallback);
+      ProxyReleaseMainThread(
+        "WalkCacheRunnable::mCallback", mCallback);
     }
   }
 
   RefPtr<CacheStorageService> mService;
   nsCOMPtr<nsICacheStorageVisitor> mCallback;
 
   uint64_t mSize;
 
@@ -316,17 +317,18 @@ private:
 
     NS_DispatchToMainThread(this);
     return NS_OK;
   }
 
   virtual ~WalkMemoryCacheRunnable()
   {
     if (mCallback)
-      ProxyReleaseMainThread(mCallback);
+      ProxyReleaseMainThread(
+        "WalkMemoryCacheRunnable::mCallback", mCallback);
   }
 
   virtual void OnEntryInfo(const nsACString & aURISpec, const nsACString & aIdEnhance,
                            int64_t aDataSize, int32_t aFetchCount,
                            uint32_t aLastModifiedTime, uint32_t aExpirationTime,
                            bool aPinned, nsILoadContextInfo* aInfo) override
   {
     nsresult rv;
@@ -1701,17 +1703,18 @@ private:
 
   nsCOMPtr<nsICacheEntryDoomCallback> mCallback;
   nsresult mResult;
 };
 
 CacheEntryDoomByKeyCallback::~CacheEntryDoomByKeyCallback()
 {
   if (mCallback)
-    ProxyReleaseMainThread(mCallback);
+    ProxyReleaseMainThread(
+      "CacheEntryDoomByKeyCallback::mCallback", mCallback);
 }
 
 NS_IMETHODIMP CacheEntryDoomByKeyCallback::OnFileDoomed(CacheFileHandle *aHandle,
                                                         nsresult aResult)
 {
   if (!mCallback)
     return NS_OK;
 
--- a/netwerk/cache2/CacheStorageService.h
+++ b/netwerk/cache2/CacheStorageService.h
@@ -395,25 +395,25 @@ private:
     Monitor mMon;
     bool mSignaled;
   };
 
   RefPtr<IOThreadSuspender> mActiveIOSuspender;
 };
 
 template<class T>
-void ProxyRelease(nsCOMPtr<T> &object, nsIEventTarget* target)
+void ProxyRelease(const char* aName, nsCOMPtr<T> &object, nsIEventTarget* target)
 {
-  NS_ProxyRelease(target, object.forget());
+  NS_ProxyRelease(aName, target, object.forget());
 }
 
 template<class T>
-void ProxyReleaseMainThread(nsCOMPtr<T> &object)
+void ProxyReleaseMainThread(const char* aName, nsCOMPtr<T> &object)
 {
-  ProxyRelease(object, GetMainThreadEventTarget());
+  ProxyRelease(aName, object, GetMainThreadEventTarget());
 }
 
 } // namespace net
 } // namespace mozilla
 
 #define NS_CACHE_STORAGE_SERVICE_CID \
   { 0xea70b098, 0x5014, 0x4e21, \
   { 0xae, 0xe1, 0x75, 0xe6, 0xb2, 0xc4, 0xb8, 0xe0 } } \
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -672,17 +672,18 @@ NS_IMPL_ISUPPORTS_INHERITED(_OldCacheLoa
   , mStatus(NS_ERROR_UNEXPECTED)
   , mRunCount(0)
   , mAppCache(aAppCache)
 {
 }
 
 _OldCacheLoad::~_OldCacheLoad()
 {
-  ProxyReleaseMainThread(mAppCache);
+  ProxyReleaseMainThread(
+    "_OldCacheLoad::mAppCache", mAppCache);
 }
 
 nsresult _OldCacheLoad::Start()
 {
   LOG(("_OldCacheLoad::Start [this=%p, key=%s]", this, mCacheKey.get()));
 
   mLoadStart = mozilla::TimeStamp::Now();
 
--- a/netwerk/dns/DNSListenerProxy.h
+++ b/netwerk/dns/DNSListenerProxy.h
@@ -23,17 +23,18 @@ class DNSListenerProxy final
     , public nsIDNSListenerProxy
 {
 public:
   DNSListenerProxy(nsIDNSListener* aListener, nsIEventTarget* aTargetThread)
     // Sometimes aListener is a main-thread only object like XPCWrappedJS, and
     // sometimes it's a threadsafe object like nsSOCKSSocketInfo. Use a main-
     // thread pointer holder, but disable strict enforcement of thread invariants.
     // The AddRef implementation of XPCWrappedJS will assert if we go wrong here.
-    : mListener(new nsMainThreadPtrHolder<nsIDNSListener>(aListener, false))
+    : mListener(new nsMainThreadPtrHolder<nsIDNSListener>(
+        "DNSListenerProxy::mListener", aListener, false))
     , mTargetThread(aTargetThread)
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSLISTENER
   NS_DECL_NSIDNSLISTENERPROXY
 
   class OnLookupCompleteRunnable : public Runnable
--- a/netwerk/protocol/file/nsFileChannel.cpp
+++ b/netwerk/protocol/file/nsFileChannel.cpp
@@ -124,17 +124,18 @@ nsFileCopyEvent::DoCopy()
   mDest->Close();
 
   // Notify completion
   if (mCallback) {
     mCallbackTarget->Dispatch(mCallback, NS_DISPATCH_NORMAL);
 
     // Release the callback on the target thread to avoid destroying stuff on
     // the wrong thread.
-    NS_ProxyRelease(mCallbackTarget, mCallback.forget());
+    NS_ProxyRelease(
+      "nsFileCopyEvent::mCallback", mCallbackTarget, mCallback.forget());
   }
 }
 
 nsresult
 nsFileCopyEvent::Dispatch(nsIRunnable *callback,
                           nsITransportEventSink *sink,
                           nsIEventTarget *target)
 {
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -609,17 +609,18 @@ nsGIOInputStream::Close()
     // Destroy the list of GIOFileInfo objects...
     g_list_foreach(mDirList, (GFunc) g_object_unref, nullptr);
     g_list_free(mDirList);
     mDirList = nullptr;
     mDirListPtr = nullptr;
   }
 
   if (mChannel) {
-    NS_ReleaseOnMainThread(dont_AddRef(mChannel));
+    NS_ReleaseOnMainThread(
+      "nsGIOInputStream::mChannel", dont_AddRef(mChannel));
 
     mChannel = nullptr;
   }
 
   mSpec.Truncate(); // free memory
 
   // Prevent future reads from re-opening the handle.
   if (NS_SUCCEEDED(mStatus))
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -603,17 +603,18 @@ HttpChannelParent::DoAsyncOpen(  const U
           do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID, &rv);
       if (NS_FAILED(rv) || !target) {
         return SendFailedAsyncOpen(rv);
       }
 
       nsCOMPtr<nsIInterfaceRequestor> iir = static_cast<nsIInterfaceRequestor*>(this);
       nsMainThreadPtrHandle<nsIInterfaceRequestor> handle =
           nsMainThreadPtrHandle<nsIInterfaceRequestor>(
-              new nsMainThreadPtrHolder<nsIInterfaceRequestor>(iir));
+              new nsMainThreadPtrHolder<nsIInterfaceRequestor>(
+                "nsIInterfaceRequestor", iir));
       UniquePtr<UploadStreamClosure> closure(new UploadStreamClosure(handle));
 
       // Accumulate the stream contents as the child sends it. We will continue with
       // the AsyncOpen process once the full stream has been received.
       rv = NS_AsyncCopy(stream, sink, target, NS_ASYNCCOPY_VIA_READSEGMENTS,
                         kBufferSize, // copy segment size
                         UploadCopyComplete, closure.release());
       if (NS_WARN_IF(NS_FAILED(rv))) {
--- a/netwerk/protocol/http/nsHttpActivityDistributor.cpp
+++ b/netwerk/protocol/http/nsHttpActivityDistributor.cpp
@@ -110,29 +110,29 @@ nsHttpActivityDistributor::GetIsActive(b
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpActivityDistributor::AddObserver(nsIHttpActivityObserver *aObserver)
 {
     MutexAutoLock lock(mLock);
 
-    ObserverHandle observer(new ObserverHolder(aObserver));
+    ObserverHandle observer(new ObserverHolder("nsIHttpActivityObserver", aObserver));
     if (!mObservers.AppendElement(observer))
         return NS_ERROR_OUT_OF_MEMORY;
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpActivityDistributor::RemoveObserver(nsIHttpActivityObserver *aObserver)
 {
     MutexAutoLock lock(mLock);
 
-    ObserverHandle observer(new ObserverHolder(aObserver));
+    ObserverHandle observer(new ObserverHolder("nsIHttpActivityObserver", aObserver));
     if (!mObservers.RemoveElement(observer))
         return NS_ERROR_FAILURE;
 
     return NS_OK;
 }
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -148,17 +148,18 @@ nsHttpConnection::Init(nsHttpConnectionI
     mRtt = rtt;
     mMaxHangTime = PR_SecondsToInterval(maxHangTime);
 
     mSocketTransport = transport;
     mSocketIn = instream;
     mSocketOut = outstream;
 
     // See explanation for non-strictness of this operation in SetSecurityCallbacks.
-    mCallbacks = new nsMainThreadPtrHolder<nsIInterfaceRequestor>(callbacks, false);
+    mCallbacks = new nsMainThreadPtrHolder<nsIInterfaceRequestor>(
+      "nsHttpConnection::mCallbacks", callbacks, false);
 
     mSocketTransport->SetEventSink(this, nullptr);
     mSocketTransport->SetSecurityCallbacks(this);
 
     return NS_OK;
 }
 
 nsresult
@@ -1363,17 +1364,18 @@ nsHttpConnection::GetSecurityInfo(nsISup
 void
 nsHttpConnection::SetSecurityCallbacks(nsIInterfaceRequestor* aCallbacks)
 {
     MutexAutoLock lock(mCallbacksLock);
     // This is called both on and off the main thread. For JS-implemented
     // callbacks, we requires that the call happen on the main thread, but
     // for C++-implemented callbacks we don't care. Use a pointer holder with
     // strict checking disabled.
-    mCallbacks = new nsMainThreadPtrHolder<nsIInterfaceRequestor>(aCallbacks, false);
+    mCallbacks = new nsMainThreadPtrHolder<nsIInterfaceRequestor>(
+      "nsHttpConnection::mCallbacks", aCallbacks, false);
 }
 
 nsresult
 nsHttpConnection::PushBack(const char *data, uint32_t length)
 {
     LOG(("nsHttpConnection::PushBack [this=%p, length=%d]\n", this, length));
 
     if (mInputOverflow) {
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -383,17 +383,18 @@ nsHttpHandler::Init()
     if (NS_FAILED(rv))
         return rv;
 
     nsCOMPtr<nsIIOService> service = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
     if (NS_FAILED(rv)) {
         NS_WARNING("unable to continue without io service");
         return rv;
     }
-    mIOService = new nsMainThreadPtrHolder<nsIIOService>(service);
+    mIOService = new nsMainThreadPtrHolder<nsIIOService>(
+      "nsHttpHandler::mIOService", service);
 
     if (IsNeckoChild())
         NeckoChild::InitNeckoChild();
 
     InitUserAgentComponents();
 
     // monitor some preference changes
     nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID);
@@ -681,39 +682,42 @@ nsresult
 nsHttpHandler::GetStreamConverterService(nsIStreamConverterService **result)
 {
     if (!mStreamConvSvc) {
         nsresult rv;
         nsCOMPtr<nsIStreamConverterService> service =
             do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID, &rv);
         if (NS_FAILED(rv))
             return rv;
-        mStreamConvSvc = new nsMainThreadPtrHolder<nsIStreamConverterService>(service);
+        mStreamConvSvc = new nsMainThreadPtrHolder<nsIStreamConverterService>(
+          "nsHttpHandler::mStreamConvSvc", service);
     }
     *result = mStreamConvSvc;
     NS_ADDREF(*result);
     return NS_OK;
 }
 
 nsISiteSecurityService*
 nsHttpHandler::GetSSService()
 {
     if (!mSSService) {
         nsCOMPtr<nsISiteSecurityService> service = do_GetService(NS_SSSERVICE_CONTRACTID);
-        mSSService = new nsMainThreadPtrHolder<nsISiteSecurityService>(service);
+        mSSService = new nsMainThreadPtrHolder<nsISiteSecurityService>(
+          "nsHttpHandler::mSSService", service);
     }
     return mSSService;
 }
 
 nsICookieService *
 nsHttpHandler::GetCookieService()
 {
     if (!mCookieService) {
         nsCOMPtr<nsICookieService> service = do_GetService(NS_COOKIESERVICE_CONTRACTID);
-        mCookieService = new nsMainThreadPtrHolder<nsICookieService>(service);
+        mCookieService = new nsMainThreadPtrHolder<nsICookieService>(
+          "nsHttpHandler::mCookieService", service);
     }
     return mCookieService;
 }
 
 nsresult
 nsHttpHandler::GetIOService(nsIIOService** result)
 {
     NS_ENSURE_ARG_POINTER(result);
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -368,14 +368,18 @@ BaseWebSocketChannel::ListenerAndContext
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mListener);
 }
 
 BaseWebSocketChannel::ListenerAndContextContainer::~ListenerAndContextContainer()
 {
   MOZ_ASSERT(mListener);
 
-  NS_ReleaseOnMainThread(mListener.forget());
-  NS_ReleaseOnMainThread(mContext.forget());
+  NS_ReleaseOnMainThread(
+    "BaseWebSocketChannel::ListenerAndContextContainer::mListener",
+    mListener.forget());
+  NS_ReleaseOnMainThread(
+    "BaseWebSocketChannel::ListenerAndContextContainer::mContext",
+    mContext.forget());
 }
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -1226,24 +1226,24 @@ WebSocketChannel::~WebSocketChannel()
 
   while ((mCurrentOut = (OutboundMessage *) mOutgoingPingMessages.PopFront()))
     delete mCurrentOut;
   while ((mCurrentOut = (OutboundMessage *) mOutgoingPongMessages.PopFront()))
     delete mCurrentOut;
   while ((mCurrentOut = (OutboundMessage *) mOutgoingMessages.PopFront()))
     delete mCurrentOut;
 
-  NS_ReleaseOnMainThread(mURI.forget());
-  NS_ReleaseOnMainThread(mOriginalURI.forget());
+  NS_ReleaseOnMainThread("WebSocketChannel::mURI", mURI.forget());
+  NS_ReleaseOnMainThread("WebSocketChannel::mOriginalURI", mOriginalURI.forget());
 
   mListenerMT = nullptr;
 
-  NS_ReleaseOnMainThread(mLoadGroup.forget());
-  NS_ReleaseOnMainThread(mLoadInfo.forget());
-  NS_ReleaseOnMainThread(mService.forget());
+  NS_ReleaseOnMainThread("WebSocketChannel::mLoadGroup", mLoadGroup.forget());
+  NS_ReleaseOnMainThread("WebSocketChannel::mLoadInfo", mLoadInfo.forget());
+  NS_ReleaseOnMainThread("WebSocketChannel::mService", mService.forget());
 }
 
 NS_IMETHODIMP
 WebSocketChannel::Observe(nsISupports *subject,
                           const char *topic,
                           const char16_t *data)
 {
   LOG(("WebSocketChannel::Observe [topic=\"%s\"]\n", topic));
@@ -2361,20 +2361,20 @@ WebSocketChannel::StopSession(nsresult r
 
   // normally this should be called on socket thread, but it is ok to call it
   // from OnStartRequest before the socket thread machine has gotten underway
 
   mStopped = 1;
 
   if (!mOpenedHttpChannel) {
     // The HTTP channel information will never be used in this case
-    NS_ReleaseOnMainThread(mChannel.forget());
-    NS_ReleaseOnMainThread(mHttpChannel.forget());
-    NS_ReleaseOnMainThread(mLoadGroup.forget());
-    NS_ReleaseOnMainThread(mCallbacks.forget());
+    NS_ReleaseOnMainThread("WebSocketChannel::mChannel", mChannel.forget());
+    NS_ReleaseOnMainThread("WebSocketChannel::mHttpChannel", mHttpChannel.forget());
+    NS_ReleaseOnMainThread("WebSocketChannel::mLoadGroup", mLoadGroup.forget());
+    NS_ReleaseOnMainThread("WebSocketChannel::mCallbacks", mCallbacks.forget());
   }
 
   if (mCloseTimer) {
     mCloseTimer->Cancel();
     mCloseTimer = nullptr;
   }
 
   if (mOpenTimer) {
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
@@ -61,17 +61,18 @@ WyciwygChannelChild::WyciwygChannelChild
   // IPDL holds a reference until IPDL channel gets destroyed
   AddIPDLReference();
 }
 
 WyciwygChannelChild::~WyciwygChannelChild()
 {
   LOG(("Destroying WyciwygChannelChild @%p\n", this));
   if (mLoadInfo) {
-    NS_ReleaseOnMainThread(mLoadInfo.forget());
+    NS_ReleaseOnMainThread(
+      "WyciwygChannelChild::mLoadInfo", mLoadInfo.forget());
   }
 }
 
 void
 WyciwygChannelChild::AddIPDLReference()
 {
   MOZ_ASSERT(!mIPCOpen, "Attempt to retain more than one IPDL reference");
   mIPCOpen = true;
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
@@ -42,17 +42,18 @@ nsWyciwygChannel::nsWyciwygChannel()
     mLoadFlags(LOAD_NORMAL),
     mNeedToSetSecurityInfo(false)
 {
 }
 
 nsWyciwygChannel::~nsWyciwygChannel() 
 {
   if (mLoadInfo) {
-    NS_ReleaseOnMainThread(mLoadInfo.forget(), false);
+    NS_ReleaseOnMainThread(
+      "nsWyciwygChannel::mLoadInfo", mLoadInfo.forget(), false);
   }
 }
 
 NS_IMPL_ISUPPORTS(nsWyciwygChannel,
                   nsIChannel,
                   nsIRequest,
                   nsIStreamListener,
                   nsIRequestObserver,
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -230,17 +230,18 @@ DataChannelConnection::~DataChannelConne
   MOZ_ASSERT(mPending.GetSize() == 0);
 
   // Already disconnected from sigslot/mTransportFlow
   // TransportFlows must be released from the STS thread
   if (!IsSTSThread()) {
     ASSERT_WEBRTC(NS_IsMainThread());
     if (mTransportFlow) {
       ASSERT_WEBRTC(mSTS);
-      NS_ProxyRelease(mSTS, mTransportFlow.forget());
+      NS_ProxyRelease(
+        "DataChannelConnection::mTransportFlow", mSTS, mTransportFlow.forget());
     }
 
     if (mInternalIOThread) {
       // Avoid spinning the event thread from here (which if we're mainthread
       // is in the event loop already)
       NS_DispatchToMainThread(WrapRunnable(nsCOMPtr<nsIThread>(mInternalIOThread),
                                            &nsIThread::Shutdown),
                               NS_DISPATCH_NORMAL);
@@ -2405,17 +2406,18 @@ DataChannelConnection::ReadBlob(already_
   RefPtr<DataChannelBlobSendRunnable> runnable = new DataChannelBlobSendRunnable(aThis,
                                                                                    aStream);
   // avoid copying the blob data by passing the mData from the runnable
   if (NS_FAILED(aBlob->Available(&len)) ||
       NS_FAILED(NS_ReadInputStreamToString(aBlob, runnable->mData, len))) {
     // Bug 966602:  Doesn't return an error to the caller via onerror.
     // We must release DataChannelConnection on MainThread to avoid issues (bug 876167)
     // aThis is now owned by the runnable; release it there
-    NS_ReleaseOnMainThread(runnable.forget());
+    NS_ReleaseOnMainThread(
+      "DataChannelBlobSendRunnable", runnable.forget());
     return;
   }
   aBlob->Close();
   NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL);
 }
 
 void
 DataChannelConnection::GetStreamIds(std::vector<uint16_t>* aStreamList)
--- a/netwerk/wifi/nsWifiMonitor.cpp
+++ b/netwerk/wifi/nsWifiMonitor.cpp
@@ -86,17 +86,19 @@ NS_IMETHODIMP nsWifiMonitor::StartWatchi
 
   if (!mThread) {
     rv = NS_NewNamedThread("Wifi Monitor", getter_AddRefs(mThread), this);
     if (NS_FAILED(rv))
       return rv;
   }
 
 
-  mListeners.AppendElement(nsWifiListener(new nsMainThreadPtrHolder<nsIWifiListener>(aListener)));
+  mListeners.AppendElement(
+    nsWifiListener(new nsMainThreadPtrHolder<nsIWifiListener>(
+      "nsIWifiListener", aListener)));
 
   // tell ourselves that we have a new watcher.
   mon.Notify();
   return NS_OK;
 }
 
 NS_IMETHODIMP nsWifiMonitor::StopWatching(nsIWifiListener *aListener)
 {
--- a/security/apps/AppSignatureVerification.cpp
+++ b/security/apps/AppSignatureVerification.cpp
@@ -895,17 +895,18 @@ OpenSignedAppFile(AppTrustedRoot aTruste
 
 class OpenSignedAppFileTask final : public CryptoTask
 {
 public:
   OpenSignedAppFileTask(AppTrustedRoot aTrustedRoot, nsIFile* aJarFile,
                         nsIOpenSignedAppFileCallback* aCallback)
     : mTrustedRoot(aTrustedRoot)
     , mJarFile(aJarFile)
-    , mCallback(new nsMainThreadPtrHolder<nsIOpenSignedAppFileCallback>(aCallback))
+    , mCallback(new nsMainThreadPtrHolder<nsIOpenSignedAppFileCallback>(
+        "OpenSignedAppFileTask::mCallback", aCallback))
   {
   }
 
 private:
   virtual nsresult CalculateResult() override
   {
     return OpenSignedAppFile(mTrustedRoot, mJarFile,
                              getter_AddRefs(mZipReader),
@@ -1397,17 +1398,18 @@ VerifySignedDirectory(AppTrustedRoot aTr
 
 class VerifySignedDirectoryTask final : public CryptoTask
 {
 public:
   VerifySignedDirectoryTask(AppTrustedRoot aTrustedRoot, nsIFile* aUnpackedJar,
                             nsIVerifySignedDirectoryCallback* aCallback)
     : mTrustedRoot(aTrustedRoot)
     , mDirectory(aUnpackedJar)
-    , mCallback(new nsMainThreadPtrHolder<nsIVerifySignedDirectoryCallback>(aCallback))
+    , mCallback(new nsMainThreadPtrHolder<nsIVerifySignedDirectoryCallback>(
+        "VerifySignedDirectoryTask::mCallback", aCallback))
   {
   }
 
 private:
   virtual nsresult CalculateResult() override
   {
     return VerifySignedDirectory(mTrustedRoot,
                                  mDirectory,
--- a/security/manager/ssl/LocalCertService.cpp
+++ b/security/manager/ssl/LocalCertService.cpp
@@ -92,17 +92,18 @@ protected:
 };
 
 class LocalCertGetTask final : public LocalCertTask
 {
 public:
   LocalCertGetTask(const nsACString& aNickname,
                    nsILocalCertGetCallback* aCallback)
     : LocalCertTask(aNickname)
-    , mCallback(new nsMainThreadPtrHolder<nsILocalCertGetCallback>(aCallback))
+    , mCallback(new nsMainThreadPtrHolder<nsILocalCertGetCallback>(
+        "LocalCertGetTask::mCallback", aCallback))
     , mCert(nullptr)
   {
   }
 
 private:
   virtual nsresult CalculateResult() override
   {
     // Try to lookup an existing cert in the DB
@@ -349,17 +350,18 @@ private:
 };
 
 class LocalCertRemoveTask final : public LocalCertTask
 {
 public:
   LocalCertRemoveTask(const nsACString& aNickname,
                       nsILocalCertCallback* aCallback)
     : LocalCertTask(aNickname)
-    , mCallback(new nsMainThreadPtrHolder<nsILocalCertCallback>(aCallback))
+    , mCallback(new nsMainThreadPtrHolder<nsILocalCertCallback>(
+        "LocalCertRemoveTask::mCallback", aCallback))
   {
   }
 
 private:
   virtual nsresult CalculateResult() override
   {
     return RemoveExisting();
   }
--- a/security/manager/ssl/PSMRunnable.h
+++ b/security/manager/ssl/PSMRunnable.h
@@ -27,17 +27,18 @@ private:
   mozilla::Monitor monitor;
 };
 
 class NotifyObserverRunnable : public Runnable
 {
 public:
   NotifyObserverRunnable(nsIObserver * observer,
                          const char * topicStringLiteral)
-    : mObserver(new nsMainThreadPtrHolder<nsIObserver>(observer)),
+    : mObserver(new nsMainThreadPtrHolder<nsIObserver>(
+        "psm::NotifyObserverRunnable::mObserver", observer)),
       mTopic(topicStringLiteral) {
   }
   NS_DECL_NSIRUNNABLE
 private:
   nsMainThreadPtrHandle<nsIObserver> mObserver;
   const char * const mTopic;
 };
 
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -560,17 +560,17 @@ nsHTTPListener::~nsHTTPListener()
   if (mResponsibleForDoneSignal)
     send_done_signal();
 
   if (mResultData) {
     free(const_cast<uint8_t *>(mResultData));
   }
 
   if (mLoader) {
-    NS_ReleaseOnMainThread(mLoader.forget());
+    NS_ReleaseOnMainThread("nsHTTPListener::mLoader", mLoader.forget());
   }
 }
 
 NS_IMPL_ISUPPORTS(nsHTTPListener, nsIStreamLoaderObserver)
 
 void
 nsHTTPListener::FreeLoadGroup(bool aCancelLoad)
 {
--- a/security/manager/ssl/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/nsNSSCertificateDB.cpp
@@ -1487,17 +1487,18 @@ public:
   VerifyCertAtTimeTask(nsIX509Cert* aCert, int64_t aUsage, uint32_t aFlags,
                        const nsACString& aHostname, uint64_t aTime,
                        nsICertVerificationCallback* aCallback)
     : mCert(aCert)
     , mUsage(aUsage)
     , mFlags(aFlags)
     , mHostname(aHostname)
     , mTime(aTime)
-    , mCallback(new nsMainThreadPtrHolder<nsICertVerificationCallback>(aCallback))
+    , mCallback(new nsMainThreadPtrHolder<nsICertVerificationCallback>(
+        "nsICertVerificationCallback", aCallback))
     , mPRErrorCode(SEC_ERROR_LIBRARY_FAILURE)
     , mVerifiedCertList(nullptr)
     , mHasEVPolicy(false)
   {
   }
 
 private:
   virtual nsresult CalculateResult() override
--- a/services/crypto/component/IdentityCryptoService.cpp
+++ b/services/crypto/component/IdentityCryptoService.cpp
@@ -323,17 +323,18 @@ KeyPair::Sign(const nsACString & textToS
 
   return mThread->Dispatch(r, NS_DISPATCH_NORMAL);
 }
 
 KeyGenRunnable::KeyGenRunnable(KeyType keyType,
                                nsIIdentityKeyGenCallback * callback,
                                nsIEventTarget* operationThread)
   : mKeyType(keyType)
-  , mCallback(new nsMainThreadPtrHolder<nsIIdentityKeyGenCallback>(callback))
+  , mCallback(new nsMainThreadPtrHolder<nsIIdentityKeyGenCallback>(
+      "KeyGenRunnable::mCallback", callback))
   , mRv(NS_ERROR_NOT_INITIALIZED)
   , mThread(operationThread)
 {
 }
 
 MOZ_MUST_USE nsresult
 GenerateKeyPair(PK11SlotInfo * slot,
                 SECKEYPrivateKey ** privateKey,
@@ -346,18 +347,18 @@ GenerateKeyPair(PK11SlotInfo * slot,
                                      PR_FALSE /*isPerm*/,
                                      PR_TRUE /*isSensitive*/,
                                      nullptr /*&pwdata*/);
   if (!*privateKey) {
     MOZ_ASSERT(!*publicKey);
     return mozilla::psm::GetXPCOMFromNSSError(PR_GetError());
   }
   if (!*publicKey) {
-	  SECKEY_DestroyPrivateKey(*privateKey);
-	  *privateKey = nullptr;
+    SECKEY_DestroyPrivateKey(*privateKey);
+    *privateKey = nullptr;
     MOZ_CRASH("PK11_GnerateKeyPair returned private key without public key");
   }
 
   return NS_OK;
 }
 
 
 MOZ_MUST_USE nsresult
@@ -463,17 +464,17 @@ KeyGenRunnable::Run()
           MOZ_CRASH("unknown key type");
         }
 
         PK11_FreeSlot(slot);
 
         if (NS_SUCCEEDED(mRv)) {
           MOZ_ASSERT(privk);
           MOZ_ASSERT(pubk);
-		  // mKeyPair will take over ownership of privk and pubk
+      // mKeyPair will take over ownership of privk and pubk
           mKeyPair = new KeyPair(privk, pubk, mThread);
         }
       }
     }
 
     NS_DispatchToMainThread(this);
   } else {
     // Back on Main Thread
@@ -482,17 +483,18 @@ KeyGenRunnable::Run()
   return NS_OK;
 }
 
 SignRunnable::SignRunnable(const nsACString & aText,
                            SECKEYPrivateKey * privateKey,
                            nsIIdentitySignCallback * aCallback)
   : mTextToSign(aText)
   , mPrivateKey(SECKEY_CopyPrivateKey(privateKey))
-  , mCallback(new nsMainThreadPtrHolder<nsIIdentitySignCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<nsIIdentitySignCallback>(
+      "SignRunnable::mCallback", aCallback))
   , mRv(NS_ERROR_NOT_INITIALIZED)
 {
 }
 
 NS_IMETHODIMP
 SignRunnable::Run()
 {
   if (!NS_IsMainThread()) {
--- a/storage/StorageBaseStatementInternal.cpp
+++ b/storage/StorageBaseStatementInternal.cpp
@@ -45,17 +45,18 @@ public:
   NS_IMETHOD Run() override
   {
     if (mStatement->mAsyncStatement) {
       sqlite3_finalize(mStatement->mAsyncStatement);
       mStatement->mAsyncStatement = nullptr;
     }
 
     nsCOMPtr<nsIThread> targetThread(mConnection->threadOpenedOn);
-    NS_ProxyRelease(targetThread, mStatement.forget());
+    NS_ProxyRelease(
+      "AsyncStatementFinalizer::mStatement", targetThread, mStatement.forget());
     return NS_OK;
   }
 private:
   RefPtr<StorageBaseStatementInternal> mStatement;
   RefPtr<Connection> mConnection;
 };
 
 /**
@@ -89,17 +90,19 @@ public:
   }
 
   NS_IMETHOD Run() override
   {
     (void)::sqlite3_finalize(mAsyncStatement);
     mAsyncStatement = nullptr;
 
     nsCOMPtr<nsIThread> target(mConnection->threadOpenedOn);
-    (void)::NS_ProxyRelease(target, mConnection.forget());
+    (void)::NS_ProxyRelease(
+      "LastDitchSqliteStatementFinalizer::mConnection",
+      target, mConnection.forget());
     return NS_OK;
   }
 private:
   RefPtr<Connection> mConnection;
   sqlite3_stmt *mAsyncStatement;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/storage/mozStorageAsyncStatement.cpp
+++ b/storage/mozStorageAsyncStatement.cpp
@@ -216,17 +216,19 @@ AsyncStatement::~AsyncStatement()
   // If we are getting destroyed on the wrong thread, proxy the connection
   // release to the right thread.  I'm not sure why we do this.
   bool onCallingThread = false;
   (void)mDBConnection->threadOpenedOn->IsOnCurrentThread(&onCallingThread);
   if (!onCallingThread) {
     // NS_ProxyRelase only magic forgets for us if mDBConnection is an
     // nsCOMPtr.  Which it is not; it's an nsRefPtr.
     nsCOMPtr<nsIThread> targetThread(mDBConnection->threadOpenedOn);
-    NS_ProxyRelease(targetThread, mDBConnection.forget());
+    NS_ProxyRelease(
+      "AsyncStatement::mDBConnection",
+      targetThread, mDBConnection.forget());
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsISupports
 
 NS_IMPL_ADDREF(AsyncStatement)
 NS_IMPL_RELEASE(AsyncStatement)
@@ -370,14 +372,14 @@ AsyncStatement::GetState(int32_t *_state
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// mozIStorageBindingParams
 
 BOILERPLATE_BIND_PROXIES(
-  AsyncStatement, 
+  AsyncStatement,
   if (mFinalized) return NS_ERROR_UNEXPECTED;
 )
 
 } // namespace storage
 } // namespace mozilla
--- a/storage/mozStorageAsyncStatementJSHelper.cpp
+++ b/storage/mozStorageAsyncStatementJSHelper.cpp
@@ -56,17 +56,18 @@ AsyncStatementJSHelper::getParams(AsyncS
       params,
       NS_GET_IID(mozIStorageStatementParams),
       getter_AddRefs(holder)
     );
     NS_ENSURE_SUCCESS(rv, rv);
     RefPtr<AsyncStatementParamsHolder> paramsHolder =
       new AsyncStatementParamsHolder(holder);
     aStatement->mStatementParamsHolder =
-      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(paramsHolder);
+      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(
+        "AsyncStatement::mStatementParamsHolder", paramsHolder);
   }
 
   JS::Rooted<JSObject*> obj(aCtx);
   obj = aStatement->mStatementParamsHolder->GetJSObject();
   NS_ENSURE_STATE(obj);
 
   _params->setObject(*obj);
   return NS_OK;
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -411,18 +411,20 @@ public:
       (void)NS_GetMainThread(getter_AddRefs(thread));
       (void)thread->Dispatch(mCallbackEvent, NS_DISPATCH_NORMAL);
     }
 
     return NS_OK;
   }
 
   ~AsyncCloseConnection() override {
-    NS_ReleaseOnMainThread(mConnection.forget());
-    NS_ReleaseOnMainThread(mCallbackEvent.forget());
+    NS_ReleaseOnMainThread(
+      "AsyncCloseConnection::mConnection", mConnection.forget());
+    NS_ReleaseOnMainThread(
+      "AsyncCloseConnection::mCallbackEvent", mCallbackEvent.forget());
   }
 private:
   RefPtr<Connection> mConnection;
   sqlite3 *mNativeConnection;
   nsCOMPtr<nsIRunnable> mCallbackEvent;
   nsCOMPtr<nsIThread> mAsyncExecutionThread;
 };
 
@@ -475,23 +477,26 @@ private:
   }
 
   ~AsyncInitializeClone() override {
     nsCOMPtr<nsIThread> thread;
     DebugOnly<nsresult> rv = NS_GetMainThread(getter_AddRefs(thread));
     MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     // Handle ambiguous nsISupports inheritance.
-    NS_ProxyRelease(thread, mConnection.forget());
-    NS_ProxyRelease(thread, mClone.forget());
+    NS_ProxyRelease(
+      "AsyncInitializeClone::mConnection", thread, mConnection.forget());
+    NS_ProxyRelease(
+        "AsyncInitializeClone::mClone", thread, mClone.forget());
 
     // Generally, the callback will be released by CallbackComplete.
     // However, if for some reason Run() is not executed, we still
     // need to ensure that it is released here.
-    NS_ProxyRelease(thread, mCallback.forget());
+    NS_ProxyRelease(
+      "AsyncInitializeClone::mCallback", thread, mCallback.forget());
   }
 
   RefPtr<Connection> mConnection;
   RefPtr<Connection> mClone;
   const bool mReadOnly;
   nsCOMPtr<mozIStorageCompletionCallback> mCallback;
 };
 
--- a/storage/mozStorageService.cpp
+++ b/storage/mozStorageService.cpp
@@ -315,17 +315,18 @@ Service::unregisterConnection(Connection
 
     for (uint32_t i = 0 ; i < mConnections.Length(); ++i) {
       if (mConnections[i] == aConnection) {
         nsCOMPtr<nsIThread> thread = mConnections[i]->threadOpenedOn;
 
         // Ensure the connection is released on its opening thread.  Note, we
         // must use .forget().take() so that we can manually cast to an
         // unambiguous nsISupports type.
-        NS_ProxyRelease(thread, mConnections[i].forget());
+        NS_ProxyRelease(
+          "storage::Service::mConnections", thread, mConnections[i].forget());
 
         mConnections.RemoveElementAt(i);
         return;
       }
     }
 
     MOZ_ASSERT_UNREACHABLE("Attempt to unregister unknown storage connection!");
   }
@@ -702,23 +703,26 @@ private:
       new CallbackComplete(aStatus,
                            aValue,
                            mCallback.forget());
     return NS_DispatchToMainThread(event);
   }
 
   ~AsyncInitDatabase()
   {
-    NS_ReleaseOnMainThread(mStorageFile.forget());
-    NS_ReleaseOnMainThread(mConnection.forget());
+    NS_ReleaseOnMainThread(
+      "AsyncInitDatabase::mStorageFile", mStorageFile.forget());
+    NS_ReleaseOnMainThread(
+      "AsyncInitDatabase::mConnection", mConnection.forget());
 
     // Generally, the callback will be released by CallbackComplete.
     // However, if for some reason Run() is not executed, we still
     // need to ensure that it is released here.
-    NS_ReleaseOnMainThread(mCallback.forget());
+    NS_ReleaseOnMainThread(
+      "AsyncInitDatabase::mCallback", mCallback.forget());
   }
 
   RefPtr<Connection> mConnection;
   nsCOMPtr<nsIFile> mStorageFile;
   int32_t mGrowthIncrement;
   RefPtr<mozIStorageCompletionCallback> mCallback;
 };
 
--- a/storage/mozStorageStatementData.h
+++ b/storage/mozStorageStatementData.h
@@ -47,22 +47,22 @@ public:
   : mStatement(nullptr)
   {
   }
   ~StatementData()
   {
     // We need to ensure that mParamsArray is released on the main thread,
     // as the binding arguments may be XPConnect values, which are safe
     // to release only on the main thread.
-    NS_ReleaseOnMainThread(mParamsArray.forget());
+    NS_ReleaseOnMainThread("StatementData::mParamsArray", mParamsArray.forget());
   }
 
   /**
    * Return the sqlite statement, fetching it from the storage statement.  In
-   * the case of AsyncStatements this may actually create the statement 
+   * the case of AsyncStatements this may actually create the statement
    */
   inline int getSqliteStatement(sqlite3_stmt **_stmt)
   {
     if (!mStatement) {
       int rc = mStatementOwner->getAsyncStatement(&mStatement);
       NS_ENSURE_TRUE(rc == SQLITE_OK, rc);
     }
     *_stmt = mStatement;
--- a/storage/mozStorageStatementJSHelper.cpp
+++ b/storage/mozStorageStatementJSHelper.cpp
@@ -108,17 +108,18 @@ StatementJSHelper::getRow(Statement *aSt
       ::JS_GetGlobalForObject(aCtx, scope),
       row,
       NS_GET_IID(mozIStorageStatementRow),
       getter_AddRefs(holder)
     );
     NS_ENSURE_SUCCESS(rv, rv);
     RefPtr<StatementRowHolder> rowHolder = new StatementRowHolder(holder);
     aStatement->mStatementRowHolder =
-      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(rowHolder);
+      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(
+        "Statement::mStatementRowHolder", rowHolder);
   }
 
   JS::Rooted<JSObject*> obj(aCtx);
   obj = aStatement->mStatementRowHolder->GetJSObject();
   NS_ENSURE_STATE(obj);
 
   _row->setObject(*obj);
   return NS_OK;
@@ -154,17 +155,18 @@ StatementJSHelper::getParams(Statement *
       params,
       NS_GET_IID(mozIStorageStatementParams),
       getter_AddRefs(holder)
     );
     NS_ENSURE_SUCCESS(rv, rv);
     RefPtr<StatementParamsHolder> paramsHolder =
       new StatementParamsHolder(holder);
     aStatement->mStatementParamsHolder =
-      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(paramsHolder);
+      new nsMainThreadPtrHolder<nsIXPConnectJSObjectHolder>(
+        "Statement::mStatementParamsHolder", paramsHolder);
   }
 
   JS::Rooted<JSObject*> obj(aCtx);
   obj = aStatement->mStatementParamsHolder->GetJSObject();
   NS_ENSURE_STATE(obj);
 
   _params->setObject(*obj);
   return NS_OK;
--- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
+++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
@@ -1296,23 +1296,26 @@ NativeFileWatcherService::AddPath(const 
   }
 
   // Be sure a valid change callback was passed.
   if (!aOnChange) {
     return NS_ERROR_NULL_POINTER;
   }
 
   nsMainThreadPtrHandle<nsINativeFileWatcherCallback> changeCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherCallback>(aOnChange));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherCallback>(
+      "nsINativeFileWatcherCallback", aOnChange));
 
   nsMainThreadPtrHandle<nsINativeFileWatcherErrorCallback> errorCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherErrorCallback>(aOnError));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherErrorCallback>(
+      "nsINativeFileWatcherErrorCallback", aOnError));
 
   nsMainThreadPtrHandle<nsINativeFileWatcherSuccessCallback> successCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherSuccessCallback>(aOnSuccess));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherSuccessCallback>(
+      "nsINativeFileWatcherSuccessCallback", aOnSuccess));
 
   // Wrap the path and the callbacks in order to pass them using NewRunnableMethod.
   UniquePtr<PathRunnablesParametersWrapper> wrappedCallbacks(
     new PathRunnablesParametersWrapper(
       aPathToWatch,
       changeCallbackHandle,
       errorCallbackHandle,
       successCallbackHandle));
@@ -1366,23 +1369,26 @@ NativeFileWatcherService::RemovePath(con
   }
 
   // Be sure a valid change callback was passed.
   if (!aOnChange) {
     return NS_ERROR_NULL_POINTER;
   }
 
   nsMainThreadPtrHandle<nsINativeFileWatcherCallback> changeCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherCallback>(aOnChange));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherCallback>(
+      "nsINativeFileWatcherCallback", aOnChange));
 
   nsMainThreadPtrHandle<nsINativeFileWatcherErrorCallback> errorCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherErrorCallback>(aOnError));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherErrorCallback>(
+      "nsINativeFileWatcherErrorCallback", aOnError));
 
   nsMainThreadPtrHandle<nsINativeFileWatcherSuccessCallback> successCallbackHandle(
-    new nsMainThreadPtrHolder<nsINativeFileWatcherSuccessCallback>(aOnSuccess));
+    new nsMainThreadPtrHolder<nsINativeFileWatcherSuccessCallback>(
+      "nsINativeFileWatcherSuccessCallback", aOnSuccess));
 
   // Wrap the path and the callbacks in order to pass them using NewRunnableMethod.
   UniquePtr<PathRunnablesParametersWrapper> wrappedCallbacks(
     new PathRunnablesParametersWrapper(
       aPathToRemove,
       changeCallbackHandle,
       errorCallbackHandle,
       successCallbackHandle));
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -523,34 +523,34 @@ public:
                                                 aDiscardedResult,
                                                 aOperation,
                                                 aOSError);
     nsresult rv = NS_DispatchToMainThread(event);
     if (NS_FAILED(rv)) {
       // Last ditch attempt to release on the main thread - some of
       // the members of event are not thread-safe, so letting the
       // pointer go out of scope would cause a crash.
-      NS_ReleaseOnMainThread(event.forget());
+      NS_ReleaseOnMainThread("AbstractDoEvent::ErrorEvent", event.forget());
     }
   }
 
   /**
    * Succeed, asynchronously.
    */
   void Succeed(already_AddRefed<nsINativeOSFileResult>&& aResult) {
     Resolve();
     RefPtr<SuccessEvent> event = new SuccessEvent(mOnSuccess,
                                                     mOnError,
                                                     aResult);
     nsresult rv = NS_DispatchToMainThread(event);
     if (NS_FAILED(rv)) {
       // Last ditch attempt to release on the main thread - some of
       // the members of event are not thread-safe, so letting the
       // pointer go out of scope would cause a crash.
-      NS_ReleaseOnMainThread(event.forget());
+      NS_ReleaseOnMainThread("AbstractDoEvent::SuccessEvent", event.forget());
     }
 
   }
 
 private:
 
   /**
    * Mark the event as complete, for debugging purposes.
@@ -741,17 +741,17 @@ public:
   { }
 
   ~DoReadToTypedArrayEvent() override {
     // If AbstractReadEvent::Run() has bailed out, we may need to cleanup
     // mResult, which is main-thread only data
     if (!mResult) {
       return;
     }
-    NS_ReleaseOnMainThread(mResult.forget());
+    NS_ReleaseOnMainThread("DoReadToTypedArrayEvent::mResult", mResult.forget());
   }
 
 protected:
   void AfterRead(TimeStamp aDispatchDate,
                  ScopedArrayBufferContents& aBuffer) override {
     MOZ_ASSERT(!NS_IsMainThread());
     mResult->Init(aDispatchDate, TimeStamp::Now() - aDispatchDate, aBuffer.forget());
     Succeed(mResult.forget());
@@ -778,17 +778,17 @@ public:
   { }
 
   ~DoReadToStringEvent() override {
     // If AbstraactReadEvent::Run() has bailed out, we may need to cleanup
     // mResult, which is main-thread only data
     if (!mResult) {
       return;
     }
-    NS_ReleaseOnMainThread(mResult.forget());
+    NS_ReleaseOnMainThread("DoReadToStringEvent::mResult", mResult.forget());
   }
 
 protected:
   nsresult BeforeRead() override {
     // Obtain the decoder. We do this before reading to avoid doing
     // any unnecessary I/O in case the name of the encoding is incorrect.
     MOZ_ASSERT(!NS_IsMainThread());
     const Encoding* encoding = Encoding::ForLabel(mEncoding);
@@ -885,20 +885,22 @@ NativeOSFileInternalsService::Read(const
     if (dict.mBytes.WasPassed() && !dict.mBytes.Value().IsNull()) {
       bytes = dict.mBytes.Value().Value();
     }
   }
 
   // Prepare the off main thread event and dispatch it
   nsCOMPtr<nsINativeOSFileSuccessCallback> onSuccess(aOnSuccess);
   nsMainThreadPtrHandle<nsINativeOSFileSuccessCallback> onSuccessHandle(
-    new nsMainThreadPtrHolder<nsINativeOSFileSuccessCallback>(onSuccess));
+    new nsMainThreadPtrHolder<nsINativeOSFileSuccessCallback>(
+      "nsINativeOSFileSuccessCallback", onSuccess));
   nsCOMPtr<nsINativeOSFileErrorCallback> onError(aOnError);
   nsMainThreadPtrHandle<nsINativeOSFileErrorCallback> onErrorHandle(
-    new nsMainThreadPtrHolder<nsINativeOSFileErrorCallback>(onError));
+    new nsMainThreadPtrHolder<nsINativeOSFileErrorCallback>(
+      "nsINativeOSFileErrorCallback", onError));
 
   RefPtr<AbstractDoEvent> event;
   if (encoding.IsEmpty()) {
     event = new DoReadToTypedArrayEvent(aPath, bytes,
                                         onSuccessHandle,
                                         onErrorHandle);
   } else {
     event = new DoReadToStringEvent(aPath, encoding, bytes,
--- a/toolkit/components/places/FaviconHelpers.cpp
+++ b/toolkit/components/places/FaviconHelpers.cpp
@@ -499,21 +499,23 @@ NS_IMPL_ISUPPORTS_INHERITED(
 )
 
 AsyncFetchAndSetIconForPage::AsyncFetchAndSetIconForPage(
   IconData& aIcon
 , PageData& aPage
 , bool aFaviconLoadPrivate
 , nsIFaviconDataCallback* aCallback
 , nsIPrincipal* aLoadingPrincipal
-) : mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(aCallback))
+) : mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(
+      "AsyncFetchAndSetIconForPage::mCallback", aCallback))
   , mIcon(aIcon)
   , mPage(aPage)
   , mFaviconLoadPrivate(aFaviconLoadPrivate)
-  , mLoadingPrincipal(new nsMainThreadPtrHolder<nsIPrincipal>(aLoadingPrincipal))
+  , mLoadingPrincipal(new nsMainThreadPtrHolder<nsIPrincipal>(
+      "AsyncFetchAndSetIconForPage::mLoadingPrincipal", aLoadingPrincipal))
   , mCanceled(false)
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 NS_IMETHODIMP
 AsyncFetchAndSetIconForPage::Run()
 {
@@ -932,17 +934,18 @@ AsyncAssociateIconToPage::Run()
 //// AsyncGetFaviconURLForPage
 
 AsyncGetFaviconURLForPage::AsyncGetFaviconURLForPage(
   const nsACString& aPageSpec
 , const nsACString& aPageHost
 , uint16_t aPreferredWidth
 , nsIFaviconDataCallback* aCallback
 ) : mPreferredWidth(aPreferredWidth == 0 ? UINT16_MAX : aPreferredWidth)
-  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(
+      "AsyncGetFaviconURLForPage::mCallback", aCallback))
 {
   MOZ_ASSERT(NS_IsMainThread());
   mPageSpec.Assign(aPageSpec);
   mPageHost.Assign(aPageHost);
 }
 
 NS_IMETHODIMP
 AsyncGetFaviconURLForPage::Run()
@@ -971,17 +974,18 @@ AsyncGetFaviconURLForPage::Run()
 //// AsyncGetFaviconDataForPage
 
 AsyncGetFaviconDataForPage::AsyncGetFaviconDataForPage(
   const nsACString& aPageSpec
 , const nsACString& aPageHost
 ,  uint16_t aPreferredWidth
 , nsIFaviconDataCallback* aCallback
 ) : mPreferredWidth(aPreferredWidth == 0 ? UINT16_MAX : aPreferredWidth)
-  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(
+      "AsyncGetFaviconDataForPage::mCallback", aCallback))
  {
   MOZ_ASSERT(NS_IsMainThread());
   mPageSpec.Assign(aPageSpec);
   mPageHost.Assign(aPageHost);
 }
 
 NS_IMETHODIMP
 AsyncGetFaviconDataForPage::Run()
@@ -1378,17 +1382,18 @@ FetchAndConvertUnsupportedPayloads::Stor
 //// AsyncCopyFavicons
 
 AsyncCopyFavicons::AsyncCopyFavicons(
   PageData& aFromPage
 , PageData& aToPage
 , nsIFaviconDataCallback* aCallback
 ) : mFromPage(aFromPage)
   , mToPage(aToPage)
-  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(aCallback))
+  , mCallback(new nsMainThreadPtrHolder<nsIFaviconDataCallback>(
+      "AsyncCopyFavicons::mCallback", aCallback))
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 NS_IMETHODIMP
 AsyncCopyFavicons::Run()
 {
   MOZ_ASSERT(!NS_IsMainThread());
--- a/toolkit/components/places/Helpers.h
+++ b/toolkit/components/places/Helpers.h
@@ -92,21 +92,21 @@ public:
                        const nsACString& aName,
                        const nsACString& aURLString);
 };
 
 /**
  * This extracts the hostname from the URI and reverses it in the
  * form that we use (always ending with a "."). So
  * "http://microsoft.com/" becomes "moc.tfosorcim."
- * 
+ *
  * The idea behind this is that we can create an index over the items in
  * the reversed host name column, and then query for as much or as little
  * of the host name as we feel like.
- * 
+ *
  * For example, the query "host >= 'gro.allizom.' AND host < 'gro.allizom/'
  * Matches all host names ending in '.mozilla.org', including
  * 'developer.mozilla.org' and just 'mozilla.org' (since we define all
  * reversed host names to end in a period, even 'mozilla.org' matches).
  * The important thing is that this operation uses the index. Any substring
  * calls in a select statement (even if it's for the beginning of a string)
  * will bypass any indices and will be slow).
  *
@@ -200,17 +200,18 @@ public:
   , mCallingThread(do_GetCurrentThread())
   {
   }
 
   NS_IMETHOD Run() override
   {
     mStatementCache.FinalizeStatements();
     // Release the owner back on the calling thread.
-    NS_ProxyRelease(mCallingThread, mOwner.forget());
+    NS_ProxyRelease("FinalizeStatementCacheProxy::mOwner",
+      mCallingThread, mOwner.forget());
     return NS_OK;
   }
 
 protected:
   mozilla::storage::StatementCache<StatementType>& mStatementCache;
   nsCOMPtr<nsISupports> mOwner;
   nsCOMPtr<nsIThread> mCallingThread;
 };
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -489,17 +489,18 @@ public:
       mozilla::dom::ContentChild* cpc =
         mozilla::dom::ContentChild::GetSingleton();
       NS_ASSERTION(cpc, "Content Protocol is NULL!");
       (void)cpc->SendStartVisitedQuery(uri);
       return NS_OK;
     }
 
     nsMainThreadPtrHandle<mozIVisitedStatusCallback>
-      callback(new nsMainThreadPtrHolder<mozIVisitedStatusCallback>(aCallback));
+      callback(new nsMainThreadPtrHolder<mozIVisitedStatusCallback>(
+        "mozIVisitedStatusCallback", aCallback));
 
     nsNavHistory* navHistory = nsNavHistory::GetHistoryService();
     NS_ENSURE_STATE(navHistory);
     if (navHistory->hasEmbedVisit(aURI)) {
       RefPtr<VisitedQuery> cb = new VisitedQuery(aURI, callback, true);
       NS_ENSURE_TRUE(cb, NS_ERROR_OUT_OF_MEMORY);
       // As per IHistory contract, we must notify asynchronously.
       NS_DispatchToMainThread(NewRunnableMethod(cb, &VisitedQuery::NotifyVisitedStatus));
@@ -855,17 +856,18 @@ CanAddURI(nsIURI* aURI,
     return true;
   };
 
   // We cannot add the URI.  Notify the callback, if we were given one.
   if (aCallback) {
     VisitData place(aURI);
     place.guid = aGUID;
     nsMainThreadPtrHandle<mozIVisitInfoCallback>
-      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(aCallback));
+      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(
+        "mozIVisitInfoCallback", aCallback));
     nsCOMPtr<nsIRunnable> event =
       new NotifyPlaceInfoCallback(callback, place, true, NS_ERROR_INVALID_ARG);
     (void)NS_DispatchToMainThread(event);
   }
 
   return false;
 }
 
@@ -916,17 +918,18 @@ public:
     // Make sure nsNavHistory service is up before proceeding:
     nsNavHistory* navHistory = nsNavHistory::GetHistoryService();
     MOZ_ASSERT(navHistory, "Could not get nsNavHistory?!");
     if (!navHistory) {
       return NS_ERROR_FAILURE;
     }
 
     nsMainThreadPtrHandle<mozIVisitInfoCallback>
-      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(aCallback));
+      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(
+        "mozIVisitInfoCallback", aCallback));
     bool ignoreErrors = false, ignoreResults = false;
     if (aCallback) {
       // We ignore errors from either of these methods in case old JS consumers
       // don't implement them (in which case they will get error/result
       // notifications as normal).
       Unused << aCallback->GetIgnoreErrors(&ignoreErrors);
       Unused << aCallback->GetIgnoreResults(&ignoreResults);
     }
@@ -1876,17 +1879,18 @@ StoreAndNotifyEmbedVisit(VisitData& aPla
   if (!navHistory || !uri) {
     return;
   }
 
   navHistory->registerEmbedVisit(uri, aPlace.visitTime);
 
   if (!!aCallback) {
     nsMainThreadPtrHandle<mozIVisitInfoCallback>
-      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(aCallback));
+      callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(
+        "mozIVisitInfoCallback", aCallback));
     bool ignoreResults = false;
     Unused << aCallback->GetIgnoreResults(&ignoreResults);
     if (!ignoreResults) {
       nsCOMPtr<nsIRunnable> event =
         new NotifyPlaceInfoCallback(callback, aPlace, true, NS_OK);
       (void)NS_DispatchToMainThread(event);
     }
   }
@@ -2700,17 +2704,18 @@ History::AddDownload(nsIURI* aSource, ns
   place.SetTransitionType(nsINavHistoryService::TRANSITION_DOWNLOAD);
   place.hidden = false;
 
   mozIStorageConnection* dbConn = GetDBConn();
   NS_ENSURE_STATE(dbConn);
 
   nsMainThreadPtrHandle<mozIVisitInfoCallback> callback;
   if (aDestination) {
-    callback = new nsMainThreadPtrHolder<mozIVisitInfoCallback>(new SetDownloadAnnotations(aDestination));
+    callback = new nsMainThreadPtrHolder<mozIVisitInfoCallback>(
+      "mozIVisitInfoCallback", new SetDownloadAnnotations(aDestination));
   }
 
   rv = InsertVisitedURIs::Start(dbConn, placeArray, callback);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Finally, notify that we've been visited.
   nsCOMPtr<nsIObserverService> obsService =
     mozilla::services::GetObserverService();
@@ -2881,17 +2886,18 @@ History::UpdatePlaces(JS::Handle<JS::Val
       }
     }
   }
 
   mozIStorageConnection* dbConn = GetDBConn();
   NS_ENSURE_STATE(dbConn);
 
   nsMainThreadPtrHandle<mozIVisitInfoCallback>
-    callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(aCallback));
+    callback(new nsMainThreadPtrHolder<mozIVisitInfoCallback>(
+      "mozIVisitInfoCallback", aCallback));
 
   // It is possible that all of the visits we were passed were dissallowed by
   // CanAddURI, which isn't an error.  If we have no visits to add, however,
   // we should not call InsertVisitedURIs::Start.
   if (visitData.Length()) {
     nsresult rv = InsertVisitedURIs::Start(dbConn, visitData,
                                            callback, aGroupNotifications,
                                            initialUpdatedCount);
--- a/toolkit/components/places/Shutdown.cpp
+++ b/toolkit/components/places/Shutdown.cpp
@@ -92,17 +92,18 @@ ClientsShutdownBlocker::ClientsShutdownB
   MOZ_ASSERT(NS_IsMainThread());
   // Create a barrier that will be exposed to clients through GetClient(), so
   // they can block Places shutdown.
   nsCOMPtr<nsIAsyncShutdownService> asyncShutdown = services::GetAsyncShutdown();
   MOZ_ASSERT(asyncShutdown);
   if (asyncShutdown) {
     nsCOMPtr<nsIAsyncShutdownBarrier> barrier;
     MOZ_ALWAYS_SUCCEEDS(asyncShutdown->MakeBarrier(mName, getter_AddRefs(barrier)));
-    mBarrier = new nsMainThreadPtrHolder<nsIAsyncShutdownBarrier>(barrier);
+    mBarrier = new nsMainThreadPtrHolder<nsIAsyncShutdownBarrier>(
+      "ClientsShutdownBlocker::mBarrier", barrier);
   }
 }
 
 already_AddRefed<nsIAsyncShutdownClient>
 ClientsShutdownBlocker::GetClient()
 {
   nsCOMPtr<nsIAsyncShutdownClient> client;
   if (mBarrier) {
@@ -111,17 +112,18 @@ ClientsShutdownBlocker::GetClient()
   return client.forget();
 }
 
 // nsIAsyncShutdownBlocker
 NS_IMETHODIMP
 ClientsShutdownBlocker::BlockShutdown(nsIAsyncShutdownClient* aParentClient)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  mParentClient = new nsMainThreadPtrHolder<nsIAsyncShutdownClient>(aParentClient);
+  mParentClient = new nsMainThreadPtrHolder<nsIAsyncShutdownClient>(
+    "ClientsShutdownBlocker::mParentClient", aParentClient);
   mState = RECEIVED_BLOCK_SHUTDOWN;
 
   if (NS_WARN_IF(!mBarrier)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // Wait until all the clients have removed their blockers.
   MOZ_ALWAYS_SUCCEEDS(mBarrier->Wait(this));
@@ -163,17 +165,18 @@ ConnectionShutdownBlocker::ConnectionShu
   // Do nothing.
 }
 
 // nsIAsyncShutdownBlocker
 NS_IMETHODIMP
 ConnectionShutdownBlocker::BlockShutdown(nsIAsyncShutdownClient* aParentClient)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  mParentClient = new nsMainThreadPtrHolder<nsIAsyncShutdownClient>(aParentClient);
+  mParentClient = new nsMainThreadPtrHolder<nsIAsyncShutdownClient>(
+    "ConnectionShutdownBlocker::mParentClient", aParentClient);
   mState = RECEIVED_BLOCK_SHUTDOWN;
   // Annotate that Database shutdown started.
   sIsStarted = true;
 
   // Fire internal database closing notification.
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   MOZ_ASSERT(os);
   if (os) {
@@ -204,18 +207,18 @@ ConnectionShutdownBlocker::Complete(nsre
   // possible cycles.
   mDatabase = nullptr;
 
   // Notify the connection has gone.
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   MOZ_ASSERT(os);
   if (os) {
     MOZ_ALWAYS_SUCCEEDS(os->NotifyObservers(nullptr,
-					    TOPIC_PLACES_CONNECTION_CLOSED,
-					    nullptr));
+              TOPIC_PLACES_CONNECTION_CLOSED,
+              nullptr));
   }
   mState = NOTIFIED_OBSERVERS_PLACES_CONNECTION_CLOSED;
 
   // mParentClient is nullptr in tests
   if (mParentClient) {
     nsresult rv = mParentClient->RemoveBlocker(this);
     if (NS_WARN_IF(NS_FAILED(rv))) return rv;
     mParentClient = nullptr;
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -1206,17 +1206,18 @@ TelemetryImpl::GetLoadedModules(JSContex
   nsCOMPtr<nsIThreadManager> tm = do_GetService(NS_THREADMANAGER_CONTRACTID);
   nsCOMPtr<nsIThread> getModulesThread;
   nsresult rv = tm->NewThread(0, 0, getter_AddRefs(getModulesThread));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     promise->MaybeReject(NS_ERROR_FAILURE);
     return NS_OK;
   }
 
-  nsMainThreadPtrHandle<Promise> mainThreadPromise(new nsMainThreadPtrHolder<Promise>(promise));
+  nsMainThreadPtrHandle<Promise> mainThreadPromise(
+    new nsMainThreadPtrHolder<Promise>("Promise", promise));
   nsCOMPtr<nsIRunnable> runnable = new GetLoadedModulesRunnable(mainThreadPromise);
   promise.forget(aPromise);
 
   return getModulesThread->Dispatch(runnable, nsIEventTarget::DISPATCH_NORMAL);
 #else // MOZ_GECKO_PROFILER
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif // MOZ_GECKO_PROFILER
 }
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -1047,17 +1047,18 @@ private:
 
 NS_IMPL_ISUPPORTS(nsUrlClassifierLookupCallback,
                   nsIUrlClassifierLookupCallback,
                   nsIUrlClassifierHashCompleterCallback)
 
 nsUrlClassifierLookupCallback::~nsUrlClassifierLookupCallback()
 {
   if (mCallback) {
-    NS_ReleaseOnMainThread(mCallback.forget());
+    NS_ReleaseOnMainThread(
+      "nsUrlClassifierLookupCallback::mCallback", mCallback.forget());
   }
 }
 
 NS_IMETHODIMP
 nsUrlClassifierLookupCallback::LookupComplete(nsTArray<LookupResult>* results)
 {
   NS_ASSERTION(mResults == nullptr,
                "Should only get one set of results per nsUrlClassifierLookupCallback!");
@@ -1821,17 +1822,18 @@ nsUrlClassifierDBService::AsyncClassifyL
   nsresult rv = utilsService->GetKeyForURI(uri, key);
   NS_ENSURE_SUCCESS(rv, rv);
 
   auto worker = mWorker;
   nsCString tables(aTables);
 
   // Since aCallback will be passed around threads...
   nsMainThreadPtrHandle<nsIURIClassifierCallback> callback(
-    new nsMainThreadPtrHolder<nsIURIClassifierCallback>(aCallback));
+    new nsMainThreadPtrHolder<nsIURIClassifierCallback>(
+      "nsIURIClassifierCallback", aCallback));
 
   nsCOMPtr<nsIRunnable> r =
     NS_NewRunnableFunction([worker, key, tables, callback, startTime] () -> void {
 
     nsCString matchedLists;
     nsAutoPtr<LookupResultArray> results(new LookupResultArray());
     if (results) {
       nsresult rv = worker->DoLocalLookup(key, tables, results);
--- a/toolkit/components/url-classifier/nsUrlClassifierProxies.h
+++ b/toolkit/components/url-classifier/nsUrlClassifierProxies.h
@@ -205,17 +205,18 @@ private:
 
 // The remaining classes here are all proxies to the main thread
 
 class UrlClassifierLookupCallbackProxy final :
   public nsIUrlClassifierLookupCallback
 {
 public:
   explicit UrlClassifierLookupCallbackProxy(nsIUrlClassifierLookupCallback* aTarget)
-    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierLookupCallback>(aTarget))
+    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierLookupCallback>(
+        "UrlClassifierLookupCallbackProxy::mTarget", aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERLOOKUPCALLBACK
 
   class LookupCompleteRunnable : public mozilla::Runnable
   {
   public:
@@ -237,17 +238,18 @@ private:
 
   nsMainThreadPtrHandle<nsIUrlClassifierLookupCallback> mTarget;
 };
 
 class UrlClassifierCallbackProxy final : public nsIUrlClassifierCallback
 {
 public:
   explicit UrlClassifierCallbackProxy(nsIUrlClassifierCallback* aTarget)
-    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierCallback>(aTarget))
+    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierCallback>(
+        "UrlClassifierCallbackProxy::mTarget", aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERCALLBACK
 
   class HandleEventRunnable : public mozilla::Runnable
   {
   public:
@@ -270,17 +272,18 @@ private:
   nsMainThreadPtrHandle<nsIUrlClassifierCallback> mTarget;
 };
 
 class UrlClassifierUpdateObserverProxy final :
   public nsIUrlClassifierUpdateObserver
 {
 public:
   explicit UrlClassifierUpdateObserverProxy(nsIUrlClassifierUpdateObserver* aTarget)
-    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierUpdateObserver>(aTarget))
+    : mTarget(new nsMainThreadPtrHolder<nsIUrlClassifierUpdateObserver>(
+        "UrlClassifierUpdateObserverProxy::mTarget", aTarget))
   { }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURLCLASSIFIERUPDATEOBSERVER
 
   class UpdateUrlRequestedRunnable : public mozilla::Runnable
   {
   public:
--- a/xpcom/base/nsConsoleService.cpp
+++ b/xpcom/base/nsConsoleService.cpp
@@ -315,17 +315,18 @@ nsConsoleService::LogMessageWithMode(nsI
       r = new LogMessageRunnable(aMessage, this);
     }
   }
 
   if (retiredMessage) {
     // Release |retiredMessage| on the main thread in case it is an instance of
     // a mainthread-only class like nsScriptErrorWithStack and we're off the
     // main thread.
-    NS_ReleaseOnMainThread(retiredMessage.forget());
+    NS_ReleaseOnMainThread(
+      "nsConsoleService::retiredMessage", retiredMessage.forget());
   }
 
   if (r) {
     // avoid failing in XPCShell tests
     nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
     if (mainThread) {
       SystemGroup::Dispatch("LogMessageRunnable", TaskCategory::Other, r.forget());
     }
--- a/xpcom/base/nsInterfaceRequestorAgg.cpp
+++ b/xpcom/base/nsInterfaceRequestorAgg.cpp
@@ -49,18 +49,20 @@ nsInterfaceRequestorAgg::GetInterface(co
   if (mSecond && NS_FAILED(rv)) {
     rv = mSecond->GetInterface(aIID, aResult);
   }
   return rv;
 }
 
 nsInterfaceRequestorAgg::~nsInterfaceRequestorAgg()
 {
-  NS_ProxyRelease(mConsumerTarget, mFirst.forget());
-  NS_ProxyRelease(mConsumerTarget, mSecond.forget());
+  NS_ProxyRelease(
+    "nsInterfaceRequestorAgg::mFirst", mConsumerTarget, mFirst.forget());
+  NS_ProxyRelease(
+    "nsInterfaceRequestorAgg::mSecond", mConsumerTarget, mSecond.forget());
 }
 
 nsresult
 NS_NewInterfaceRequestorAggregation(nsIInterfaceRequestor* aFirst,
                                     nsIInterfaceRequestor* aSecond,
                                     nsIInterfaceRequestor** aResult)
 {
   *aResult = new nsInterfaceRequestorAgg(aFirst, aSecond);