Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug.
authorFlorian Quèze <florian@queze.net>
Tue, 07 Sep 2021 08:01:18 +0000
changeset 591163 79474e4c8adf9bbc705659848616c7a060060de8
parent 591162 eac40293649628d32911c909219d514bebb8ce63
child 591164 5710a72e4438f29e8f0ae76273d8af7e14db022c
push id38769
push usermlaza@mozilla.com
push dateTue, 07 Sep 2021 15:42:53 +0000
treeherdermozilla-central@295a38fd9261 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1728760
milestone94.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 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug. Differential Revision: https://phabricator.services.mozilla.com/D124349
docshell/base/nsDSURIContentListener.cpp
docshell/base/nsDSURIContentListener.h
dom/base/EventSource.cpp
dom/media/mediacontrol/MediaController.cpp
dom/media/mediacontrol/MediaController.h
dom/media/webrtc/jsapi/RTCDTMFSender.cpp
dom/media/webrtc/jsapi/RTCDTMFSender.h
dom/media/webrtc/transport/test/sctp_unittest.cpp
dom/reporting/ReportDeliver.cpp
dom/reporting/ReportDeliver.h
dom/reporting/ReportingHeader.cpp
dom/reporting/ReportingHeader.h
dom/serviceworkers/ServiceWorkerRegistrationProxy.cpp
dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp
dom/serviceworkers/ServiceWorkerShutdownBlocker.h
dom/storage/StorageActivityService.cpp
dom/storage/StorageActivityService.h
js/xpconnect/loader/ScriptPreloader.cpp
js/xpconnect/loader/ScriptPreloader.h
netwerk/base/RequestContextService.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsProtocolProxyService.h
netwerk/base/nsSocketTransportService2.cpp
netwerk/base/nsSocketTransportService2.h
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceChild.h
netwerk/dns/ODoHService.cpp
netwerk/dns/ODoHService.h
netwerk/dns/TRRService.cpp
netwerk/dns/TRRService.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpConnectionMgr.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/system/mac/nsNetworkLinkService.h
netwerk/system/mac/nsNetworkLinkService.mm
netwerk/test/gtest/TestUDPSocket.cpp
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/sessionstore/SessionStoreDataCollector.cpp
toolkit/components/sessionstore/SessionStoreDataCollector.h
toolkit/components/viaduct/ViaductRequest.cpp
toolkit/components/viaduct/ViaductRequest.h
uriloader/preload/PreloaderBase.cpp
uriloader/preload/PreloaderBase.h
xpcom/base/AvailableMemoryWatcherWin.cpp
xpcom/threads/nsITimer.idl
--- a/docshell/base/nsDSURIContentListener.cpp
+++ b/docshell/base/nsDSURIContentListener.cpp
@@ -24,18 +24,19 @@
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_ADDREF(MaybeCloseWindowHelper)
 NS_IMPL_RELEASE(MaybeCloseWindowHelper)
 
 NS_INTERFACE_MAP_BEGIN(MaybeCloseWindowHelper)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
 NS_INTERFACE_MAP_END
 
 MaybeCloseWindowHelper::MaybeCloseWindowHelper(BrowsingContext* aContentContext)
     : mBrowsingContext(aContentContext),
       mTimer(nullptr),
       mShouldCloseWindow(false) {}
 
 MaybeCloseWindowHelper::~MaybeCloseWindowHelper() {}
@@ -95,16 +96,22 @@ MaybeCloseWindowHelper::Notify(nsITimer*
 
   mBCToClose->Close(CallerType::System, IgnoreErrors());
   mBCToClose = nullptr;
   mTimer = nullptr;
 
   return NS_OK;
 }
 
+NS_IMETHODIMP
+MaybeCloseWindowHelper::GetName(nsACString& aName) {
+  aName.AssignLiteral("MaybeCloseWindowHelper");
+  return NS_OK;
+}
+
 nsDSURIContentListener::nsDSURIContentListener(nsDocShell* aDocShell)
     : mDocShell(aDocShell),
       mExistingJPEGRequest(nullptr),
       mParentContentListener(nullptr) {}
 
 nsDSURIContentListener::~nsDSURIContentListener() {}
 
 NS_IMPL_ADDREF(nsDSURIContentListener)
--- a/docshell/base/nsDSURIContentListener.h
+++ b/docshell/base/nsDSURIContentListener.h
@@ -13,20 +13,21 @@
 #include "nsITimer.h"
 
 class nsDocShell;
 class nsIInterfaceRequestor;
 class nsIWebNavigationInfo;
 class nsPIDOMWindowOuter;
 
 // Helper Class to eventually close an already opened window
-class MaybeCloseWindowHelper final : public nsITimerCallback {
+class MaybeCloseWindowHelper final : public nsITimerCallback, public nsINamed {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   explicit MaybeCloseWindowHelper(
       mozilla::dom::BrowsingContext* aContentContext);
 
   /**
    * Closes the provided window async (if mShouldCloseWindow is true) and
    * returns a valid browsingContext to be used instead as parent for dialogs or
    * similar things.
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -72,26 +72,28 @@ static LazyLogModule gEventSourceLog("Ev
 
 class EventSourceImpl final : public nsIObserver,
                               public nsIStreamListener,
                               public nsIChannelEventSink,
                               public nsIInterfaceRequestor,
                               public nsSupportsWeakReference,
                               public nsIEventTarget,
                               public nsITimerCallback,
+                              public nsINamed,
                               public nsIThreadRetargetableStreamListener {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIEVENTTARGET_FULL
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
 
   EventSourceImpl(EventSource* aEventSource,
                   nsICookieJarSettings* aCookieJarSettings);
 
   enum { CONNECTING = 0U, OPEN = 1U, CLOSED = 2U };
 
   void Close();
@@ -357,17 +359,17 @@ class EventSourceImpl final : public nsI
     CloseInternal();
   }
 };
 
 NS_IMPL_ISUPPORTS(EventSourceImpl, nsIObserver, nsIStreamListener,
                   nsIRequestObserver, nsIChannelEventSink,
                   nsIInterfaceRequestor, nsISupportsWeakReference,
                   nsIEventTarget, nsIThreadRetargetableStreamListener,
-                  nsITimerCallback)
+                  nsITimerCallback, nsINamed)
 
 EventSourceImpl::EventSourceImpl(EventSource* aEventSource,
                                  nsICookieJarSettings* aCookieJarSettings)
     : mReconnectionTime(0),
       mStatus(PARSE_STATE_OFF),
       mFrozen(false),
       mGoingToDispatchAllMessages(false),
       mIsMainThread(NS_IsMainThread()),
@@ -1399,16 +1401,21 @@ NS_IMETHODIMP EventSourceImpl::Notify(ns
     nsresult rv = InitChannelAndRequestEventSource(mIsMainThread);
     if (NS_FAILED(rv)) {
       NS_WARNING("InitChannelAndRequestEventSource() failed");
     }
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP EventSourceImpl::GetName(nsACString& aName) {
+  aName.AssignLiteral("EventSourceImpl");
+  return NS_OK;
+}
+
 nsresult EventSourceImpl::Thaw() {
   AssertIsOnMainThread();
   if (IsClosed() || !mFrozen) {
     return NS_OK;
   }
 
   MOZ_ASSERT(!mHttpChannel, "the connection hasn't been closed!!!");
 
--- a/dom/media/mediacontrol/MediaController.cpp
+++ b/dom/media/mediacontrol/MediaController.cpp
@@ -23,17 +23,17 @@
           ("MediaController=%p, Id=%" PRId64 ", " msg, this, this->Id(), \
            ##__VA_ARGS__))
 
 namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(MediaController, DOMEventTargetHelper)
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(MediaController,
                                              DOMEventTargetHelper,
-                                             nsITimerCallback)
+                                             nsITimerCallback, nsINamed)
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(MediaController,
                                                DOMEventTargetHelper)
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 nsISupports* MediaController::GetParentObject() const {
   RefPtr<BrowsingContext> bc = BrowsingContext::Get(Id());
   return bc;
 }
@@ -305,16 +305,21 @@ NS_IMETHODIMP MediaController::Notify(ns
   if (!mIsActive) {
     LOG("Cancel deactivation timer because controller has been deactivated");
     return NS_OK;
   }
   Deactivate();
   return NS_OK;
 }
 
+NS_IMETHODIMP MediaController::GetName(nsACString& aName) {
+  aName.AssignLiteral("MediaController");
+  return NS_OK;
+}
+
 void MediaController::NotifyMediaAudibleChanged(uint64_t aBrowsingContextId,
                                                 MediaAudibleState aState) {
   if (mShutdown) {
     return;
   }
 
   bool oldAudible = IsAudible();
   MediaStatusManager::NotifyMediaAudibleChanged(aBrowsingContextId, aState);
--- a/dom/media/mediacontrol/MediaController.h
+++ b/dom/media/mediacontrol/MediaController.h
@@ -70,20 +70,22 @@ class IMediaController {
  * Note that, if we don't enable audio competition, then we might have multiple
  * tabs playing media at the same time, we can use the ID to query the specific
  * controller from `MediaControlService`.
  */
 class MediaController final : public DOMEventTargetHelper,
                               public IMediaController,
                               public LinkedListElement<RefPtr<MediaController>>,
                               public MediaStatusManager,
-                              public nsITimerCallback {
+                              public nsITimerCallback,
+                              public nsINamed {
  public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaController,
                                                          DOMEventTargetHelper)
   explicit MediaController(uint64_t aBrowsingContextId);
 
   // WebIDL methods
   nsISupports* GetParentObject() const;
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
--- a/dom/media/webrtc/jsapi/RTCDTMFSender.cpp
+++ b/dom/media/webrtc/jsapi/RTCDTMFSender.cpp
@@ -18,16 +18,17 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(RTCDT
                                    mTransceiver, mSendTimer)
 
 NS_IMPL_ADDREF_INHERITED(RTCDTMFSender, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(RTCDTMFSender, DOMEventTargetHelper)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RTCDTMFSender)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 LazyLogModule gDtmfLog("RTCDTMFSender");
 
 RTCDTMFSender::RTCDTMFSender(nsPIDOMWindowInner* aWindow,
                              TransceiverImpl* aTransceiver,
                              AudioSessionConduit* aConduit)
     : DOMEventTargetHelper(aWindow),
@@ -136,15 +137,20 @@ nsresult RTCDTMFSender::Notify(nsITimer*
 
   RefPtr<RTCDTMFToneChangeEvent> event =
       RTCDTMFToneChangeEvent::Constructor(this, u"tonechange"_ns, init);
   DispatchTrustedEvent(event);
 
   return NS_OK;
 }
 
+nsresult RTCDTMFSender::GetName(nsACString& aName) {
+  aName.AssignLiteral("RTCDTMFSender");
+  return NS_OK;
+}
+
 void RTCDTMFSender::GetToneBuffer(nsAString& aOutToneBuffer) {
   aOutToneBuffer = mToneBuffer;
 }
 
 }  // namespace mozilla::dom
 
 #undef LOGTAG
--- a/dom/media/webrtc/jsapi/RTCDTMFSender.h
+++ b/dom/media/webrtc/jsapi/RTCDTMFSender.h
@@ -14,24 +14,27 @@ class nsPIDOMWindowInner;
 class nsITimer;
 
 namespace mozilla {
 class AudioSessionConduit;
 class TransceiverImpl;
 
 namespace dom {
 
-class RTCDTMFSender : public DOMEventTargetHelper, public nsITimerCallback {
+class RTCDTMFSender : public DOMEventTargetHelper,
+                      public nsITimerCallback,
+                      public nsINamed {
  public:
   explicit RTCDTMFSender(nsPIDOMWindowInner* aWindow,
                          TransceiverImpl* aTransceiver,
                          AudioSessionConduit* aConduit);
 
   // nsISupports
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RTCDTMFSender, DOMEventTargetHelper)
 
   // webidl
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
   void InsertDTMF(const nsAString& aTones, uint32_t aDuration,
                   uint32_t aInterToneGap, ErrorResult& aRv);
--- a/dom/media/webrtc/transport/test/sctp_unittest.cpp
+++ b/dom/media/webrtc/transport/test/sctp_unittest.cpp
@@ -34,32 +34,33 @@ using namespace mozilla;
 
 static bool sctp_logging = false;
 static int port_number = 5000;
 
 namespace {
 
 class TransportTestPeer;
 
-class SendPeriodic : public nsITimerCallback {
+class SendPeriodic : public nsITimerCallback, public nsINamed {
  public:
   SendPeriodic(TransportTestPeer* peer, int to_send)
       : peer_(peer), to_send_(to_send) {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
  protected:
   virtual ~SendPeriodic() = default;
 
   TransportTestPeer* peer_;
   int to_send_;
 };
 
-NS_IMPL_ISUPPORTS(SendPeriodic, nsITimerCallback)
+NS_IMPL_ISUPPORTS(SendPeriodic, nsITimerCallback, nsINamed)
 
 class TransportTestPeer : public sigslot::has_slots<> {
  public:
   TransportTestPeer(std::string name, int local_port, int remote_port,
                     MtransportTestUtils* utils)
       : name_(name),
         connected_(false),
         sent_(0),
@@ -304,16 +305,22 @@ NS_IMETHODIMP SendPeriodic::Notify(nsITi
   peer_->SendOne();
   --to_send_;
   if (!to_send_) {
     timer->Cancel();
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+SendPeriodic::GetName(nsACString& aName) {
+  aName.AssignLiteral("SendPeriodic");
+  return NS_OK;
+}
+
 class SctpTransportTest : public MtransportTest {
  public:
   SctpTransportTest() = default;
 
   ~SctpTransportTest() = default;
 
   static void debug_printf(const char* format, ...) {
     va_list ap;
--- a/dom/reporting/ReportDeliver.cpp
+++ b/dom/reporting/ReportDeliver.cpp
@@ -367,16 +367,22 @@ ReportDeliver::Notify(nsITimer* aTimer) 
     nsAutoCString u(url);
     SendReports(value, url, principal);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+ReportDeliver::GetName(nsACString& aName) {
+  aName.AssignLiteral("ReportDeliver");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 ReportDeliver::Observe(nsISupports* aSubject, const char* aTopic,
                        const char16_t* aData) {
   MOZ_ASSERT(!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID));
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (NS_WARN_IF(!obs)) {
     return NS_OK;
   }
@@ -395,15 +401,16 @@ ReportDeliver::Observe(nsISupports* aSub
 ReportDeliver::ReportDeliver() = default;
 
 ReportDeliver::~ReportDeliver() = default;
 
 NS_INTERFACE_MAP_BEGIN(ReportDeliver)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(ReportDeliver)
 NS_IMPL_RELEASE(ReportDeliver)
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/reporting/ReportDeliver.h
+++ b/dom/reporting/ReportDeliver.h
@@ -18,21 +18,24 @@
 class nsIPrincipal;
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 namespace dom {
 
 class ReportBody;
 
-class ReportDeliver final : public nsIObserver, public nsITimerCallback {
+class ReportDeliver final : public nsIObserver,
+                            public nsITimerCallback,
+                            public nsINamed {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   struct ReportData {
     nsString mType;
     nsString mGroupName;
     nsString mURL;
     nsCString mEndpointURL;
     nsString mUserAgent;
     TimeStamp mCreationTime;
--- a/dom/reporting/ReportingHeader.cpp
+++ b/dom/reporting/ReportingHeader.cpp
@@ -727,16 +727,22 @@ ReportingHeader::Notify(nsITimer* aTimer
   mCleanupTimer = nullptr;
 
   RemoveOriginsForTTL();
   MaybeCreateCleanupTimer();
 
   return NS_OK;
 }
 
+NS_IMETHODIMP
+ReportingHeader::GetName(nsACString& aName) {
+  aName.AssignLiteral("ReportingHeader");
+  return NS_OK;
+}
+
 void ReportingHeader::MaybeCreateCleanupTimer() {
   if (mCleanupTimer) {
     return;
   }
 
   if (mOrigins.Count() == 0) {
     return;
   }
@@ -760,15 +766,16 @@ void ReportingHeader::MaybeCancelCleanup
   mCleanupTimer->Cancel();
   mCleanupTimer = nullptr;
 }
 
 NS_INTERFACE_MAP_BEGIN(ReportingHeader)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(ReportingHeader)
 NS_IMPL_RELEASE(ReportingHeader)
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/reporting/ReportingHeader.h
+++ b/dom/reporting/ReportingHeader.h
@@ -22,21 +22,24 @@ namespace mozilla {
 class OriginAttributesPattern;
 
 namespace ipc {
 class PrincipalInfo;
 }
 
 namespace dom {
 
-class ReportingHeader final : public nsIObserver, public nsITimerCallback {
+class ReportingHeader final : public nsIObserver,
+                              public nsITimerCallback,
+                              public nsINamed {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   static void Initialize();
 
   // Exposed structs for gtests
 
   struct Endpoint {
     nsCOMPtr<nsIURI> mUrl;
     uint32_t mPriority;
--- a/dom/serviceworkers/ServiceWorkerRegistrationProxy.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationProxy.cpp
@@ -14,27 +14,29 @@
 #include "ServiceWorkerUnregisterCallback.h"
 
 namespace mozilla {
 namespace dom {
 
 using mozilla::ipc::AssertIsOnBackgroundThread;
 
 class ServiceWorkerRegistrationProxy::DelayedUpdate final
-    : public nsITimerCallback {
+    : public nsITimerCallback,
+      public nsINamed {
   RefPtr<ServiceWorkerRegistrationProxy> mProxy;
   RefPtr<ServiceWorkerRegistrationPromise::Private> mPromise;
   nsCOMPtr<nsITimer> mTimer;
   nsCString mNewestWorkerScriptUrl;
 
   ~DelayedUpdate() = default;
 
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   DelayedUpdate(RefPtr<ServiceWorkerRegistrationProxy>&& aProxy,
                 RefPtr<ServiceWorkerRegistrationPromise::Private>&& aPromise,
                 nsCString&& aNewestWorkerScriptUrl, uint32_t delay);
 
   void ChainTo(RefPtr<ServiceWorkerRegistrationPromise::Private> aPromise);
 
   void Reject();
@@ -256,17 +258,17 @@ class UpdateCallback final : public Serv
   void UpdateFailed(ErrorResult& aResult) override {
     mPromise->Reject(CopyableErrorResult(aResult), __func__);
   }
 };
 
 }  // anonymous namespace
 
 NS_IMPL_ISUPPORTS(ServiceWorkerRegistrationProxy::DelayedUpdate,
-                  nsITimerCallback)
+                  nsITimerCallback, nsINamed)
 
 ServiceWorkerRegistrationProxy::DelayedUpdate::DelayedUpdate(
     RefPtr<ServiceWorkerRegistrationProxy>&& aProxy,
     RefPtr<ServiceWorkerRegistrationPromise::Private>&& aPromise,
     nsCString&& aNewestWorkerScriptUrl, uint32_t delay)
     : mProxy(std::move(aProxy)),
       mPromise(std::move(aPromise)),
       mNewestWorkerScriptUrl(std::move(aNewestWorkerScriptUrl)) {
@@ -325,16 +327,22 @@ ServiceWorkerRegistrationProxy::DelayedU
 
   mTimer = nullptr;
   mProxy->mDelayedUpdate = nullptr;
 
   scopeExit.release();
   return NS_OK;
 }
 
+NS_IMETHODIMP
+ServiceWorkerRegistrationProxy::DelayedUpdate::GetName(nsACString& aName) {
+  aName.AssignLiteral("ServiceWorkerRegistrationProxy::DelayedUpdate");
+  return NS_OK;
+}
+
 RefPtr<ServiceWorkerRegistrationPromise> ServiceWorkerRegistrationProxy::Update(
     const nsCString& aNewestWorkerScriptUrl) {
   AssertIsOnBackgroundThread();
 
   RefPtr<ServiceWorkerRegistrationProxy> self = this;
   RefPtr<ServiceWorkerRegistrationPromise::Private> promise =
       new ServiceWorkerRegistrationPromise::Private(__func__);
 
--- a/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp
+++ b/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp
@@ -19,24 +19,30 @@
 
 #include "mozilla/Assertions.h"
 #include "mozilla/RefPtr.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(ServiceWorkerShutdownBlocker, nsIAsyncShutdownBlocker,
-                  nsITimerCallback)
+                  nsITimerCallback, nsINamed)
 
 NS_IMETHODIMP ServiceWorkerShutdownBlocker::GetName(nsAString& aNameOut) {
   aNameOut = nsLiteralString(
       u"ServiceWorkerShutdownBlocker: shutting down Service Workers");
   return NS_OK;
 }
 
+// nsINamed implementation
+NS_IMETHODIMP ServiceWorkerShutdownBlocker::GetName(nsACString& aNameOut) {
+  aNameOut.AssignLiteral("ServiceWorkerShutdownBlocker");
+  return NS_OK;
+}
+
 NS_IMETHODIMP
 ServiceWorkerShutdownBlocker::BlockShutdown(nsIAsyncShutdownClient* aClient) {
   AssertIsOnMainThread();
   MOZ_ASSERT(!mShutdownClient);
   MOZ_ASSERT(mServiceWorkerManager);
 
   mShutdownClient = aClient;
 
--- a/dom/serviceworkers/ServiceWorkerShutdownBlocker.h
+++ b/dom/serviceworkers/ServiceWorkerShutdownBlocker.h
@@ -37,24 +37,26 @@ class ServiceWorkerManager;
  * before or during the associated shutdown phase.
  *
  * In beta/release builds there will be an additional timer that starts ticking
  * once both the shutdown phase has been reached and the state is "not accepting
  * promises". If when the timer expire there are still pending promises,
  * shutdown will be forcefully unblocked.
  */
 class ServiceWorkerShutdownBlocker final : public nsIAsyncShutdownBlocker,
-                                           public nsITimerCallback {
+                                           public nsITimerCallback,
+                                           public nsINamed {
  public:
   using Progress = ServiceWorkerShutdownState::Progress;
   static const uint32_t kInvalidShutdownStateId = 0;
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIASYNCSHUTDOWNBLOCKER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   /**
    * Returns the registered shutdown blocker if registration succeeded and
    * nullptr otherwise.
    */
   static already_AddRefed<ServiceWorkerShutdownBlocker> CreateAndRegisterOn(
       nsIAsyncShutdownClient& aShutdownBarrier,
       ServiceWorkerManager& aServiceWorkerManager);
--- a/dom/storage/StorageActivityService.cpp
+++ b/dom/storage/StorageActivityService.cpp
@@ -240,16 +240,22 @@ StorageActivityService::Notify(nsITimer*
   if (mActivities.Count() == 0) {
     MaybeStopTimer();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+StorageActivityService::GetName(nsACString& aName) {
+  aName.AssignLiteral("StorageActivityService");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 StorageActivityService::GetActiveOrigins(PRTime aFrom, PRTime aTo,
                                          nsIArray** aRetval) {
   uint64_t now = PR_Now();
   if (((now - aFrom) / PR_USEC_PER_SEC) > TIME_MAX_SECS || aFrom >= aTo) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsresult rv = NS_OK;
@@ -299,16 +305,17 @@ StorageActivityService::TestOnlyReset() 
   return NS_OK;
 }
 
 NS_INTERFACE_MAP_BEGIN(StorageActivityService)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIStorageActivityService)
   NS_INTERFACE_MAP_ENTRY(nsIStorageActivityService)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(StorageActivityService)
 NS_IMPL_RELEASE(StorageActivityService)
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/storage/StorageActivityService.h
+++ b/dom/storage/StorageActivityService.h
@@ -19,22 +19,24 @@ namespace ipc {
 class PrincipalInfo;
 }  // namespace ipc
 
 namespace dom {
 
 class StorageActivityService final : public nsIStorageActivityService,
                                      public nsIObserver,
                                      public nsITimerCallback,
+                                     public nsINamed,
                                      public nsSupportsWeakReference {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTORAGEACTIVITYSERVICE
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   // Main-thread only.
   static void SendActivity(nsIPrincipal* aPrincipal);
 
   // Thread-safe.
   static void SendActivity(const mozilla::ipc::PrincipalInfo& aPrincipalInfo);
 
   // Thread-safe but for parent process only!
--- a/js/xpconnect/loader/ScriptPreloader.cpp
+++ b/js/xpconnect/loader/ScriptPreloader.cpp
@@ -726,16 +726,21 @@ Result<Ok, nsresult> ScriptPreloader::Wr
     }
   }
 
   MOZ_TRY(cacheFile->MoveTo(nullptr, mBaseName + u".bin"_ns));
 
   return Ok();
 }
 
+nsresult ScriptPreloader::GetName(nsACString& aName) {
+  aName.AssignLiteral("ScriptPreloader");
+  return NS_OK;
+}
+
 // Runs in the mSaveThread thread, and writes out the cache file for the next
 // session after a reasonable delay.
 nsresult ScriptPreloader::Run() {
   MonitorAutoLock mal(mSaveMonitor);
 
   // Ideally wait about 10 seconds before saving, to avoid unnecessary IO
   // during early startup. But only if the cache hasn't been invalidated,
   // since that can trigger a new write during shutdown, and we don't want to
@@ -1260,13 +1265,13 @@ already_AddRefed<nsIAsyncShutdownClient>
   nsCOMPtr<nsIAsyncShutdownClient> barrier;
   Unused << svc->GetXpcomWillShutdown(getter_AddRefs(barrier));
   MOZ_RELEASE_ASSERT(barrier);
 
   return barrier.forget();
 }
 
 NS_IMPL_ISUPPORTS(ScriptPreloader, nsIObserver, nsIRunnable, nsIMemoryReporter,
-                  nsIAsyncShutdownBlocker)
+                  nsINamed, nsIAsyncShutdownBlocker)
 
 #undef LOG
 
 }  // namespace mozilla
--- a/js/xpconnect/loader/ScriptPreloader.h
+++ b/js/xpconnect/loader/ScriptPreloader.h
@@ -63,26 +63,28 @@ struct Matcher {
 };
 }  // namespace loader
 
 using namespace mozilla::loader;
 
 class ScriptPreloader : public nsIObserver,
                         public nsIMemoryReporter,
                         public nsIRunnable,
+                        public nsINamed,
                         public nsIAsyncShutdownBlocker {
   MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf)
 
   friend class mozilla::loader::ScriptCacheChild;
 
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIMEMORYREPORTER
   NS_DECL_NSIRUNNABLE
+  NS_DECL_NSINAMED
   NS_DECL_NSIASYNCSHUTDOWNBLOCKER
 
   static ScriptPreloader& GetSingleton();
   static ScriptPreloader& GetChildSingleton();
 
   static ProcessType GetChildProcessType(const nsACString& remoteType);
 
   // Fill some options that should be consistent across all scripts stored
--- a/netwerk/base/RequestContextService.cpp
+++ b/netwerk/base/RequestContextService.cpp
@@ -35,21 +35,24 @@ LazyLogModule gRequestContextLog("Reques
 #define LOG(args) MOZ_LOG(gRequestContextLog, LogLevel::Info, args)
 
 static StaticRefPtr<RequestContextService> gSingleton;
 
 // This is used to prevent adding tail pending requests after shutdown
 static bool sShutdown = false;
 
 // nsIRequestContext
-class RequestContext final : public nsIRequestContext, public nsITimerCallback {
+class RequestContext final : public nsIRequestContext,
+                             public nsITimerCallback,
+                             public nsINamed {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUESTCONTEXT
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   explicit RequestContext(const uint64_t id);
 
  private:
   virtual ~RequestContext();
 
   void ProcessTailQueue(nsresult aResult);
   // Reschedules the timer if needed
@@ -85,17 +88,17 @@ class RequestContext final : public nsIR
   TimeStamp mBeginLoadTime;
 
   // This member is true only between DOMContentLoaded notification and
   // next document load beginning for this request context.
   // Top level request contexts are recycled.
   bool mAfterDOMContentLoaded;
 };
 
-NS_IMPL_ISUPPORTS(RequestContext, nsIRequestContext, nsITimerCallback)
+NS_IMPL_ISUPPORTS(RequestContext, nsIRequestContext, nsITimerCallback, nsINamed)
 
 RequestContext::RequestContext(const uint64_t aID)
     : mID(aID),
       mBlockingTransactionCount(0),
       mNonTailRequests(0),
       mAfterDOMContentLoaded(false) {
   LOG(("RequestContext::RequestContext this=%p id=%" PRIx64, this, mID));
 }
@@ -320,16 +323,22 @@ RequestContext::Notify(nsITimer* timer) 
   mTimerScheduledAt = TimeStamp();
 
   ProcessTailQueue(NS_OK);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+RequestContext::GetName(nsACString& aName) {
+  aName.AssignLiteral("RequestContext");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 RequestContext::IsContextTailBlocked(nsIRequestTailUnblockCallback* aRequest,
                                      bool* aBlocked) {
   MOZ_ASSERT(NS_IsMainThread());
 
   LOG(("RequestContext::IsContextTailBlocked this=%p, request=%p, queued=%zu",
        this, aRequest, mTailQueue.Length()));
 
   *aBlocked = false;
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -758,16 +758,17 @@ NS_IMPL_CLASSINFO(nsProtocolProxyService
                   NS_PROTOCOLPROXYSERVICE_CID)
 
 // NS_IMPL_QUERY_INTERFACE_CI with the nsProtocolProxyService QI change
 NS_INTERFACE_MAP_BEGIN(nsProtocolProxyService)
   NS_INTERFACE_MAP_ENTRY(nsIProtocolProxyService)
   NS_INTERFACE_MAP_ENTRY(nsIProtocolProxyService2)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(nsProtocolProxyService)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIProtocolProxyService)
   NS_IMPL_QUERY_CLASSINFO(nsProtocolProxyService)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CI_INTERFACE_GETTER(nsProtocolProxyService, nsIProtocolProxyService,
                             nsIProtocolProxyService2)
 
@@ -940,16 +941,22 @@ nsProtocolProxyService::Observe(nsISuppo
 
 NS_IMETHODIMP
 nsProtocolProxyService::Notify(nsITimer* aTimer) {
   MOZ_ASSERT(aTimer == mReloadPACTimer);
   ReloadNetworkPAC();
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsProtocolProxyService::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsProtocolProxyService");
+  return NS_OK;
+}
+
 void nsProtocolProxyService::PrefsChanged(nsIPrefBranch* prefBranch,
                                           const char* pref) {
   nsresult rv = NS_OK;
   bool reloadPAC = false;
   nsAutoCString tempString;
 
   if (!pref || !strcmp(pref, PROXY_PREF("type"))) {
     int32_t type = -1;
--- a/netwerk/base/nsProtocolProxyService.h
+++ b/netwerk/base/nsProtocolProxyService.h
@@ -37,23 +37,25 @@ struct nsProtocolInfo;
   {                                                  \
     0x091eedd8, 0x8bae, 0x4fe3, {                    \
       0xad, 0x62, 0x0c, 0x87, 0x35, 0x1e, 0x64, 0x0d \
     }                                                \
   }
 
 class nsProtocolProxyService final : public nsIProtocolProxyService2,
                                      public nsIObserver,
-                                     public nsITimerCallback {
+                                     public nsITimerCallback,
+                                     public nsINamed {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPROTOCOLPROXYSERVICE2
   NS_DECL_NSIPROTOCOLPROXYSERVICE
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROTOCOL_PROXY_SERVICE_IMPL_CID)
 
   nsProtocolProxyService();
 
   nsresult Init();
 
  public:
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -713,17 +713,17 @@ int32_t nsSocketTransportService::Poll(T
 }
 
 //-----------------------------------------------------------------------------
 // xpcom api
 
 NS_IMPL_ISUPPORTS(nsSocketTransportService, nsISocketTransportService,
                   nsIRoutedSocketTransportService, nsIEventTarget,
                   nsISerialEventTarget, nsIThreadObserver, nsIRunnable,
-                  nsPISocketTransportService, nsIObserver,
+                  nsPISocketTransportService, nsIObserver, nsINamed,
                   nsIDirectTaskDispatcher)
 
 static const char* gCallbackPrefs[] = {
     SEND_BUFFER_PREF,
     KEEPALIVE_ENABLED_PREF,
     KEEPALIVE_IDLE_TIME_PREF,
     KEEPALIVE_RETRY_INTERVAL_PREF,
     KEEPALIVE_PROBE_COUNT_PREF,
@@ -1547,16 +1547,22 @@ void nsSocketTransportService::NotifyKee
   if (!sock || !sock->mHandler) {
     return;
   }
 
   sock->mHandler->OnKeepaliveEnabledPrefChange(mKeepaliveEnabledPref);
 }
 
 NS_IMETHODIMP
+nsSocketTransportService::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsSocketTransportService");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsSocketTransportService::Observe(nsISupports* subject, const char* topic,
                                   const char16_t* data) {
   SOCKET_LOG(("nsSocketTransportService::Observe topic=%s", topic));
 
   if (!strcmp(topic, "profile-initial-state")) {
     if (!Preferences::GetBool(IO_ACTIVITY_ENABLED_PREF, false)) {
       return NS_OK;
     }
--- a/netwerk/base/nsSocketTransportService2.h
+++ b/netwerk/base/nsSocketTransportService2.h
@@ -83,26 +83,28 @@ class LinkedRunnableEvent final
 
 //-----------------------------------------------------------------------------
 
 class nsSocketTransportService final : public nsPISocketTransportService,
                                        public nsISerialEventTarget,
                                        public nsIThreadObserver,
                                        public nsIRunnable,
                                        public nsIObserver,
+                                       public nsINamed,
                                        public nsIDirectTaskDispatcher {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSPISOCKETTRANSPORTSERVICE
   NS_DECL_NSISOCKETTRANSPORTSERVICE
   NS_DECL_NSIROUTEDSOCKETTRANSPORTSERVICE
   NS_DECL_NSIEVENTTARGET_FULL
   NS_DECL_NSITHREADOBSERVER
   NS_DECL_NSIRUNNABLE
   NS_DECL_NSIOBSERVER
+  NS_DECL_NSINAMED
   NS_DECL_NSIDIRECTTASKDISPATCHER
 
   static const uint32_t SOCKET_LIMIT_MIN = 50U;
 
   nsSocketTransportService();
 
   // Max Socket count may need to get initialized/used by nsHttpHandler
   // before this class is initialized.
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -48,17 +48,17 @@ already_AddRefed<CookieServiceChild> Coo
     gCookieChildService = new CookieServiceChild();
     ClearOnShutdown(&gCookieChildService);
   }
 
   return do_AddRef(gCookieChildService);
 }
 
 NS_IMPL_ISUPPORTS(CookieServiceChild, nsICookieService, nsIObserver,
-                  nsITimerCallback, nsISupportsWeakReference)
+                  nsITimerCallback, nsINamed, nsISupportsWeakReference)
 
 CookieServiceChild::CookieServiceChild() {
   NS_ASSERTION(IsNeckoChild(), "not a child process");
 
   auto* cc = static_cast<mozilla::dom::ContentChild*>(gNeckoChild->Manager());
   if (cc->IsShuttingDown()) {
     return;
   }
@@ -111,16 +111,22 @@ CookieServiceChild::Notify(nsITimer* aTi
   if (aTimer == mCookieTimer) {
     MoveCookies();
   } else {
     MOZ_CRASH("Unknown timer");
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+CookieServiceChild::GetName(nsACString& aName) {
+  aName.AssignLiteral("CookieServiceChild");
+  return NS_OK;
+}
+
 CookieServiceChild::~CookieServiceChild() { gCookieChildService = nullptr; }
 
 void CookieServiceChild::TrackCookieLoad(nsIChannel* aChannel) {
   if (!CanSend()) {
     return;
   }
 
   uint32_t rejectedReason = 0;
--- a/netwerk/cookie/CookieServiceChild.h
+++ b/netwerk/cookie/CookieServiceChild.h
@@ -24,24 +24,26 @@ namespace net {
 
 class Cookie;
 class CookieStruct;
 
 class CookieServiceChild final : public PCookieServiceChild,
                                  public nsICookieService,
                                  public nsIObserver,
                                  public nsITimerCallback,
+                                 public nsINamed,
                                  public nsSupportsWeakReference {
   friend class PCookieServiceChild;
 
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICOOKIESERVICE
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   typedef nsTArray<RefPtr<Cookie>> CookiesList;
   typedef nsClassHashtable<CookieKey, CookiesList> CookiesMap;
 
   CookieServiceChild();
 
   static already_AddRefed<CookieServiceChild> GetSingleton();
 
--- a/netwerk/dns/ODoHService.cpp
+++ b/netwerk/dns/ODoHService.cpp
@@ -27,17 +27,17 @@ static const char kODoHTargetPathPref[] 
 static const char kODoHConfigsUriPref[] = "network.trr.odoh.configs_uri";
 
 namespace mozilla {
 namespace net {
 
 ODoHService* gODoHService = nullptr;
 
 NS_IMPL_ISUPPORTS(ODoHService, nsIDNSListener, nsIObserver,
-                  nsISupportsWeakReference, nsITimerCallback,
+                  nsISupportsWeakReference, nsITimerCallback, nsINamed,
                   nsIStreamLoaderObserver)
 
 ODoHService::ODoHService()
     : mLock("net::ODoHService"), mQueryODoHConfigInProgress(false) {
   gODoHService = this;
 }
 
 ODoHService::~ODoHService() { gODoHService = nullptr; }
@@ -346,16 +346,22 @@ void ODoHService::StartTTLTimer(uint32_t
 
 NS_IMETHODIMP
 ODoHService::Notify(nsITimer* aTimer) {
   MOZ_ASSERT(aTimer == mTTLTimer);
   UpdateODoHConfig();
   return NS_OK;
 }
 
+NS_IMETHODIMP
+ODoHService::GetName(nsACString& aName) {
+  aName.AssignLiteral("ODoHService");
+  return NS_OK;
+}
+
 void ODoHService::ODoHConfigUpdateDone(uint32_t aTTL,
                                        Span<const uint8_t> aRawConfig) {
   MOZ_ASSERT_IF(XRE_IsParentProcess() && TRRService::Get(),
                 NS_IsMainThread() || TRRService::Get()->IsOnTRRThread());
   MOZ_ASSERT_IF(XRE_IsSocketProcess(), NS_IsMainThread());
 
   mQueryODoHConfigInProgress = false;
   mODoHConfigs.reset();
--- a/netwerk/dns/ODoHService.h
+++ b/netwerk/dns/ODoHService.h
@@ -20,22 +20,24 @@ namespace mozilla {
 namespace net {
 
 class ODoH;
 
 class ODoHService : public nsIDNSListener,
                     public nsIObserver,
                     public nsSupportsWeakReference,
                     public nsITimerCallback,
+                    public nsINamed,
                     public nsIStreamLoaderObserver {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDNSLISTENER
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_NSISTREAMLOADEROBSERVER
 
   ODoHService();
   bool Init();
   bool Enabled() const;
 
   const Maybe<nsTArray<ObliviousDoHConfig>>& ODoHConfigs();
   void AppendPendingODoHRequest(ODoH* aRequest);
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -59,17 +59,18 @@ constexpr nsLiteralCString kTRRDomains[]
 // static
 const nsCString& TRRService::ProviderKey() { return kTRRDomains[sDomainIndex]; }
 
 NS_IMPL_ISUPPORTS(TRRService, nsIObserver, nsISupportsWeakReference)
 
 NS_IMPL_ADDREF_USING_AGGREGATOR(TRRService::ConfirmationContext, OwningObject())
 NS_IMPL_RELEASE_USING_AGGREGATOR(TRRService::ConfirmationContext,
                                  OwningObject())
-NS_IMPL_QUERY_INTERFACE(TRRService::ConfirmationContext, nsITimerCallback)
+NS_IMPL_QUERY_INTERFACE(TRRService::ConfirmationContext, nsITimerCallback,
+                        nsINamed)
 
 TRRService::TRRService() { MOZ_ASSERT(NS_IsMainThread(), "wrong thread"); }
 
 // static
 TRRService* TRRService::Get() { return sTRRServicePtr; }
 
 // static
 void TRRService::AddObserver(nsIObserver* aObserver,
@@ -1039,16 +1040,22 @@ TRRService::ConfirmationContext::Notify(
     HandleEvent(ConfirmationEvent::Retry, lock);
     return NS_OK;
   }
 
   MOZ_CRASH("Unknown timer");
   return NS_OK;
 }
 
+NS_IMETHODIMP
+TRRService::ConfirmationContext::GetName(nsACString& aName) {
+  aName.AssignLiteral("TRRService::ConfirmationContext");
+  return NS_OK;
+}
+
 static char StatusToChar(nsresult aLookupStatus, nsresult aChannelStatus) {
   // If the resolution fails in the TRR channel then we'll have a failed
   // aChannelStatus. Otherwise, we parse the response - if it's not a valid DNS
   // packet or doesn't contain the correct responses aLookupStatus will be a
   // failure code.
   if (aChannelStatus == NS_OK) {
     // Return + if confirmation was OK, or - if confirmation failed
     return aLookupStatus == NS_OK ? '+' : '-';
--- a/netwerk/dns/TRRService.h
+++ b/netwerk/dns/TRRService.h
@@ -182,19 +182,20 @@ class TRRService : public TRRServiceBase
     CONFIRM_OFF = 0,
     CONFIRM_TRYING_OK = 1,
     CONFIRM_OK = 2,
     CONFIRM_FAILED = 3,
     CONFIRM_TRYING_FAILED = 4,
     CONFIRM_DISABLED = 5,
   };
 
-  class ConfirmationContext final : public nsITimerCallback {
+  class ConfirmationContext final : public nsITimerCallback, public nsINamed {
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_NSITIMERCALLBACK
+    NS_DECL_NSINAMED
 
    private:
     static const size_t RESULTS_SIZE = 32;
 
     RefPtr<TRR> mTask;
     nsCOMPtr<nsITimer> mTimer;
     uint32_t mRetryInterval = 125;  // milliseconds until retry
     // The number of TRR requests that failed in a row.
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5347,16 +5347,17 @@ NS_INTERFACE_MAP_BEGIN(nsHttpChannel)
   NS_INTERFACE_MAP_ENTRY(nsIAsyncVerifyRedirectCallback)
   NS_INTERFACE_MAP_ENTRY(nsIThreadRetargetableRequest)
   NS_INTERFACE_MAP_ENTRY(nsIThreadRetargetableStreamListener)
   NS_INTERFACE_MAP_ENTRY(nsIDNSListener)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY(nsICorsPreflightCallback)
   NS_INTERFACE_MAP_ENTRY(nsIRaceCacheWithNetwork)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
   NS_INTERFACE_MAP_ENTRY(nsIRequestTailUnblockCallback)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(nsHttpChannel)
 NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsIRequest
 //-----------------------------------------------------------------------------
 
@@ -5483,17 +5484,18 @@ nsresult nsHttpChannel::CancelInternal(n
       !!LoadChannelClassifierCancellationPending();
   if (UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(status)) {
     StoreChannelClassifierCancellationPending(0);
   }
 
   mCanceled = true;
   mStatus = NS_FAILED(status) ? status : NS_ERROR_ABORT;
 
-  if (mLastStatusReported && !mEndMarkerAdded && profiler_can_accept_markers()) {
+  if (mLastStatusReported && !mEndMarkerAdded &&
+      profiler_can_accept_markers()) {
     // These do allocations/frees/etc; avoid if not active
     // mLastStatusReported can be null if Cancel is called before we added the
     // start marker.
     mEndMarkerAdded = true;
 
     nsAutoCString requestMethod;
     GetRequestMethod(requestMethod);
 
@@ -5802,18 +5804,17 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
   AsyncOpenFinal(TimeStamp::Now());
 
   return NS_OK;
 }
 
 void nsHttpChannel::AsyncOpenFinal(TimeStamp aTimeStamp) {
   // We save this timestamp from outside of the if block in case we enable the
   // profiler after AsyncOpen().
-  mLastStatusReported =
-    TimeStamp::Now();
+  mLastStatusReported = TimeStamp::Now();
   if (profiler_can_accept_markers()) {
     nsAutoCString requestMethod;
     GetRequestMethod(requestMethod);
 
     profiler_add_network_marker(
         mURI, requestMethod, mPriority, mChannelId, NetworkLoadType::LOAD_START,
         mChannelCreationTimestamp, mLastStatusReported, 0, mCacheDisposition,
         mLoadInfo->GetInnerWindowID());
@@ -9086,16 +9087,22 @@ void nsHttpChannel::MaybeRaceCacheWithNe
 
 NS_IMETHODIMP
 nsHttpChannel::Test_triggerNetwork(int32_t aTimeout) {
   MOZ_ASSERT(NS_IsMainThread(), "Must be called on the main thread");
   return TriggerNetworkWithDelay(aTimeout);
 }
 
 NS_IMETHODIMP
+nsHttpChannel::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsHttpChannel");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsHttpChannel::Notify(nsITimer* aTimer) {
   RefPtr<nsHttpChannel> self(this);
   if (aTimer == mCacheOpenTimer) {
     return Test_triggerDelayedOpenCacheEntry();
   }
   if (aTimer == mNetworkTriggerTimer) {
     return TriggerNetwork();
   }
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -70,17 +70,18 @@ class nsHttpChannel final : public HttpB
                             public nsIAsyncVerifyRedirectCallback,
                             public nsIThreadRetargetableRequest,
                             public nsIThreadRetargetableStreamListener,
                             public nsIDNSListener,
                             public nsSupportsWeakReference,
                             public nsICorsPreflightCallback,
                             public nsIRaceCacheWithNetwork,
                             public nsIRequestTailUnblockCallback,
-                            public nsITimerCallback {
+                            public nsITimerCallback,
+                            public nsINamed {
  public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
   NS_DECL_NSICACHEINFOCHANNEL
   NS_DECL_NSICACHINGCHANNEL
   NS_DECL_NSICACHEENTRYOPENCALLBACK
@@ -88,16 +89,17 @@ class nsHttpChannel final : public HttpB
   NS_DECL_NSIPROTOCOLPROXYCALLBACK
   NS_DECL_NSIPROXIEDCHANNEL
   NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
   NS_DECL_NSITHREADRETARGETABLEREQUEST
   NS_DECL_NSIDNSLISTENER
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTPCHANNEL_IID)
   NS_DECL_NSIRACECACHEWITHNETWORK
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_NSIREQUESTTAILUNBLOCKCALLBACK
 
   // nsIHttpAuthenticableChannel. We can't use
   // NS_DECL_NSIHTTPAUTHENTICABLECHANNEL because it duplicates cancel() and
   // others.
   NS_IMETHOD GetIsSSL(bool* aIsSSL) override;
   NS_IMETHOD GetProxyMethodIsConnect(bool* aProxyMethodIsConnect) override;
   NS_IMETHOD GetServerResponseHeader(
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -44,17 +44,17 @@
 #include "HttpConnectionUDP.h"
 #include "SpeculativeTransaction.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 
-NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver)
+NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver, nsINamed)
 
 //-----------------------------------------------------------------------------
 
 nsHttpConnectionMgr::nsHttpConnectionMgr() {
   LOG(("Creating nsHttpConnectionMgr @%p\n", this));
 }
 
 nsHttpConnectionMgr::~nsHttpConnectionMgr() {
@@ -246,16 +246,26 @@ void nsHttpConnectionMgr::ConditionallyS
 
   LOG(("nsHttpConnectionMgr::ConditionallyStopTimeoutTick stop==true\n"));
 
   mTimeoutTick->Cancel();
   mTimeoutTickArmed = false;
 }
 
 //-----------------------------------------------------------------------------
+// nsHttpConnectionMgr::nsINamed
+//-----------------------------------------------------------------------------
+
+NS_IMETHODIMP
+nsHttpConnectionMgr::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsHttpConnectionMgr");
+  return NS_OK;
+}
+
+//-----------------------------------------------------------------------------
 // nsHttpConnectionMgr::nsIObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsHttpConnectionMgr::Observe(nsISupports* subject, const char* topic,
                              const char16_t* data) {
   LOG(("nsHttpConnectionMgr::Observe [topic=\"%s\"]\n", topic));
 
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -35,21 +35,23 @@ struct HttpRetParams;
 
 //-----------------------------------------------------------------------------
 
 // message handlers have this signature
 class nsHttpConnectionMgr;
 using nsConnEventHandler = void (nsHttpConnectionMgr::*)(int32_t, ARefBase*);
 
 class nsHttpConnectionMgr final : public HttpConnectionMgrShell,
-                                  public nsIObserver {
+                                  public nsIObserver,
+                                  nsINamed {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_HTTPCONNECTIONMGRSHELL
   NS_DECL_NSIOBSERVER
+  NS_DECL_NSINAMED
 
   //-------------------------------------------------------------------------
   // NOTE: functions below may only be called on the main thread.
   //-------------------------------------------------------------------------
 
   nsHttpConnectionMgr();
 
   //-------------------------------------------------------------------------
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -2762,17 +2762,17 @@ nsHttpTransaction::Release() {
     // thread (we could be holding the last reference to our consumer).
     DeleteSelfOnConsumerThread();
     return 0;
   }
   return count;
 }
 
 NS_IMPL_QUERY_INTERFACE(nsHttpTransaction, nsIInputStreamCallback,
-                        nsIOutputStreamCallback, nsITimerCallback)
+                        nsIOutputStreamCallback, nsITimerCallback, nsINamed)
 
 //-----------------------------------------------------------------------------
 // nsHttpTransaction::nsIInputStreamCallback
 //-----------------------------------------------------------------------------
 
 // called on the socket thread
 NS_IMETHODIMP
 nsHttpTransaction::OnInputStreamReady(nsIAsyncInputStream* out) {
@@ -3324,16 +3324,22 @@ nsHttpTransaction::Notify(nsITimer* aTim
     OnFastFallbackTimer();
   } else if (aTimer == mHttp3BackupTimer) {
     OnHttp3BackupTimer();
   }
 
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsHttpTransaction::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsHttpTransaction");
+  return NS_OK;
+}
+
 bool nsHttpTransaction::GetSupportsHTTP3() { return mSupportsHTTP3; }
 
 const int64_t TELEMETRY_REQUEST_SIZE_10M = (int64_t)10 * (int64_t)(1 << 20);
 const int64_t TELEMETRY_REQUEST_SIZE_50M = (int64_t)50 * (int64_t)(1 << 20);
 const int64_t TELEMETRY_REQUEST_SIZE_100M = (int64_t)100 * (int64_t)(1 << 20);
 
 void nsHttpTransaction::CollectTelemetryForUploads() {
   if ((mHttpVersion != HttpVersion::v3_0) && !mSupportsHTTP3) {
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -51,24 +51,26 @@ class SpdyConnectTransaction;
 //-----------------------------------------------------------------------------
 
 class nsHttpTransaction final : public nsAHttpTransaction,
                                 public HttpTransactionShell,
                                 public ATokenBucketEvent,
                                 public nsIInputStreamCallback,
                                 public nsIOutputStreamCallback,
                                 public ARefBase,
-                                public nsITimerCallback {
+                                public nsITimerCallback,
+                                public nsINamed {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSAHTTPTRANSACTION
   NS_DECL_HTTPTRANSACTIONSHELL
   NS_DECL_NSIINPUTSTREAMCALLBACK
   NS_DECL_NSIOUTPUTSTREAMCALLBACK
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   nsHttpTransaction();
 
   void OnActivated() override;
 
   // attributes
   nsHttpResponseHead* ResponseHead() {
     return mHaveAllHeaders ? mResponseHead : nullptr;
--- a/netwerk/system/mac/nsNetworkLinkService.h
+++ b/netwerk/system/mac/nsNetworkLinkService.h
@@ -15,22 +15,24 @@
 #include <netinet/in.h>
 #include <SystemConfiguration/SCNetworkReachability.h>
 #include <SystemConfiguration/SystemConfiguration.h>
 
 using prefix_and_netmask = std::pair<in6_addr, in6_addr>;
 
 class nsNetworkLinkService : public nsINetworkLinkService,
                              public nsIObserver,
-                             public nsITimerCallback {
+                             public nsITimerCallback,
+                             public nsINamed {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSINETWORKLINKSERVICE
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   nsNetworkLinkService();
 
   nsresult Init();
   nsresult Shutdown();
 
   static void HashSortedPrefixesAndNetmasks(
       std::vector<prefix_and_netmask> prefixAndNetmaskStore,
--- a/netwerk/system/mac/nsNetworkLinkService.mm
+++ b/netwerk/system/mac/nsNetworkLinkService.mm
@@ -80,17 +80,18 @@ static OSStatus getErrorCodePtr(const vo
 static void CFReleaseSafe(CFTypeRef cf) {
   if (cf) {
     // "If cf is NULL, this will cause a runtime error and your
     // application will crash." / Apple docs
     ::CFRelease(cf);
   }
 }
 
-NS_IMPL_ISUPPORTS(nsNetworkLinkService, nsINetworkLinkService, nsIObserver, nsITimerCallback)
+NS_IMPL_ISUPPORTS(nsNetworkLinkService, nsINetworkLinkService, nsIObserver, nsITimerCallback,
+                  nsINamed)
 
 nsNetworkLinkService::nsNetworkLinkService()
     : mLinkUp(true),
       mStatusKnown(false),
       mReachability(nullptr),
       mCFRunLoop(nullptr),
       mRunLoopSource(nullptr),
       mStoreRef(nullptr),
@@ -577,16 +578,22 @@ NS_IMETHODIMP
 nsNetworkLinkService::Notify(nsITimer* aTimer) {
   MOZ_ASSERT(aTimer == mNetworkIdTimer);
 
   mNetworkIdTimer = nullptr;
   calculateNetworkIdWithDelay(0);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsNetworkLinkService::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsNetworkLinkService");
+  return NS_OK;
+}
+
 void nsNetworkLinkService::calculateNetworkIdInternal(void) {
   MOZ_ASSERT(!NS_IsMainThread(), "Should not be called on the main thread");
   SHA1Sum sha1;
   bool idChanged = false;
   bool found4 = IPv4NetworkId(&sha1);
   bool found6 = IPv6NetworkId(&sha1);
 
   if (found4 || found6) {
--- a/netwerk/test/gtest/TestUDPSocket.cpp
+++ b/netwerk/test/gtest/TestUDPSocket.cpp
@@ -189,47 +189,54 @@ NS_IMETHODIMP
 UDPServerListener::OnStopListening(nsIUDPSocket*, nsresult) {
   mWaiter->Notify();
   return NS_OK;
 }
 
 /**
  * Multicast timer callback: detects delivery failure
  */
-class MulticastTimerCallback : public nsITimerCallback {
+class MulticastTimerCallback : public nsITimerCallback, public nsINamed {
  protected:
   virtual ~MulticastTimerCallback();
 
  public:
   explicit MulticastTimerCallback(WaitForCondition* waiter)
       : mResult(NS_ERROR_NOT_INITIALIZED), mWaiter(waiter) {}
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   nsresult mResult;
   RefPtr<WaitForCondition> mWaiter;
 };
 
-NS_IMPL_ISUPPORTS(MulticastTimerCallback, nsITimerCallback)
+NS_IMPL_ISUPPORTS(MulticastTimerCallback, nsITimerCallback, nsINamed)
 
 MulticastTimerCallback::~MulticastTimerCallback() = default;
 
 NS_IMETHODIMP
 MulticastTimerCallback::Notify(nsITimer* timer) {
   if (TEST_MULTICAST != phase) {
     return NS_OK;
   }
   // Multicast ping failed
   printf("Multicast ping timeout expired\n");
   mResult = NS_ERROR_FAILURE;
   mWaiter->Notify();
   return NS_OK;
 }
 
+NS_IMETHODIMP
+MulticastTimerCallback::GetName(nsACString& aName) {
+  aName.AssignLiteral("MulticastTimerCallback");
+  return NS_OK;
+}
+
 /**** Main ****/
 
 TEST(TestUDPSocket, TestUDPSocketMain)
 {
   nsresult rv;
 
   // Create UDPSocket
   nsCOMPtr<nsIUDPSocket> server, client;
--- a/toolkit/components/reputationservice/ApplicationReputation.cpp
+++ b/toolkit/components/reputationservice/ApplicationReputation.cpp
@@ -583,23 +583,25 @@ using Reason = mozilla::Telemetry::LABEL
 class PendingDBLookup;
 
 // A single use class private to ApplicationReputationService encapsulating an
 // nsIApplicationReputationQuery and an nsIApplicationReputationCallback. Once
 // created by ApplicationReputationService, it is guaranteed to call mCallback.
 // This class is private to ApplicationReputationService.
 class PendingLookup final : public nsIStreamListener,
                             public nsITimerCallback,
+                            public nsINamed,
                             public nsIObserver,
                             public nsSupportsWeakReference {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_NSIOBSERVER
 
   // Constructor and destructor.
   PendingLookup(nsIApplicationReputationQuery* aQuery,
                 nsIApplicationReputationCallback* aCallback);
 
   // Start the lookup. The lookup may have 2 parts: local and remote. In the
   // local lookup, PendingDBLookups are created to query the local allow and
@@ -871,17 +873,18 @@ PendingDBLookup::HandleEvent(const nsACS
   }
 
   LOG(("Didn't find principal %s on any list [this = %p]", mSpec.get(), this));
   Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, NO_LIST);
   return mPendingLookup->LookupNext();
 }
 
 NS_IMPL_ISUPPORTS(PendingLookup, nsIStreamListener, nsIRequestObserver,
-                  nsIObserver, nsISupportsWeakReference, nsITimerCallback)
+                  nsIObserver, nsISupportsWeakReference, nsITimerCallback,
+                  nsINamed)
 
 PendingLookup::PendingLookup(nsIApplicationReputationQuery* aQuery,
                              nsIApplicationReputationCallback* aCallback)
     : mIsBinaryFile(false),
       mBlocklistCount(0),
       mAllowlistCount(0),
       mQuery(aQuery),
       mCallback(aCallback) {
@@ -1704,16 +1707,22 @@ PendingLookup::Notify(nsITimer* aTimer) 
   MOZ_ASSERT(aTimer == mTimeoutTimer);
   Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT,
              true);
   mChannel->Cancel(NS_ERROR_NET_TIMEOUT_EXTERNAL);
   mTimeoutTimer->Cancel();
   return NS_OK;
 }
 
+NS_IMETHODIMP
+PendingLookup::GetName(nsACString& aName) {
+  aName.AssignLiteral("PendingLookup");
+  return NS_OK;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 // nsIObserver implementation
 NS_IMETHODIMP
 PendingLookup::Observe(nsISupports* aSubject, const char* aTopic,
                        const char16_t* aData) {
   if (!strcmp(aTopic, "quit-application")) {
     if (mTimeoutTimer) {
       mTimeoutTimer->Cancel();
--- a/toolkit/components/sessionstore/SessionStoreDataCollector.cpp
+++ b/toolkit/components/sessionstore/SessionStoreDataCollector.cpp
@@ -19,23 +19,30 @@
 #include "nsGenericHTMLElement.h"
 
 namespace mozilla::dom {
 
 NS_IMPL_CYCLE_COLLECTION(SessionStoreDataCollector, mWindowChild, mTimer)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SessionStoreDataCollector)
   NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(SessionStoreDataCollector)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SessionStoreDataCollector)
 
 NS_IMETHODIMP
+SessionStoreDataCollector::GetName(nsACString& aName) {
+  aName.AssignLiteral("SessionStoreDataCollector");
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 SessionStoreDataCollector::Notify(nsITimer* aTimer) {
   Collect();
   return NS_OK;
 }
 
 /* static */ already_AddRefed<SessionStoreDataCollector>
 SessionStoreDataCollector::CollectSessionStoreData(
     WindowGlobalChild* aWindowChild) {
--- a/toolkit/components/sessionstore/SessionStoreDataCollector.h
+++ b/toolkit/components/sessionstore/SessionStoreDataCollector.h
@@ -20,21 +20,24 @@ namespace mozilla::dom {
 class BrowserChild;
 class EventTarget;
 class WindowGlobalChild;
 
 namespace sessionstore {
 class FormData;
 }
 
-class SessionStoreDataCollector final : public nsITimerCallback {
+class SessionStoreDataCollector final : public nsITimerCallback,
+                                        public nsINamed {
  public:
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(SessionStoreDataCollector)
+  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(SessionStoreDataCollector,
+                                           nsITimerCallback)
 
   enum class Change { Input, Scroll };
 
   static already_AddRefed<SessionStoreDataCollector> CollectSessionStoreData(
       WindowGlobalChild* aWindowChild);
 
   void RecordInputChange();
   void RecordScrollChange();
--- a/toolkit/components/viaduct/ViaductRequest.cpp
+++ b/toolkit/components/viaduct/ViaductRequest.cpp
@@ -210,17 +210,17 @@ ViaductRequest::~ViaductRequest() {
   ClearTimers();
   if (mChannel) {
     mChannel->Cancel(NS_ERROR_ABORT);
     mChannel = nullptr;
   }
   NotifyMonitor();
 }
 
-NS_IMPL_ISUPPORTS(ViaductRequest, nsIStreamListener, nsITimerCallback,
+NS_IMPL_ISUPPORTS(ViaductRequest, nsIStreamListener, nsITimerCallback, nsINamed,
                   nsIChannelEventSink)
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsIStreamListener implementation
 
 NS_IMETHODIMP
 ViaductRequest::OnStartRequest(nsIRequest* aRequest) {
   if (mConnectTimeoutTimer) {
@@ -315,9 +315,18 @@ ViaductRequest::Notify(nsITimer* timer) 
   // Cancelling the channel will trigger OnStopRequest.
   if (mChannel) {
     mChannel->Cancel(NS_ERROR_ABORT);
     mChannel = nullptr;
   }
   return NS_OK;
 }
 
+///////////////////////////////////////////////////////////////////////////////
+// nsINamed implementation
+
+NS_IMETHODIMP
+ViaductRequest::GetName(nsACString& aName) {
+  aName.AssignLiteral("ViaductRequest");
+  return NS_OK;
+}
+
 };  // namespace mozilla
--- a/toolkit/components/viaduct/ViaductRequest.h
+++ b/toolkit/components/viaduct/ViaductRequest.h
@@ -14,22 +14,24 @@
 #include "nsIChannelEventSink.h"
 #include "nsIStreamListener.h"
 #include "nsITimer.h"
 
 namespace mozilla {
 
 class ViaductRequest final : public nsIStreamListener,
                              public nsITimerCallback,
+                             public nsINamed,
                              public nsIChannelEventSink {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
   NS_DECL_NSICHANNELEVENTSINK
 
   ViaductRequest()
       : mDone(false), mChannel(nullptr), mMonitor("ViaductRequest") {}
   ViaductByteBuffer MakeRequest(ViaductByteBuffer reqBuf);
 
  private:
   nsresult LaunchRequest(appservices::httpconfig::protobuf::Request&);
--- a/uriloader/preload/PreloaderBase.cpp
+++ b/uriloader/preload/PreloaderBase.cpp
@@ -338,17 +338,17 @@ nsCString PreloaderBase::RedirectRecord:
 nsCString PreloaderBase::RedirectRecord::Fragment() const {
   nsCString fragment;
   mURI->GetRef(fragment);
   return fragment;
 }
 
 // PreloaderBase::UsageTimer
 
-NS_IMPL_ISUPPORTS(PreloaderBase::UsageTimer, nsITimerCallback)
+NS_IMPL_ISUPPORTS(PreloaderBase::UsageTimer, nsITimerCallback, nsINamed)
 
 NS_IMETHODIMP PreloaderBase::UsageTimer::Notify(nsITimer* aTimer) {
   if (!mPreload || !mDocument) {
     return NS_OK;
   }
 
   MOZ_ASSERT(aTimer == mPreload->mUsageTimer);
   mPreload->mUsageTimer = nullptr;
@@ -372,9 +372,15 @@ NS_IMETHODIMP PreloaderBase::UsageTimer:
   NS_GetSanitizedURIStringFromURI(uri, spec);
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, "DOM"_ns,
                                   mDocument, nsContentUtils::eDOM_PROPERTIES,
                                   "UnusedLinkPreloadPending",
                                   nsTArray<nsString>({std::move(spec)}));
   return NS_OK;
 }
 
+NS_IMETHODIMP
+PreloaderBase::UsageTimer::GetName(nsACString& aName) {
+  aName.AssignLiteral("PreloaderBase::UsageTimer");
+  return NS_OK;
+}
+
 }  // namespace mozilla
--- a/uriloader/preload/PreloaderBase.h
+++ b/uriloader/preload/PreloaderBase.h
@@ -146,19 +146,20 @@ class PreloaderBase : public SupportsWea
   // redirect happens, so that we can reprioritize or cancel when needed.
   // Having a separate class instead of implementing this on PreloaderBase
   // directly is to keep PreloaderBase as simple as possible so that derived
   // classes don't have to deal with calling super when implementing these
   // interfaces from some reason as well.
   class RedirectSink;
 
   // A timer callback to trigger the unuse warning for this preload
-  class UsageTimer final : public nsITimerCallback {
+  class UsageTimer final : public nsITimerCallback, public nsINamed {
     NS_DECL_ISUPPORTS
     NS_DECL_NSITIMERCALLBACK
+    NS_DECL_NSINAMED
 
     UsageTimer(PreloaderBase* aPreload, dom::Document* aDocument);
 
    private:
     ~UsageTimer() = default;
 
     WeakPtr<dom::Document> mDocument;
     WeakPtr<PreloaderBase> mPreload;
--- a/xpcom/base/AvailableMemoryWatcherWin.cpp
+++ b/xpcom/base/AvailableMemoryWatcherWin.cpp
@@ -25,21 +25,23 @@ namespace mozilla {
 // memory resource notification objects. When we enter a low memory scenario
 // the LowMemoryCallback() is invoked by Windows. This initial call triggers
 // an nsITimer that polls to see when the low memory condition has been lifted.
 // When it has, we'll stop polling and start waiting for the next
 // LowMemoryCallback(). Meanwhile, the polling may be stopped and restarted by
 // user-interaction events from the observer service.
 class nsAvailableMemoryWatcher final : public nsIObserver,
                                        public nsITimerCallback,
+                                       public nsINamed,
                                        public nsAvailableMemoryWatcherBase {
  public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
+  NS_DECL_NSINAMED
 
   nsAvailableMemoryWatcher();
   nsresult Init(uint32_t aPollingInterval);
 
  private:
   // Observer topics we subscribe to, see below.
   static const char* const kObserverTopics[];
 
@@ -94,17 +96,17 @@ const char* const nsAvailableMemoryWatch
     // Use this shutdown phase to make sure the instance is destroyed in GTest
     "xpcom-shutdown",
     "user-interaction-active",
     "user-interaction-inactive",
 };
 
 NS_IMPL_ISUPPORTS_INHERITED(nsAvailableMemoryWatcher,
                             nsAvailableMemoryWatcherBase, nsIObserver,
-                            nsITimerCallback)
+                            nsITimerCallback, nsINamed)
 
 nsAvailableMemoryWatcher::nsAvailableMemoryWatcher()
     : mMutex("low memory callback mutex"),
       mWaitHandle(nullptr),
       mPolling(false),
       mInteracting(false),
       mNeedToRestartTimerOnUserInteracting(false),
       mUnderMemoryPressure(false),
@@ -383,16 +385,22 @@ nsAvailableMemoryWatcher::Notify(nsITime
     OnLowMemory(lock);
   } else {
     OnHighMemory(lock);
   }
 
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsAvailableMemoryWatcher::GetName(nsACString& aName) {
+  aName.AssignLiteral("nsAvailableMemoryWatcher");
+  return NS_OK;
+}
+
 // Observer service callback, used to stop the polling timer when the user
 // stops interacting with Firefox and resuming it when they interact again.
 // Also used to shut down the service if the application is quitting.
 NS_IMETHODIMP
 nsAvailableMemoryWatcher::Observe(nsISupports* aSubject, const char* aTopic,
                                   const char16_t* aData) {
   MutexAutoLock lock(mMutex);
 
--- a/xpcom/threads/nsITimer.idl
+++ b/xpcom/threads/nsITimer.idl
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
+#include  "nsINamed.idl"
 
 interface nsIObserver;
 interface nsIEventTarget;
 
 %{C++
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/TimeStamp.h"
 #include <functional>
@@ -313,9 +314,17 @@ NS_NewTimerWithFuncCallback(nsTimerCallb
                             void* aClosure,
                             uint32_t aDelay,
                             uint32_t aType,
                             const char* aNameString,
                             nsIEventTarget* aTarget = nullptr);
 
 #define NS_TIMER_CONTRACTID "@mozilla.org/timer;1"
 #define NS_TIMER_CALLBACK_TOPIC "timer-callback"
+
+#undef NS_DECL_NSITIMERCALLBACK
+#define NS_DECL_NSITIMERCALLBACK                                        \
+  NS_IMETHOD Notify(nsITimer *timer) override;                          \
+  inline void _ensure_GetName_exists(void) {                            \
+    static_assert(std::is_convertible<decltype(this), nsINamed*>::value, \
+                  "nsITimerCallback implementations must also implement nsINamed");     \
+  }
 %}