Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
authorBevis Tseng <btseng@mozilla.com>
Wed, 26 Jul 2017 16:13:35 +0800
changeset 371337 0acc77eb92c6372cb73f441d2753c77068d87c2f
parent 371336 c6bc36c3b43c05b1f50f454a04b563a2cc6c1569
child 371338 4b879e41eae3aa845e77f6ce7336fb9eb4ed35fa
push id32241
push usercbook@mozilla.com
push dateThu, 27 Jul 2017 08:57:54 +0000
treeherdermozilla-central@e5693cea1ec9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1378930
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 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/shistory/nsSHEntryShared.cpp
dom/base/DispatcherTrait.cpp
dom/base/DispatcherTrait.h
dom/base/DocGroup.cpp
dom/base/DocGroup.h
dom/base/nsDocument.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsIDocument.h
dom/events/AsyncEventDispatcher.cpp
dom/events/DataTransferItem.cpp
dom/events/EventListenerService.cpp
dom/events/IMEContentObserver.cpp
dom/file/ipc/IPCBlobInputStreamThread.cpp
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLTrackElement.cpp
dom/html/TextTrackManager.cpp
dom/indexedDB/ScriptErrorHelper.cpp
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/media/FileBlockCache.cpp
dom/media/MediaCache.cpp
dom/media/MediaFormatReader.cpp
dom/media/MediaResource.cpp
dom/media/TextTrack.cpp
dom/media/TextTrackList.cpp
dom/media/VideoUtils.cpp
dom/media/gmp/GMPCrashHelper.cpp
dom/media/gmp/GMPServiceChild.cpp
dom/media/gtest/GMPTestMonitor.h
dom/media/gtest/TestGMPCrossOrigin.cpp
dom/media/imagecapture/CaptureTask.cpp
dom/media/mediasource/AutoTaskQueue.h
dom/media/ogg/OggDemuxer.cpp
dom/media/platforms/wmf/WMFAudioMFTManager.cpp
dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
dom/media/webaudio/MediaBufferDecoder.cpp
dom/media/webaudio/WebAudioUtils.cpp
dom/messagechannel/MessagePort.cpp
dom/notification/Notification.cpp
dom/promise/PromiseDebugging.cpp
dom/script/ScriptLoader.cpp
dom/smil/nsSMILTimedElement.cpp
dom/storage/Storage.cpp
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
dom/xml/nsXMLContentSink.cpp
editor/composer/nsEditorSpellCheck.cpp
gfx/layers/client/TextureClient.cpp
gfx/src/gfxCrashReporterUtils.cpp
ipc/mscom/Ptr.h
js/xpconnect/loader/ChromeScriptLoader.cpp
layout/base/PresShell.cpp
layout/base/ZoomConstraintsClient.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsPresContext.cpp
layout/base/nsRefreshDriver.cpp
layout/forms/nsTextControlFrame.cpp
layout/printing/nsPagePrintTimer.cpp
layout/printing/nsPrintEngine.cpp
layout/style/ErrorReporter.cpp
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/nsStyleStruct.cpp
layout/tables/nsTableFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsListBoxBodyFrame.cpp
layout/xul/nsMenuBarFrame.cpp
layout/xul/nsMenuFrame.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsXULPopupManager.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
modules/libpref/Preferences.cpp
netwerk/base/Predictor.cpp
netwerk/dns/DNSRequestChild.cpp
parser/html/nsHtml5StreamParser.cpp
parser/html/nsHtml5StreamParser.h
parser/html/nsHtml5StreamParserPtr.h
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsHtml5TreeOperation.cpp
tools/profiler/gecko/ThreadResponsiveness.cpp
widget/PuppetWidget.cpp
xpcom/base/DebuggerOnGCRunnable.cpp
xpcom/base/nsConsoleService.cpp
xpcom/threads/BackgroundHangMonitor.cpp
xpcom/threads/SchedulerGroup.cpp
xpcom/threads/SchedulerGroup.h
xpcom/threads/SystemGroup.cpp
xpcom/threads/SystemGroup.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1765,38 +1765,36 @@ nsDocShell::FirePageHideNotificationInte
 
     // Now make sure our editor, if any, is detached before we go
     // any farther.
     DetachEditorFromWindow();
   }
 }
 
 nsresult
-nsDocShell::DispatchToTabGroup(const char* aName,
-                               TaskCategory aCategory,
+nsDocShell::DispatchToTabGroup(TaskCategory aCategory,
                                already_AddRefed<nsIRunnable>&& aRunnable)
 {
   // Hold the ref so we won't forget to release it.
   nsCOMPtr<nsIRunnable> runnable(aRunnable);
   nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
   if (!win) {
     // Window should only be unavailable after destroyed.
     MOZ_ASSERT(mIsBeingDestroyed);
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<mozilla::dom::TabGroup> tabGroup = win->TabGroup();
-  return tabGroup->Dispatch(aName, aCategory, runnable.forget());
+  return tabGroup->Dispatch(aCategory, runnable.forget());
 }
 
 NS_IMETHODIMP
 nsDocShell::DispatchLocationChangeEvent()
 {
   return DispatchToTabGroup(
-    "nsDocShell::FireDummyOnLocationChange",
     TaskCategory::Other,
     NewRunnableMethod("nsDocShell::FireDummyOnLocationChange",
                       this,
                       &nsDocShell::FireDummyOnLocationChange));
 }
 
 bool
 nsDocShell::MaybeInitTiming()
@@ -8589,18 +8587,17 @@ nsDocShell::RestorePresentation(nsISHEnt
   // implementations.
 
   // Revoke any pending restore (just in case)
   NS_ASSERTION(!mRestorePresentationEvent.IsPending(),
                "should only have one RestorePresentationEvent");
   mRestorePresentationEvent.Revoke();
 
   RefPtr<RestorePresentationEvent> evt = new RestorePresentationEvent(this);
-  nsresult rv = DispatchToTabGroup("nsDocShell::RestorePresentationEvent",
-                                   TaskCategory::Other,
+  nsresult rv = DispatchToTabGroup(TaskCategory::Other,
                                    RefPtr<RestorePresentationEvent>(evt).forget());
   if (NS_SUCCEEDED(rv)) {
     mRestorePresentationEvent = evt.get();
     // The rest of the restore processing will happen on our event
     // callback.
     *aRestoring = true;
   }
 
@@ -10261,18 +10258,17 @@ nsDocShell::InternalLoad(nsIURI* aURI,
       // Do this asynchronously
       nsCOMPtr<nsIRunnable> ev =
         new InternalLoadEvent(this, aURI, aOriginalURI, aResultPrincipalURI,
                               aLoadReplace, aReferrer, aReferrerPolicy,
                               aTriggeringPrincipal, principalToInherit,
                               aFlags, aTypeHint, aPostData, aHeadersData,
                               aLoadType, aSHEntry, aFirstParty, aSrcdoc,
                               aSourceDocShell, aBaseURI, false);
-      return DispatchToTabGroup("nsDocShell::InternalLoadEvent",
-                                TaskCategory::Other, ev.forget());
+      return DispatchToTabGroup(TaskCategory::Other, ev.forget());
     }
 
     // Just ignore this load attempt
     return NS_OK;
   }
 
   // If a source docshell has been passed, check to see if we are sandboxed
   // from it as the result of an iframe or CSP sandbox.
@@ -14163,18 +14159,17 @@ nsDocShell::OnLinkClick(nsIContent* aCon
   if (NS_FAILED(rv)) {
     target = aTargetSpec;
   }
 
   nsCOMPtr<nsIRunnable> ev =
     new OnLinkClickEvent(this, aContent, aURI, target.get(), aFileName,
                          aPostDataStream, aHeadersDataStream, noOpenerImplied,
                          aIsTrusted, aTriggeringPrincipal);
-  return DispatchToTabGroup("nsDocShell::OnLinkClickEvent",
-                            TaskCategory::UI, ev.forget());
+  return DispatchToTabGroup(TaskCategory::UI, ev.forget());
 }
 
 NS_IMETHODIMP
 nsDocShell::OnLinkClickSync(nsIContent* aContent,
                             nsIURI* aURI,
                             const char16_t* aTargetSpec,
                             const nsAString& aFileName,
                             nsIInputStream* aPostDataStream,
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -1085,18 +1085,17 @@ private:
   // Internal implementation of nsIDocShell::FirePageHideNotification.
   // If aSkipCheckingDynEntries is true, it will not try to remove dynamic
   // subframe entries. This is to avoid redundant RemoveDynEntries calls in all
   // children docshells.
   void FirePageHideNotificationInternal(bool aIsUnload,
                                         bool aSkipCheckingDynEntries);
 
   // Dispatch a runnable to the TabGroup associated to this docshell.
-  nsresult DispatchToTabGroup(const char* aName,
-                              mozilla::TaskCategory aCategory,
+  nsresult DispatchToTabGroup(mozilla::TaskCategory aCategory,
                               already_AddRefed<nsIRunnable>&& aRunnable);
 
 #ifdef DEBUG
   // We're counting the number of |nsDocShells| to help find leaks
   static unsigned long gNumberOfDocShells;
 #endif /* DEBUG */
 
 public:
--- a/docshell/shistory/nsSHEntryShared.cpp
+++ b/docshell/shistory/nsSHEntryShared.cpp
@@ -210,18 +210,17 @@ nsSHEntryShared::RemoveFromBFCacheAsync(
 
   // Release the reference to the contentviewer asynchronously so that the
   // document doesn't get nuked mid-mutation.
 
   if (!mDocument) {
     return NS_ERROR_UNEXPECTED;
   }
   nsCOMPtr<nsIRunnable> evt = new DestroyViewerEvent(mContentViewer, mDocument);
-  nsresult rv = mDocument->Dispatch("nsSHEntryShared::DestroyViewerEvent",
-                                    mozilla::TaskCategory::Other, evt.forget());
+  nsresult rv = mDocument->Dispatch(mozilla::TaskCategory::Other, evt.forget());
   if (NS_FAILED(rv)) {
     NS_WARNING("failed to dispatch DestroyViewerEvent");
   } else {
     // Drop presentation. Only do this if we succeeded in posting the event
     // since otherwise the document could be torn down mid-mutation, causing
     // crashes.
     DropPresentationState();
   }
--- a/dom/base/DispatcherTrait.cpp
+++ b/dom/base/DispatcherTrait.cpp
@@ -9,21 +9,20 @@
 #include "mozilla/AbstractThread.h"
 #include "mozilla/SchedulerGroup.h"
 #include "nsINamed.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsresult
-DispatcherTrait::Dispatch(const char* aName,
-                          TaskCategory aCategory,
+DispatcherTrait::Dispatch(TaskCategory aCategory,
                           already_AddRefed<nsIRunnable>&& aRunnable)
 {
-  return SchedulerGroup::UnlabeledDispatch(aName, aCategory, Move(aRunnable));
+  return SchedulerGroup::UnlabeledDispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 DispatcherTrait::EventTargetFor(TaskCategory aCategory) const
 {
   return GetMainThreadSerialEventTarget();
 }
 
--- a/dom/base/DispatcherTrait.h
+++ b/dom/base/DispatcherTrait.h
@@ -21,18 +21,17 @@ class TabGroup;
 // This trait should be attached to classes like nsIGlobalObject and nsIDocument
 // that have a DocGroup or TabGroup attached to them. The methods here should
 // delegate to the DocGroup or TabGroup. We can't use the Dispatcher class
 // directly because it inherits from nsISupports.
 class DispatcherTrait {
 public:
   // This method may or may not be safe off of the main thread. For nsIDocument
   // it is safe. For nsIGlobalWindow it is not safe.
-  virtual nsresult Dispatch(const char* aName,
-                            TaskCategory aCategory,
+  virtual nsresult Dispatch(TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable);
 
   // This method may or may not be safe off of the main thread. For nsIDocument
   // it is safe. For nsIGlobalWindow it is not safe. The nsISerialEventTarget can
   // always be used off the main thread.
   virtual nsISerialEventTarget* EventTargetFor(TaskCategory aCategory) const;
 
   // Must be called on the main thread. The AbstractThread can always be used
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -51,21 +51,20 @@ DocGroup::~DocGroup()
     nsIEventTarget* target = EventTargetFor(TaskCategory::Other);
     NS_ProxyRelease("DocGroup::mReactionsStack", target, mReactionsStack.forget());
   }
 
   mTabGroup->mDocGroups.RemoveEntry(mKey);
 }
 
 nsresult
-DocGroup::Dispatch(const char* aName,
-                   TaskCategory aCategory,
+DocGroup::Dispatch(TaskCategory aCategory,
                    already_AddRefed<nsIRunnable>&& aRunnable)
 {
-  return mTabGroup->Dispatch(aName, aCategory, Move(aRunnable));
+  return mTabGroup->Dispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 DocGroup::EventTargetFor(TaskCategory aCategory) const
 {
   return mTabGroup->EventTargetFor(aCategory);
 }
 
--- a/dom/base/DocGroup.h
+++ b/dom/base/DocGroup.h
@@ -75,18 +75,17 @@ public:
     return mDocuments.begin();
   }
   Iterator end()
   {
     MOZ_ASSERT(NS_IsMainThread());
     return mDocuments.end();
   }
 
-  nsresult Dispatch(const char* aName,
-                    TaskCategory aCategory,
+  nsresult Dispatch(TaskCategory aCategory,
                     already_AddRefed<nsIRunnable>&& aRunnable);
 
   nsISerialEventTarget* EventTargetFor(TaskCategory aCategory) const;
 
   AbstractThread*
   AbstractMainThreadFor(TaskCategory aCategory);
 
   // Ensure that it's valid to access the DocGroup at this time.
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3045,25 +3045,24 @@ nsIDocument::GetDocGroup() const
     // XXX: Check that the TabGroup is correct as well!
   }
 #endif
 
   return mDocGroup;
 }
 
 nsresult
-nsIDocument::Dispatch(const char* aName,
-                      TaskCategory aCategory,
+nsIDocument::Dispatch(TaskCategory aCategory,
                       already_AddRefed<nsIRunnable>&& aRunnable)
 {
   // Note that this method may be called off the main thread.
   if (mDocGroup) {
-    return mDocGroup->Dispatch(aName, aCategory, Move(aRunnable));
-  }
-  return DispatcherTrait::Dispatch(aName, aCategory, Move(aRunnable));
+    return mDocGroup->Dispatch(aCategory, Move(aRunnable));
+  }
+  return DispatcherTrait::Dispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 nsIDocument::EventTargetFor(TaskCategory aCategory) const
 {
   if (mDocGroup) {
     return mDocGroup->EventTargetFor(aCategory);
   }
@@ -4454,18 +4453,17 @@ nsDocument::SetStyleSheetApplicableState
   if (!mSSApplicableStateNotificationPending) {
     MOZ_RELEASE_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIRunnable> notification =
       NewRunnableMethod("nsDocument::NotifyStyleSheetApplicableStateChanged",
                         this,
                         &nsDocument::NotifyStyleSheetApplicableStateChanged);
     mSSApplicableStateNotificationPending =
       NS_SUCCEEDED(
-        Dispatch("nsDocument::NotifyStyleSheetApplicableStateChanged",
-                 TaskCategory::Other, notification.forget()));
+        Dispatch(TaskCategory::Other, notification.forget()));
   }
 }
 
 void
 nsDocument::NotifyStyleSheetApplicableStateChanged()
 {
   mSSApplicableStateNotificationPending = false;
   nsCOMPtr<nsIObserverService> observerService =
@@ -5402,17 +5400,17 @@ nsDocument::UnblockDOMContentLoaded()
 
   MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
   if (!mSynchronousDOMContentLoaded) {
     MOZ_RELEASE_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsDocument::DispatchContentLoadedEvents",
                         this,
                         &nsDocument::DispatchContentLoadedEvents);
-    Dispatch("nsDocument::DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
+    Dispatch(TaskCategory::Other, ev.forget());
   } else {
     DispatchContentLoadedEvents();
   }
 }
 
 void
 nsDocument::ContentStateChanged(nsIContent* aContent, EventStates aStateMask)
 {
@@ -7042,18 +7040,17 @@ nsDocument::NotifyPossibleTitleChange(bo
   if (mPendingTitleChangeEvent.IsPending())
     return;
 
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   RefPtr<nsRunnableMethod<nsDocument, void, false>> event =
     NewNonOwningRunnableMethod("nsDocument::DoNotifyPossibleTitleChange",
                                this,
                                &nsDocument::DoNotifyPossibleTitleChange);
-  nsresult rv = Dispatch("nsDocument::DoNotifyPossibleTitleChange",
-                         TaskCategory::Other, do_AddRef(event));
+  nsresult rv = Dispatch(TaskCategory::Other, do_AddRef(event));
   if (NS_SUCCEEDED(rv)) {
     mPendingTitleChangeEvent = Move(event);
   }
 }
 
 void
 nsDocument::DoNotifyPossibleTitleChange()
 {
@@ -8889,17 +8886,17 @@ private:
 };
 
 void
 nsDocument::PostUnblockOnloadEvent()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIRunnable> evt = new nsUnblockOnloadEvent(this);
   nsresult rv =
-    Dispatch("nsUnblockOnloadEvent", TaskCategory::Other, evt.forget());
+    Dispatch(TaskCategory::Other, evt.forget());
   if (NS_SUCCEEDED(rv)) {
     // Stabilize block count so we don't post more events while this one is up
     ++mOnloadBlockCount;
   } else {
     NS_WARNING("failed to dispatch nsUnblockOnloadEvent");
   }
 }
 
@@ -9800,17 +9797,17 @@ void
 nsDocument::UnsuppressEventHandlingAndFireEvents(bool aFireEvents)
 {
   nsTArray<nsCOMPtr<nsIDocument>> documents;
   GetAndUnsuppressSubDocuments(this, &documents);
 
   if (aFireEvents) {
     MOZ_RELEASE_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIRunnable> ded = new nsDelayedEventDispatcher(documents);
-    Dispatch("nsDelayedEventDispatcher", TaskCategory::Other, ded.forget());
+    Dispatch(TaskCategory::Other, ded.forget());
   } else {
     FireOrClearDelayedEvents(documents, false);
   }
 }
 
 nsISupports*
 nsDocument::GetCurrentContentSink()
 {
@@ -10953,17 +10950,17 @@ private:
 };
 
 /* static */ void
 nsIDocument::AsyncExitFullscreen(nsIDocument* aDoc)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIRunnable> exit = new nsCallExitFullscreen(aDoc);
   if (aDoc) {
-    aDoc->Dispatch("nsCallExitFullscreen", TaskCategory::Other, exit.forget());
+    aDoc->Dispatch(TaskCategory::Other, exit.forget());
   } else {
     NS_DispatchToCurrentThread(exit.forget());
   }
 }
 
 static bool
 CountFullscreenSubDocuments(nsIDocument* aDoc, void* aData)
 {
@@ -11234,17 +11231,17 @@ nsDocument::AsyncRequestFullScreen(Uniqu
     MOZ_ASSERT_UNREACHABLE(
       "Must pass non-null element to nsDocument::AsyncRequestFullScreen");
     return;
   }
 
   // Request full-screen asynchronously.
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIRunnable> event = new nsCallRequestFullScreen(Move(aRequest));
-  Dispatch("nsCallRequestFullScreen", TaskCategory::Other, event.forget());
+  Dispatch(TaskCategory::Other, event.forget());
 }
 
 void
 nsIDocument::DispatchFullscreenError(const char* aMessage)
 {
   RefPtr<AsyncEventDispatcher> asyncDispatcher =
     new AsyncEventDispatcher(this,
                              NS_LITERAL_STRING("fullscreenerror"),
@@ -12111,17 +12108,17 @@ nsDocument::RequestPointerLock(Element* 
     DispatchPointerLockError(this, msg);
     return;
   }
 
   bool userInputOrSystemCaller = EventStateManager::IsHandlingUserInput() ||
                                  aCallerType == CallerType::System;
   nsCOMPtr<nsIRunnable> request =
     new PointerLockRequest(aElement, userInputOrSystemCaller);
-  Dispatch("PointerLockRequest", TaskCategory::Other, request.forget());
+  Dispatch(TaskCategory::Other, request.forget());
 }
 
 bool
 nsDocument::SetPointerLock(Element* aElement, int aCursorStyle)
 {
   MOZ_ASSERT(!aElement || aElement->OwnerDoc() == this,
              "We should be either unlocking pointer (aElement is nullptr), "
              "or locking pointer to an element in this document");
@@ -12296,17 +12293,17 @@ nsDocument::GetVisibilityState() const
 
 /* virtual */ void
 nsDocument::PostVisibilityUpdateEvent()
 {
   nsCOMPtr<nsIRunnable> event =
     NewRunnableMethod("nsDocument::UpdateVisibilityState",
                       this,
                       &nsDocument::UpdateVisibilityState);
-  Dispatch("nsDocument::UpdateVisibilityState", TaskCategory::Other, event.forget());
+  Dispatch(TaskCategory::Other, event.forget());
 }
 
 void
 nsDocument::MaybeActiveMediaComponents()
 {
   if (!mWindow) {
     return;
   }
@@ -12843,18 +12840,17 @@ nsDocument::ScheduleIntersectionObserver
   if (mIntersectionObservers.IsEmpty()) {
     return;
   }
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIRunnable> notification =
     NewRunnableMethod("nsDocument::NotifyIntersectionObservers",
                       this,
                       &nsDocument::NotifyIntersectionObservers);
-  Dispatch("nsDocument::IntersectionObserverNotification", TaskCategory::Other,
-           notification.forget());
+  Dispatch(TaskCategory::Other, notification.forget());
 }
 
 void
 nsDocument::NotifyIntersectionObservers()
 {
   nsTArray<RefPtr<DOMIntersectionObserver>> observers(mIntersectionObservers.Count());
   for (auto iter = mIntersectionObservers.Iter(); !iter.Done(); iter.Next()) {
     DOMIntersectionObserver* observer = iter.Get()->GetKey();
@@ -13135,18 +13131,17 @@ nsIDocument::RebuildUserFontSet()
   // which starts font loads, whose completion causes another style
   // change reflow).
   if (!mPostedFlushUserFontSet) {
     MOZ_RELEASE_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsIDocument::HandleRebuildUserFontSet",
                         this,
                         &nsIDocument::HandleRebuildUserFontSet);
-    if (NS_SUCCEEDED(Dispatch("nsIDocument::HandleRebuildUserFontSet",
-                              TaskCategory::Other, ev.forget()))) {
+    if (NS_SUCCEEDED(Dispatch(TaskCategory::Other, ev.forget()))) {
       mPostedFlushUserFontSet = true;
     }
   }
 }
 
 FontFaceSet*
 nsIDocument::Fonts()
 {
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9244,17 +9244,17 @@ nsGlobalWindow::PostMessageMozOuter(JSCo
   JS::Rooted<JS::Value> message(aCx, aMessage);
   JS::Rooted<JS::Value> transfer(aCx, aTransfer);
 
   event->Write(aCx, message, transfer, JS::CloneDataPolicy(), aError);
   if (NS_WARN_IF(aError.Failed())) {
     return;
   }
 
-  aError = Dispatch("PostMessageEvent", TaskCategory::Other, event.forget());
+  aError = Dispatch(TaskCategory::Other, event.forget());
 }
 
 void
 nsGlobalWindow::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
                                const nsAString& aTargetOrigin,
                                JS::Handle<JS::Value> aTransfer,
                                nsIPrincipal& aSubjectPrincipal,
                                ErrorResult& aError)
@@ -9296,17 +9296,17 @@ class nsCloseEvent : public Runnable {
   {}
 
 public:
 
   static nsresult
   PostCloseEvent(nsGlobalWindow* aWindow, bool aIndirect) {
     nsCOMPtr<nsIRunnable> ev = new nsCloseEvent(aWindow, aIndirect);
     nsresult rv =
-      aWindow->Dispatch("nsCloseEvent", TaskCategory::Other, ev.forget());
+      aWindow->Dispatch(TaskCategory::Other, ev.forget());
     if (NS_SUCCEEDED(rv))
       aWindow->MaybeForgiveSpamCount();
     return rv;
   }
 
   NS_IMETHOD Run() override {
     if (mWindow) {
       if (mIndirect) {
@@ -9827,18 +9827,17 @@ private:
   nsCString mTopic;
   nsWeakPtr mWindow;
 };
 
 void
 nsGlobalWindow::NotifyWindowIDDestroyed(const char* aTopic)
 {
   nsCOMPtr<nsIRunnable> runnable = new WindowDestroyedEvent(this, mWindowID, aTopic);
-  nsresult rv =
-    Dispatch("WindowDestroyedEvent", TaskCategory::Other, runnable.forget());
+  nsresult rv = Dispatch(TaskCategory::Other, runnable.forget());
   if (NS_SUCCEEDED(rv)) {
     mNotifiedIDDestroyed = true;
   }
 }
 
 // static
 void
 nsGlobalWindow::NotifyDOMWindowFrozen(nsGlobalWindow* aWindow) {
@@ -11096,17 +11095,17 @@ nsGlobalWindow::DispatchAsyncHashchange(
   rv = aNewURI->GetSpec(newSpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ConvertUTF8toUTF16 oldWideSpec(oldSpec);
   NS_ConvertUTF8toUTF16 newWideSpec(newSpec);
 
   nsCOMPtr<nsIRunnable> callback =
     new HashchangeCallback(oldWideSpec, newWideSpec, this);
-  return Dispatch("HashchangeCallback", TaskCategory::Other, callback.forget());
+  return Dispatch(TaskCategory::Other, callback.forget());
 }
 
 nsresult
 nsGlobalWindow::FireHashchange(const nsAString &aOldURL,
                                const nsAString &aNewURL)
 {
   MOZ_ASSERT(IsInnerWindow());
 
@@ -11696,18 +11695,17 @@ nsGlobalWindow::NotifyIdleObserver(IdleO
 {
   MOZ_ASSERT(aIdleObserverHolder);
   aIdleObserverHolder->mPrevNotificationIdle = aCallOnidle;
 
   nsCOMPtr<nsIRunnable> caller =
     new NotifyIdleObserverRunnable(aIdleObserverHolder->mIdleObserver,
                                    aIdleObserverHolder->mTimeInS,
                                    aCallOnidle, this);
-  if (NS_FAILED(Dispatch("NotifyIdleObserverRunnable", TaskCategory::Other,
-                         caller.forget()))) {
+  if (NS_FAILED(Dispatch(TaskCategory::Other, caller.forget()))) {
     NS_WARNING("Failed to dispatch thread for idle observer notification.");
   }
 }
 
 bool
 nsGlobalWindow::ContainsIdleObserver(nsIIdleObserver* aIdleObserver, uint32_t aTimeInS)
 {
   MOZ_ASSERT(aIdleObserver, "Idle observer not instantiated.");
@@ -12880,18 +12878,17 @@ public:
     MOZ_ASSERT(mWin);
     MOZ_ASSERT(mWin->IsOuterWindow());
   }
   ~AutoUnblockScriptClosing()
   {
     void (nsGlobalWindow::*run)() = &nsGlobalWindow::UnblockScriptedClosing;
     nsCOMPtr<nsIRunnable> caller = NewRunnableMethod(
       "AutoUnblockScriptClosing::~AutoUnblockScriptClosing", mWin, run);
-    mWin->Dispatch("nsGlobalWindow::UnblockScriptedClosing",
-                   TaskCategory::Other, caller.forget());
+    mWin->Dispatch(TaskCategory::Other, caller.forget());
   }
 };
 
 nsresult
 nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
                              const nsAString& aOptions, bool aDialog,
                              bool aContentModal, bool aCalledNoScript,
                              bool aDoJSFixups, bool aNavigate,
@@ -15384,25 +15381,24 @@ nsPIDOMWindow<T>::GetDocGroup() const
   nsIDocument* doc = GetExtantDoc();
   if (doc) {
     return doc->GetDocGroup();
   }
   return nullptr;
 }
 
 nsresult
-nsGlobalWindow::Dispatch(const char* aName,
-                         TaskCategory aCategory,
+nsGlobalWindow::Dispatch(TaskCategory aCategory,
                          already_AddRefed<nsIRunnable>&& aRunnable)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   if (GetDocGroup()) {
-    return GetDocGroup()->Dispatch(aName, aCategory, Move(aRunnable));
-  }
-  return DispatcherTrait::Dispatch(aName, aCategory, Move(aRunnable));
+    return GetDocGroup()->Dispatch(aCategory, Move(aRunnable));
+  }
+  return DispatcherTrait::Dispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 nsGlobalWindow::EventTargetFor(TaskCategory aCategory) const
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   if (GetDocGroup()) {
     return GetDocGroup()->EventTargetFor(aCategory);
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -1824,18 +1824,17 @@ private:
   mozilla::dom::TabGroup* TabGroupOuter();
 
   bool IsBackgroundInternal() const;
 
   void SetIsBackgroundInternal(bool aIsBackground);
 
 public:
   // Dispatch a runnable related to the global.
-  virtual nsresult Dispatch(const char* aName,
-                            mozilla::TaskCategory aCategory,
+  virtual nsresult Dispatch(mozilla::TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable) override;
 
   virtual nsISerialEventTarget*
   EventTargetFor(mozilla::TaskCategory aCategory) const override;
 
   virtual mozilla::AbstractThread*
   AbstractMainThreadFor(mozilla::TaskCategory aCategory) override;
 
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -2932,18 +2932,17 @@ public:
   virtual void RemoveIntersectionObserver(
     mozilla::dom::DOMIntersectionObserver* aObserver) = 0;
 
   virtual void UpdateIntersectionObservations() = 0;
   virtual void ScheduleIntersectionObserverNotification() = 0;
   virtual void NotifyIntersectionObservers() = 0;
 
   // Dispatch a runnable related to the document.
-  virtual nsresult Dispatch(const char* aName,
-                            mozilla::TaskCategory aCategory,
+  virtual nsresult Dispatch(mozilla::TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable) override;
 
   virtual nsISerialEventTarget*
   EventTargetFor(mozilla::TaskCategory aCategory) const override;
 
   virtual mozilla::AbstractThread*
   AbstractMainThreadFor(mozilla::TaskCategory aCategory) override;
 
--- a/dom/events/AsyncEventDispatcher.cpp
+++ b/dom/events/AsyncEventDispatcher.cpp
@@ -79,24 +79,24 @@ AsyncEventDispatcher::Cancel()
 }
 
 nsresult
 AsyncEventDispatcher::PostDOMEvent()
 {
   RefPtr<AsyncEventDispatcher> ensureDeletionWhenFailing = this;
   if (NS_IsMainThread()) {
     if (nsCOMPtr<nsIGlobalObject> global = mTarget->GetOwnerGlobal()) {
-      return global->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
+      return global->Dispatch(TaskCategory::Other, ensureDeletionWhenFailing.forget());
     }
 
     // Sometimes GetOwnerGlobal returns null because it uses
     // GetScriptHandlingObject rather than GetScopeObject.
     if (nsCOMPtr<nsINode> node = do_QueryInterface(mTarget)) {
       nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
-      return doc->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
+      return doc->Dispatch(TaskCategory::Other, ensureDeletionWhenFailing.forget());
     }
   }
   return NS_DispatchToCurrentThread(this);
 }
 
 void
 AsyncEventDispatcher::RunDOMEventWhenSafe()
 {
--- a/dom/events/DataTransferItem.cpp
+++ b/dom/events/DataTransferItem.cpp
@@ -473,17 +473,17 @@ DataTransferItem::GetAsString(FunctionSt
   if (parent && !global) {
     if (nsCOMPtr<dom::EventTarget> target = do_QueryInterface(parent)) {
       global = target->GetOwnerGlobal();
     } else if (nsCOMPtr<nsIDOMEvent> event = do_QueryInterface(parent)) {
       global = event->InternalDOMEvent()->GetParentObject();
     }
   }
   if (global) {
-    rv = global->Dispatch("GASRunnable", TaskCategory::Other, runnable.forget());
+    rv = global->Dispatch(TaskCategory::Other, runnable.forget());
   } else {
     rv = NS_DispatchToMainThread(runnable);
   }
   if (NS_FAILED(rv)) {
     NS_WARNING("Dispatch to main thread Failed in "
                "DataTransferItem::GetAsString!");
   }
 }
--- a/dom/events/EventListenerService.cpp
+++ b/dom/events/EventListenerService.cpp
@@ -366,20 +366,19 @@ EventListenerService::NotifyAboutMainThr
   }
 
   if (!mPendingListenerChanges) {
     mPendingListenerChanges = nsArrayBase::Create();
     nsCOMPtr<nsIRunnable> runnable =
       NewRunnableMethod("EventListenerService::NotifyPendingChanges",
                         this, &EventListenerService::NotifyPendingChanges);
     if (nsCOMPtr<nsIGlobalObject> global = aTarget->GetOwnerGlobal()) {
-      global->Dispatch(nullptr, TaskCategory::Other, runnable.forget());
+      global->Dispatch(TaskCategory::Other, runnable.forget());
     } else if (nsCOMPtr<nsINode> node = do_QueryInterface(aTarget)) {
-      node->OwnerDoc()->Dispatch(nullptr, TaskCategory::Other,
-                                 runnable.forget());
+      node->OwnerDoc()->Dispatch(TaskCategory::Other, runnable.forget());
     } else {
       NS_DispatchToCurrentThread(runnable);
     }
   }
 
   RefPtr<EventListenerChange> changes =
     mPendingListenerChangesSet.LookupForAdd(aTarget).OrInsert(
       [this, aTarget] () {
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -1843,17 +1843,17 @@ IMEContentObserver::IMENotificationSende
       }
     }
   }
 
   nsIScriptGlobalObject* globalObject =
     aDocShell ? aDocShell->GetScriptGlobalObject() : nullptr;
   if (globalObject) {
     RefPtr<IMENotificationSender> queuedSender = this;
-    globalObject->Dispatch(nullptr, TaskCategory::Other,
+    globalObject->Dispatch(TaskCategory::Other,
                            queuedSender.forget());
   } else {
     NS_DispatchToCurrentThread(this);
   }
 }
 
 NS_IMETHODIMP
 IMEContentObserver::IMENotificationSender::Run()
--- a/dom/file/ipc/IPCBlobInputStreamThread.cpp
+++ b/dom/file/ipc/IPCBlobInputStreamThread.cpp
@@ -121,19 +121,17 @@ IPCBlobInputStreamThread::GetOrCreate()
   return gIPCBlobThread;
 }
 
 void
 IPCBlobInputStreamThread::Initialize()
 {
   if (!NS_IsMainThread()) {
     RefPtr<Runnable> runnable = new ThreadInitializeRunnable();
-    SystemGroup::Dispatch("IPCBlobInputStreamThread::Initialize",
-                          TaskCategory::Other,
-                          runnable.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
     return;
   }
 
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (NS_WARN_IF(!obs)) {
     return;
   }
 
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -525,19 +525,17 @@ HTMLCanvasElement::DispatchPrintCallback
     NS_ENSURE_SUCCESS(rv, rv);
   }
   mPrintState = new HTMLCanvasPrintState(this, mCurrentContext, aCallback);
 
   RefPtr<nsRunnableMethod<HTMLCanvasElement>> renderEvent =
     NewRunnableMethod("dom::HTMLCanvasElement::CallPrintCallback",
                       this,
                       &HTMLCanvasElement::CallPrintCallback);
-  return OwnerDoc()->Dispatch("HTMLCanvasElement::CallPrintCallback",
-                              TaskCategory::Other,
-                              renderEvent.forget());
+  return OwnerDoc()->Dispatch(TaskCategory::Other, renderEvent.forget());
 }
 
 void
 HTMLCanvasElement::CallPrintCallback()
 {
   ErrorResult rv;
   GetMozPrintCallback()->Call(*mPrintState, rv);
 }
@@ -847,17 +845,16 @@ HTMLCanvasElement::ToBlob(JSContext* aCx
   MOZ_ASSERT(global);
 
   nsIntSize elemSize = GetWidthHeight();
   if (elemSize.width == 0 || elemSize.height == 0) {
     // According to spec, blob should return null if either its horizontal
     // dimension or its vertical dimension is zero. See link below.
     // https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-toblob
     OwnerDoc()->Dispatch(
-      "FireNullBlobEvent",
       TaskCategory::Other,
       NewRunnableMethod<Blob*, const char*>(
         "dom::HTMLCanvasElement::ToBlob",
         &aCallback,
         static_cast<void (BlobCallback::*)(Blob*, const char*)>(
           &BlobCallback::Call),
         nullptr,
         nullptr));
--- a/dom/html/HTMLTrackElement.cpp
+++ b/dom/html/HTMLTrackElement.cpp
@@ -440,18 +440,17 @@ HTMLTrackElement::DispatchTrackRunnable(
   if (!doc) {
     return;
   }
   nsCOMPtr<nsIRunnable> runnable = NewRunnableMethod<const nsString>(
     "dom::HTMLTrackElement::DispatchTrustedEvent",
     this,
     &HTMLTrackElement::DispatchTrustedEvent,
     aEventName);
-  doc->Dispatch("HTMLTrackElement::DispatchTrackRunnable",
-                TaskCategory::Other, runnable.forget());
+  doc->Dispatch(TaskCategory::Other, runnable.forget());
 }
 
 void
 HTMLTrackElement::DispatchTrustedEvent(const nsAString& aName)
 {
   nsIDocument* doc = OwnerDoc();
   if (!doc) {
     return;
--- a/dom/html/TextTrackManager.cpp
+++ b/dom/html/TextTrackManager.cpp
@@ -626,17 +626,16 @@ void
 TextTrackManager::DispatchUpdateCueDisplay()
 {
   if (!mUpdateCueDisplayDispatched && !mShutdown &&
       (mMediaElement->GetHasUserInteraction() || mMediaElement->IsCurrentlyPlaying())) {
     WEBVTT_LOG("DispatchUpdateCueDisplay");
     nsPIDOMWindowInner* win = mMediaElement->OwnerDoc()->GetInnerWindow();
     if (win) {
       nsGlobalWindow::Cast(win)->Dispatch(
-        "TextTrackManager::UpdateCueDisplay",
         TaskCategory::Other,
         NewRunnableMethod("dom::TextTrackManager::UpdateCueDisplay",
                           this,
                           &TextTrackManager::UpdateCueDisplay));
       mUpdateCueDisplayDispatched = true;
     }
   }
 }
@@ -649,17 +648,16 @@ TextTrackManager::DispatchTimeMarchesOn(
   // through its usual monotonic increase during normal playback; current
   // executing call upon completion will check queue for further 'work'.
   if (!mTimeMarchesOnDispatched && !mShutdown &&
       (mMediaElement->GetHasUserInteraction() || mMediaElement->IsCurrentlyPlaying())) {
     WEBVTT_LOG("DispatchTimeMarchesOn");
     nsPIDOMWindowInner* win = mMediaElement->OwnerDoc()->GetInnerWindow();
     if (win) {
       nsGlobalWindow::Cast(win)->Dispatch(
-        "TextTrackManager::TimeMarchesOn",
         TaskCategory::Other,
         NewRunnableMethod("dom::TextTrackManager::TimeMarchesOn",
                           this,
                           &TextTrackManager::TimeMarchesOn));
       mTimeMarchesOnDispatched = true;
     }
   }
 }
--- a/dom/indexedDB/ScriptErrorHelper.cpp
+++ b/dom/indexedDB/ScriptErrorHelper.cpp
@@ -209,19 +209,17 @@ ScriptErrorHelper::Dump(const nsAString&
       new ScriptErrorRunnable(aMessage,
                               aFilename,
                               aLineNumber,
                               aColumnNumber,
                               aSeverityFlag,
                               aIsChrome,
                               aInnerWindowID);
     MOZ_ALWAYS_SUCCEEDS(
-      SystemGroup::Dispatch("indexedDB::ScriptErrorHelper::Dump",
-                            TaskCategory::Other,
-                            runnable.forget()));
+      SystemGroup::Dispatch(TaskCategory::Other, runnable.forget()));
   }
 }
 
 /*static*/ void
 ScriptErrorHelper::DumpLocalizedMessage(const nsACString& aMessageName,
                                         const nsAString& aFilename,
                                         uint32_t aLineNumber,
                                         uint32_t aColumnNumber,
@@ -242,17 +240,15 @@ ScriptErrorHelper::DumpLocalizedMessage(
       new ScriptErrorRunnable(aMessageName,
                               aFilename,
                               aLineNumber,
                               aColumnNumber,
                               aSeverityFlag,
                               aIsChrome,
                               aInnerWindowID);
     MOZ_ALWAYS_SUCCEEDS(
-      SystemGroup::Dispatch("indexedDB::ScriptErrorHelper::DumpLocalizedMessage",
-                            TaskCategory::Other,
-                            runnable.forget()));
+      SystemGroup::Dispatch(TaskCategory::Other, runnable.forget()));
   }
 }
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -3539,24 +3539,23 @@ TabChildGlobal::GetPrincipal()
 JSObject*
 TabChildGlobal::GetGlobalJSObject()
 {
   NS_ENSURE_TRUE(mTabChild, nullptr);
   return mTabChild->GetGlobal();
 }
 
 nsresult
-TabChildGlobal::Dispatch(const char* aName,
-                         TaskCategory aCategory,
+TabChildGlobal::Dispatch(TaskCategory aCategory,
                          already_AddRefed<nsIRunnable>&& aRunnable)
 {
   if (mTabChild && mTabChild->TabGroup()) {
-    return mTabChild->TabGroup()->Dispatch(aName, aCategory, Move(aRunnable));
+    return mTabChild->TabGroup()->Dispatch(aCategory, Move(aRunnable));
   }
-  return DispatcherTrait::Dispatch(aName, aCategory, Move(aRunnable));
+  return DispatcherTrait::Dispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 TabChildGlobal::EventTargetFor(TaskCategory aCategory) const
 {
   if (mTabChild && mTabChild->TabGroup()) {
     return mTabChild->TabGroup()->EventTargetFor(aCategory);
   }
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -147,18 +147,17 @@ public:
   virtual JSObject* GetGlobalJSObject() override;
 
   virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override
   {
     MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
   }
 
   // Dispatch a runnable related to the global.
-  virtual nsresult Dispatch(const char* aName,
-                            mozilla::TaskCategory aCategory,
+  virtual nsresult Dispatch(mozilla::TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable) override;
 
   virtual nsISerialEventTarget*
   EventTargetFor(mozilla::TaskCategory aCategory) const override;
 
   virtual AbstractThread*
   AbstractMainThreadFor(mozilla::TaskCategory aCategory) override;
 
--- a/dom/media/FileBlockCache.cpp
+++ b/dom/media/FileBlockCache.cpp
@@ -201,18 +201,17 @@ FileBlockCache::Close()
                              // nsIThread::Shutdown()
                              // can cause events to run before it completes,
                              // which could end up
                              // opening more streams, while the media cache is
                              // shutting down and
                              // releasing memory etc!
                              nsCOMPtr<nsIRunnable> event =
                                new ShutdownThreadEvent(thread);
-                             SystemGroup::Dispatch("ShutdownThreadEvent",
-                                                   TaskCategory::Other,
+                             SystemGroup::Dispatch(TaskCategory::Other,
                                                    event.forget());
                            }),
     NS_DISPATCH_NORMAL);
   NS_ENSURE_SUCCESS_VOID(rv);
 }
 
 template<typename Container, typename Value>
 bool
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -1504,19 +1504,17 @@ MediaCache::QueueUpdate()
                "Queuing an update while we're in an update");
   if (mUpdateQueued)
     return;
   mUpdateQueued = true;
   // XXX MediaCache does updates when decoders are still running at
   // shutdown and get freed in the final cycle-collector cleanup.  So
   // don't leak a runnable in that case.
   nsCOMPtr<nsIRunnable> event = new UpdateEvent(this);
-  SystemGroup::Dispatch("MediaCache::UpdateEvent",
-                        TaskCategory::Other,
-                        event.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, event.forget());
 }
 
 void
 MediaCache::QueueSuspendedStatusUpdate(int64_t aResourceID)
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
   if (!mSuspendedStatusToNotify.Contains(aResourceID)) {
     mSuspendedStatusToNotify.AppendElement(aResourceID);
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -113,17 +113,16 @@ private:
   GlobalAllocPolicy& mPolicy; // reference to a singleton object.
 };
 
 GlobalAllocPolicy::GlobalAllocPolicy()
   : mMonitor("DecoderAllocPolicy::mMonitor")
   , mDecoderLimit(MediaPrefs::MediaDecoderLimit())
 {
   SystemGroup::Dispatch(
-    "GlobalAllocPolicy::ClearOnShutdown",
     TaskCategory::Other,
     NS_NewRunnableFunction("GlobalAllocPolicy::GlobalAllocPolicy", [this]() {
       ClearOnShutdown(this, ShutdownPhase::ShutdownThreads);
     }));
 }
 
 GlobalAllocPolicy::~GlobalAllocPolicy()
 {
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -59,17 +59,16 @@ void
 MediaResource::Destroy()
 {
   // Ensures we only delete the MediaResource on the main thread.
   if (NS_IsMainThread()) {
     delete this;
     return;
   }
   nsresult rv = SystemGroup::Dispatch(
-    "MediaResource::Destroy",
     TaskCategory::Other,
     NewNonOwningRunnableMethod(
       "MediaResource::Destroy", this, &MediaResource::Destroy));
   MOZ_ALWAYS_SUCCEEDS(rv);
 }
 
 NS_IMPL_ADDREF(MediaResource)
 NS_IMPL_RELEASE_WITH_DESTROY(MediaResource, Destroy())
--- a/dom/media/TextTrack.cpp
+++ b/dom/media/TextTrack.cpp
@@ -332,17 +332,16 @@ void
 TextTrack::DispatchAsyncTrustedEvent(const nsString& aEventName)
 {
   nsPIDOMWindowInner* win = GetOwner();
   if (!win) {
     return;
   }
   RefPtr<TextTrack> self = this;
   nsGlobalWindow::Cast(win)->Dispatch(
-    "TextTrack::DispatchAsyncTrustedEvent",
     TaskCategory::Other,
     NS_NewRunnableFunction(
       "dom::TextTrack::DispatchAsyncTrustedEvent",
       [self, aEventName]() { self->DispatchTrustedEvent(aEventName); }));
 }
 
 bool
 TextTrack::IsLoaded()
--- a/dom/media/TextTrackList.cpp
+++ b/dom/media/TextTrackList.cpp
@@ -188,19 +188,17 @@ TextTrackList::CreateAndDispatchChangeEv
 
     mPendingTextTrackChange = true;
     RefPtr<Event> event = NS_NewDOMEvent(this, nullptr, nullptr);
 
     event->InitEvent(NS_LITERAL_STRING("change"), false, false);
     event->SetTrusted(true);
 
     nsCOMPtr<nsIRunnable> eventRunner = new ChangeEventRunner(this, event);
-    nsGlobalWindow::Cast(win)->Dispatch(
-      "TextTrackList::CreateAndDispatchChangeEvent", TaskCategory::Other,
-      eventRunner.forget());
+    nsGlobalWindow::Cast(win)->Dispatch(TaskCategory::Other, eventRunner.forget());
   }
 }
 
 void
 TextTrackList::CreateAndDispatchTrackEventRunner(TextTrack* aTrack,
                                                  const nsAString& aEventName)
 {
   DebugOnly<nsresult> rv;
--- a/dom/media/VideoUtils.cpp
+++ b/dom/media/VideoUtils.cpp
@@ -392,17 +392,17 @@ SimpleTimer::Create(nsIRunnable* aTask, 
 
 void
 LogToBrowserConsole(const nsAString& aMsg)
 {
   if (!NS_IsMainThread()) {
     nsString msg(aMsg);
     nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction(
       "LogToBrowserConsole", [msg]() { LogToBrowserConsole(msg); });
-    SystemGroup::Dispatch("LogToBrowserConsole", TaskCategory::Other, task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
     return;
   }
   nsCOMPtr<nsIConsoleService> console(
     do_GetService("@mozilla.org/consoleservice;1"));
   if (!console) {
     NS_WARNING("Failed to log message to console.");
     return;
   }
--- a/dom/media/gmp/GMPCrashHelper.cpp
+++ b/dom/media/gmp/GMPCrashHelper.cpp
@@ -14,17 +14,16 @@ NS_IMPL_RELEASE_WITH_DESTROY(GMPCrashHel
 
 void
 GMPCrashHelper::Destroy()
 {
   if (NS_IsMainThread()) {
     delete this;
   } else {
     // Don't addref, as then we'd end up releasing after the detele runs!
-    SystemGroup::Dispatch("GMPCrashHelper::Destroy",
-                          TaskCategory::Other,
+    SystemGroup::Dispatch(TaskCategory::Other,
                           NewNonOwningRunnableMethod("GMPCrashHelper::Destroy",
                                                      this,
                                                      &GMPCrashHelper::Destroy));
   }
 }
 
 } // namespace mozilla
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -392,17 +392,17 @@ GeckoMediaPluginServiceChild::GetService
     if (!contentChild) {
       return GetServiceChildPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
     }
     MozPromiseHolder<GetServiceChildPromise>* holder = mGetServiceChildPromises.AppendElement();
     RefPtr<GetServiceChildPromise> promise = holder->Ensure(__func__);
     if (mGetServiceChildPromises.Length() == 1) {
       nsCOMPtr<nsIRunnable> r = WrapRunnable(
         contentChild, &dom::ContentChild::SendCreateGMPService);
-      SystemGroup::Dispatch("SendCreateGMPService", TaskCategory::Other, r.forget());
+      SystemGroup::Dispatch(TaskCategory::Other, r.forget());
     }
     return promise;
   }
   return GetServiceChildPromise::CreateAndResolve(mServiceChild.get(), __func__);
 }
 
 void
 GeckoMediaPluginServiceChild::SetServiceChild(UniquePtr<GMPServiceChild>&& aServiceChild)
--- a/dom/media/gtest/GMPTestMonitor.h
+++ b/dom/media/gtest/GMPTestMonitor.h
@@ -30,17 +30,16 @@ private:
     MOZ_ASSERT(NS_IsMainThread());
     mFinished = true;
   }
 
 public:
   void SetFinished()
   {
     mozilla::SystemGroup::Dispatch(
-      "GMPTestMonitor::SetFinished",
       mozilla::TaskCategory::Other,
       mozilla::NewNonOwningRunnableMethod(
         "GMPTestMonitor::MarkFinished", this, &GMPTestMonitor::MarkFinished));
   }
 
 private:
   bool mFinished;
 };
--- a/dom/media/gtest/TestGMPCrossOrigin.cpp
+++ b/dom/media/gtest/TestGMPCrossOrigin.cpp
@@ -423,17 +423,17 @@ private:
 NS_IMPL_ISUPPORTS(ClearGMPStorageTask, nsIRunnable, nsIObserver)
 
 static void
 ClearGMPStorage(already_AddRefed<nsIRunnable> aContinuation,
                 nsIThread* aTarget, PRTime aSince = -1)
 {
   RefPtr<ClearGMPStorageTask> task(
     new ClearGMPStorageTask(Move(aContinuation), aTarget, aSince));
-  SystemGroup::Dispatch("ClearGMPStorage", TaskCategory::Other, task.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, task.forget());
 }
 
 static void
 SimulatePBModeExit()
 {
   // SystemGroup::EventTargetFor() doesn't support NS_DISPATCH_SYNC.
   NS_DispatchToMainThread(new NotifyObserversTask("last-pb-context-exited"), NS_DISPATCH_SYNC);
 }
@@ -794,18 +794,17 @@ class GMPStorageTest : public GMPDecrypt
 
     UniquePtr<NodeInfo> siteInfo(
         new NodeInfo(NS_LITERAL_CSTRING("http://example1.com"),
                      pattern));
     // Collect nodeIds that are expected to remain for later comparison.
     EnumerateGMPStorageDir(NS_LITERAL_CSTRING("id"),
                            NodeIdCollector(siteInfo.get()));
     // Invoke "Forget this site" on the main thread.
-    SystemGroup::Dispatch("TestForgetThisSite_Forget",
-                          TaskCategory::Other,
+    SystemGroup::Dispatch(TaskCategory::Other,
                           NewRunnableMethod<UniquePtr<NodeInfo>&&>(
                             "GMPStorageTest::TestForgetThisSite_Forget",
                             this,
                             &GMPStorageTest::TestForgetThisSite_Forget,
                             Move(siteInfo)));
   }
 
   void TestForgetThisSite_Forget(UniquePtr<NodeInfo>&& aSiteInfo) {
@@ -1214,17 +1213,17 @@ class GMPStorageTest : public GMPDecrypt
       return;
     }
     EXPECT_FALSE(mNodeId.IsEmpty());
     RefPtr<GMPShutdownObserver> task(new GMPShutdownObserver(
       NewRunnableMethod(
         "GMPStorageTest::Shutdown", this, &GMPStorageTest::Shutdown),
       Move(aContinuation),
       mNodeId));
-    SystemGroup::Dispatch("GMPShutdownObserver", TaskCategory::Other, task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
   }
 
   void Shutdown() {
     if (mDecryptor) {
       mDecryptor->Close();
       mDecryptor = nullptr;
       mNodeId = EmptyCString();
     }
@@ -1233,17 +1232,17 @@ class GMPStorageTest : public GMPDecrypt
   void Dummy() {
   }
 
   void SetFinished() {
     mFinished = true;
     Shutdown();
     nsCOMPtr<nsIRunnable> task =
       NewRunnableMethod("GMPStorageTest::Dummy", this, &GMPStorageTest::Dummy);
-    SystemGroup::Dispatch("GMPStorageTest::Dummy", TaskCategory::Other, task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
   }
 
   void SessionMessage(const nsCString& aSessionId,
                       mozilla::dom::MediaKeyMessageType aMessageType,
                       const nsTArray<uint8_t>& aMessage) override
   {
     MonitorAutoLock mon(mMonitor);
 
--- a/dom/media/imagecapture/CaptureTask.cpp
+++ b/dom/media/imagecapture/CaptureTask.cpp
@@ -189,14 +189,12 @@ CaptureTask::PostTrackEndEvent()
     }
 
   protected:
     RefPtr<CaptureTask> mTask;
   };
 
   IC_LOG("Got MediaStream track removed or finished event.");
   nsCOMPtr<nsIRunnable> event = new TrackEndRunnable(this);
-  SystemGroup::Dispatch("CaptureTask::TaskComplete",
-                        TaskCategory::Other,
-                        event.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, event.forget());
 }
 
 } // namespace mozilla
--- a/dom/media/mediasource/AutoTaskQueue.h
+++ b/dom/media/mediasource/AutoTaskQueue.h
@@ -57,16 +57,16 @@ public:
 
 private:
   ~AutoTaskQueue()
   {
     RefPtr<TaskQueue> taskqueue = mTaskQueue;
     nsCOMPtr<nsIRunnable> task =
       NS_NewRunnableFunction("AutoTaskQueue::~AutoTaskQueue",
                              [taskqueue]() { taskqueue->BeginShutdown(); });
-    SystemGroup::Dispatch("~AutoTaskQueue", TaskCategory::Other, task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
   }
   RefPtr<TaskQueue> mTaskQueue;
 };
 
 } // namespace mozilla
 
 #endif
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -137,19 +137,17 @@ OggDemuxer::~OggDemuxer()
                 ("OggDemuxer(%p)::%s: Reporting telemetry "
                  "MEDIA_OGG_LOADED_IS_CHAINED=%d",
                  ptr,
                  __func__,
                  isChained));
         Telemetry::Accumulate(
           Telemetry::HistogramID::MEDIA_OGG_LOADED_IS_CHAINED, isChained);
       });
-    SystemGroup::Dispatch("~OggDemuxer::report_telemetry",
-                          TaskCategory::Other,
-                          task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
   }
 }
 
 void
 OggDemuxer::SetChainingEvents(TimedMetadataEventProducer* aMetadataEvent,
                               MediaEventProducer<void>* aOnSeekableEvent)
 {
   mTimedMetadataEvent = aMetadataEvent;
--- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
@@ -252,19 +252,17 @@ WMFAudioMFTManager::Output(int64_t aStre
 
   if (!sample) {
     LOG("Audio MFTDecoder returned success but null output.");
     nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction("WMFAudioMFTManager::Output",
                                                         []() -> void {
       LOG("Reporting telemetry AUDIO_MFT_OUTPUT_NULL_SAMPLES");
       Telemetry::Accumulate(Telemetry::HistogramID::AUDIO_MFT_OUTPUT_NULL_SAMPLES, 1);
     });
-    SystemGroup::Dispatch("WMFAudioMFTManager::Output()::report_telemetry",
-                          TaskCategory::Other,
-                          task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
     return E_FAIL;
   }
 
   RefPtr<IMFMediaBuffer> buffer;
   hr = sample->ConvertToContiguousBuffer(getter_AddRefs(buffer));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   BYTE* data = nullptr; // Note: *data will be owned by the IMFMediaBuffer, we
--- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
+++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
@@ -62,19 +62,17 @@ SendTelemetry(unsigned long hr)
   }
 
   nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction(
     "SendTelemetry",
     [sample] {
       Telemetry::Accumulate(Telemetry::MEDIA_WMF_DECODE_ERROR, sample);
     });
 
-  SystemGroup::Dispatch("WMFMediaDataDecoder::SendTelemetry",
-                        TaskCategory::Other,
-                        runnable.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
 }
 
 RefPtr<ShutdownPromise>
 WMFMediaDataDecoder::Shutdown()
 {
   MOZ_DIAGNOSTIC_ASSERT(!mIsShutDown);
 
   mIsShutDown = true;
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -88,17 +88,17 @@ public:
   }
 private:
   nsAutoPtr<T> mObject;
 };
 
 template<class T>
 void DeleteOnMainThread(nsAutoPtr<T>& aObject) {
   nsCOMPtr<nsIRunnable> r = new DeleteObjectTask<T>(aObject);
-  SystemGroup::Dispatch("VideoUtils::DeleteObjectTask", TaskCategory::Other, r.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, r.forget());
 }
 
 LayersBackend
 GetCompositorBackendType(layers::KnowsCompositor* aKnowsCompositor)
 {
   if (aKnowsCompositor) {
     return aKnowsCompositor->GetCompositorBackendType();
   }
@@ -155,19 +155,17 @@ WMFVideoMFTManager::~WMFVideoMFTManager(
   nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction("WMFVideoMFTManager::~WMFVideoMFTManager",
                                                       [=]() -> void {
     LOG(nsPrintfCString("Reporting telemetry VIDEO_MFT_OUTPUT_NULL_SAMPLES=%d",
                         telemetry)
         .get());
     Telemetry::Accumulate(Telemetry::HistogramID::VIDEO_MFT_OUTPUT_NULL_SAMPLES,
                           telemetry);
   });
-  SystemGroup::Dispatch("~WMFVideoMFTManager::report_telemetry",
-                        TaskCategory::Other,
-                        task.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, task.forget());
 }
 
 const GUID&
 WMFVideoMFTManager::GetMFTGUID()
 {
   MOZ_ASSERT(mStreamType != Unknown);
   switch (mStreamType) {
     case H264: return CLSID_CMSH264DecoderMFT;
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -264,19 +264,17 @@ MediaDecodeTask::OnMetadataRead(Metadata
   nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction(
     "MediaDecodeTask::OnMetadataRead", [codec]() -> void {
       MOZ_ASSERT(!codec.IsEmpty());
       MOZ_LOG(gMediaDecoderLog,
               LogLevel::Debug,
               ("Telemetry (WebAudio) MEDIA_CODEC_USED= '%s'", codec.get()));
       Telemetry::Accumulate(Telemetry::HistogramID::MEDIA_CODEC_USED, codec);
     });
-  SystemGroup::Dispatch("MediaDecodeTask::OnMetadataRead()::report_telemetry",
-                        TaskCategory::Other,
-                        task.forget());
+  SystemGroup::Dispatch(TaskCategory::Other, task.forget());
 
   RequestSample();
 }
 
 void
 MediaDecodeTask::OnMetadataNotRead(const MediaResult& aReason)
 {
   mDecoderReader->Shutdown();
--- a/dom/media/webaudio/WebAudioUtils.cpp
+++ b/dom/media/webaudio/WebAudioUtils.cpp
@@ -99,18 +99,17 @@ WebAudioUtils::LogToDeveloperConsole(uin
   // This implementation is derived from dom/media/VideoUtils.cpp, but we
   // use a windowID so that the message is delivered to the developer console.
   // It is similar to ContentUtils::ReportToConsole, but also works off main
   // thread.
   if (!NS_IsMainThread()) {
     nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction(
       "dom::WebAudioUtils::LogToDeveloperConsole",
       [aWindowID, aKey] { LogToDeveloperConsole(aWindowID, aKey); });
-    SystemGroup::Dispatch("dom::WebAudioUtils::LogToDeveloperConsole",
-        TaskCategory::Other, task.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, task.forget());
     return;
   }
 
   nsCOMPtr<nsIConsoleService> console(
     do_GetService("@mozilla.org/consoleservice;1"));
   if (!console) {
     NS_WARNING("Failed to log message to console.");
     return;
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -557,17 +557,17 @@ MessagePort::Dispatch()
 
   RefPtr<SharedMessagePortMessage> data = mMessages.ElementAt(0);
   mMessages.RemoveElementAt(0);
 
   mPostMessageRunnable = new PostMessageRunnable(this, data);
 
   nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal();
   if (NS_IsMainThread() && global) {
-    MOZ_ALWAYS_SUCCEEDS(global->Dispatch("MessagePortMessage", TaskCategory::Other, do_AddRef(mPostMessageRunnable)));
+    MOZ_ALWAYS_SUCCEEDS(global->Dispatch(TaskCategory::Other, do_AddRef(mPostMessageRunnable)));
     return;
   }
 
   MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(mPostMessageRunnable));
 }
 
 void
 MessagePort::Close()
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -221,17 +221,18 @@ public:
     rv = notificationStorage->Get(mOrigin, mTag, mCallback);
     //XXXnsm Is it guaranteed mCallback will be called in case of failure?
     Unused << NS_WARN_IF(NS_FAILED(rv));
     return rv;
   }
 };
 
 class NotificationPermissionRequest : public nsIContentPermissionRequest,
-                                      public nsIRunnable
+                                      public nsIRunnable,
+                                      public nsINamed
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSICONTENTPERMISSIONREQUEST
   NS_DECL_NSIRUNNABLE
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(NotificationPermissionRequest,
                                            nsIContentPermissionRequest)
 
@@ -242,16 +243,22 @@ public:
       mPermission(NotificationPermission::Default),
       mPromise(aPromise),
       mCallback(aCallback)
   {
     MOZ_ASSERT(aPromise);
     mRequester = new nsContentPermissionRequester(mWindow);
   }
 
+  NS_IMETHOD GetName(nsACString& aName) override
+  {
+    aName.AssignLiteral("NotificationPermissionRequest");
+    return NS_OK;
+  }
+
 protected:
   virtual ~NotificationPermissionRequest() {}
 
   nsresult ResolvePromise();
   nsresult DispatchResolvePromise();
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   NotificationPermission mPermission;
@@ -523,16 +530,17 @@ protected:
 uint32_t Notification::sCount = 0;
 
 NS_IMPL_CYCLE_COLLECTION(NotificationPermissionRequest, mWindow, mPromise,
                                                         mCallback)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NotificationPermissionRequest)
   NS_INTERFACE_MAP_ENTRY(nsIContentPermissionRequest)
   NS_INTERFACE_MAP_ENTRY(nsIRunnable)
+  NS_INTERFACE_MAP_ENTRY(nsINamed)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentPermissionRequest)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(NotificationPermissionRequest)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(NotificationPermissionRequest)
 
 NS_IMETHODIMP
 NotificationPermissionRequest::Run()
@@ -1792,18 +1800,17 @@ Notification::RequestPermission(const Gl
   }
   NotificationPermissionCallback* permissionCallback = nullptr;
   if (aCallback.WasPassed()) {
     permissionCallback = &aCallback.Value();
   }
   nsCOMPtr<nsIRunnable> request =
     new NotificationPermissionRequest(principal, window, promise, permissionCallback);
 
-  global->Dispatch("Notification::RequestPermission", TaskCategory::Other,
-                   request.forget());
+  global->Dispatch(TaskCategory::Other, request.forget());
 
   return promise.forget();
 }
 
 // static
 NotificationPermission
 Notification::GetPermission(const GlobalObject& aGlobal, ErrorResult& aRv)
 {
@@ -1990,18 +1997,17 @@ Notification::Get(nsPIDOMWindowInner* aW
   }
 
   nsCOMPtr<nsINotificationStorageCallback> callback =
     new NotificationStorageCallback(global, aScope, promise);
 
   RefPtr<NotificationGetRunnable> r =
     new NotificationGetRunnable(origin, aFilter.mTag, callback);
 
-  aRv = global->Dispatch("Notification::Get", TaskCategory::Other,
-                         r.forget());
+  aRv = global->Dispatch(TaskCategory::Other, r.forget());
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
--- a/dom/promise/PromiseDebugging.cpp
+++ b/dom/promise/PromiseDebugging.cpp
@@ -37,17 +37,17 @@ public:
 
   static void DispatchNeeded() {
     if (sDispatched.get()) {
       // An instance of `FlushRejections` has already been dispatched
       // and not run yet. No need to dispatch another one.
       return;
     }
     sDispatched.set(true);
-    SystemGroup::Dispatch("FlushRejections", TaskCategory::Other,
+    SystemGroup::Dispatch(TaskCategory::Other,
                           do_AddRef(new FlushRejections()));
   }
 
   static void FlushSync() {
     sDispatched.set(false);
 
     // Call the callbacks if necessary.
     // Note that these callbacks may in turn cause Promise to turn
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1497,18 +1497,17 @@ public:
   void SetToken(void* aToken) {
     MOZ_ASSERT(aToken && !mToken);
     mToken = aToken;
   }
 
   static void Dispatch(already_AddRefed<NotifyOffThreadScriptLoadCompletedRunnable>&& aSelf) {
     RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> self = aSelf;
     RefPtr<DocGroup> docGroup = self->mDocGroup;
-    docGroup->Dispatch("NotifyOffThreadScriptLoadCompletedRunnable",
-                       TaskCategory::Other, self.forget());
+    docGroup->Dispatch(TaskCategory::Other, self.forget());
   }
 
   NS_DECL_NSIRUNNABLE
 };
 
 } /* anonymous namespace */
 
 nsresult
@@ -2416,17 +2415,17 @@ void
 ScriptLoader::ProcessPendingRequestsAsync()
 {
   if (HasPendingRequests()) {
     nsCOMPtr<nsIRunnable> task =
       NewRunnableMethod("dom::ScriptLoader::ProcessPendingRequests",
                         this,
                         &ScriptLoader::ProcessPendingRequests);
     if (mDocument) {
-      mDocument->Dispatch("ScriptLoader", TaskCategory::Other, task.forget());
+      mDocument->Dispatch(TaskCategory::Other, task.forget());
     } else {
       NS_DispatchToCurrentThread(task.forget());
     }
   }
 }
 
 void
 ScriptLoader::ProcessPendingRequests()
--- a/dom/smil/nsSMILTimedElement.cpp
+++ b/dom/smil/nsSMILTimedElement.cpp
@@ -2374,17 +2374,17 @@ nsSMILTimedElement::NotifyChangedInterva
 void
 nsSMILTimedElement::FireTimeEventAsync(EventMessage aMsg, int32_t aDetail)
 {
   if (!mAnimationElement)
     return;
 
   nsCOMPtr<nsIRunnable> event =
     new AsyncTimeEventRunner(mAnimationElement, aMsg, aDetail);
-  mAnimationElement->OwnerDoc()->Dispatch("AsyncTimeEventRunner", TaskCategory::Other,
+  mAnimationElement->OwnerDoc()->Dispatch(TaskCategory::Other,
                                           event.forget());
 }
 
 const nsSMILInstanceTime*
 nsSMILTimedElement::GetEffectiveBeginInstance() const
 {
   switch (mElementState)
   {
--- a/dom/storage/Storage.cpp
+++ b/dom/storage/Storage.cpp
@@ -130,15 +130,14 @@ Storage::NotifyChange(Storage* aStorage,
   // StorageNotifierService.
 
   RefPtr<StorageNotifierRunnable> r =
     new StorageNotifierRunnable(event, aStorageType, aIsPrivate);
 
   if (aImmediateDispatch) {
     Unused << r->Run();
   } else {
-    SystemGroup::Dispatch("Storage::NotifyChange", TaskCategory::Other,
-                          r.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, r.forget());
   }
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -489,17 +489,17 @@ WorkerGlobalScope::CreateImageBitmap(JSC
                                aRv);
   } else {
     aRv.Throw(NS_ERROR_TYPE_ERR);
     return nullptr;
   }
 }
 
 nsresult
-WorkerGlobalScope::Dispatch(const char* aName, TaskCategory aCategory,
+WorkerGlobalScope::Dispatch(TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable)
 {
   return EventTargetFor(aCategory)->Dispatch(Move(aRunnable),
                                              NS_DISPATCH_NORMAL);
 }
 
 nsISerialEventTarget*
 WorkerGlobalScope::EventTargetFor(TaskCategory aCategory) const
@@ -1075,17 +1075,17 @@ WorkerDebuggerGlobalScope::Dump(JSContex
 {
   WorkerGlobalScope* scope = mWorkerPrivate->GetOrCreateGlobalScope(aCx);
   if (scope) {
     scope->Dump(aString);
   }
 }
 
 nsresult
-WorkerDebuggerGlobalScope::Dispatch(const char* aName, TaskCategory aCategory,
+WorkerDebuggerGlobalScope::Dispatch(TaskCategory aCategory,
                                     already_AddRefed<nsIRunnable>&& aRunnable)
 {
   return EventTargetFor(aCategory)->Dispatch(Move(aRunnable),
                                              NS_DISPATCH_NORMAL);
 }
 
 nsISerialEventTarget*
 WorkerDebuggerGlobalScope::EventTargetFor(TaskCategory aCategory) const
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -203,17 +203,17 @@ public:
   {
     MOZ_ASSERT(mWindowInteractionsAllowed > 0);
     mWindowInteractionsAllowed--;
   }
 
   // Override DispatchTrait API to target the worker thread.  Dispatch may
   // return failure if the worker thread is not alive.
   nsresult
-  Dispatch(const char* aName, TaskCategory aCategory,
+  Dispatch(TaskCategory aCategory,
            already_AddRefed<nsIRunnable>&& aRunnable) override;
 
   nsISerialEventTarget*
   EventTargetFor(TaskCategory aCategory) const override;
 
   AbstractThread*
   AbstractMainThreadFor(TaskCategory aCategory) override;
 };
@@ -416,17 +416,17 @@ public:
   }
 
   void
   Dump(JSContext* aCx, const Optional<nsAString>& aString) const;
 
   // Override DispatchTrait API to target the worker thread.  Dispatch may
   // return failure if the worker thread is not alive.
   nsresult
-  Dispatch(const char* aName, TaskCategory aCategory,
+  Dispatch(TaskCategory aCategory,
            already_AddRefed<nsIRunnable>&& aRunnable) override;
 
   nsISerialEventTarget*
   EventTargetFor(TaskCategory aCategory) const override;
 
   AbstractThread*
   AbstractMainThreadFor(TaskCategory aCategory) override;
 
--- a/dom/xml/nsXMLContentSink.cpp
+++ b/dom/xml/nsXMLContentSink.cpp
@@ -1093,18 +1093,17 @@ nsXMLContentSink::HandleEndElement(const
     }
     mNotifyLevel = stackLen - 1;
   }
   DidAddContent();
 
   if (content->IsSVGElement(nsGkAtoms::svg)) {
     FlushTags();
     nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(content);
-    if (NS_FAILED(content->OwnerDoc()->Dispatch("nsHtml5SVGLoadDispatcher",
-                                                TaskCategory::Other,
+    if (NS_FAILED(content->OwnerDoc()->Dispatch(TaskCategory::Other,
                                                 event.forget()))) {
       NS_WARNING("failed to dispatch svg load dispatcher");
     }
   }
 
   return aInterruptable && NS_SUCCEEDED(result) ? DidProcessATokenImpl() :
                                                   result;
 }
--- a/editor/composer/nsEditorSpellCheck.cpp
+++ b/editor/composer/nsEditorSpellCheck.cpp
@@ -405,18 +405,17 @@ nsEditorSpellCheck::InitSpellChecker(nsI
   // do not fail if UpdateCurrentDictionary fails because this method may
   // succeed later.
   rv = UpdateCurrentDictionary(aCallback);
   if (NS_FAILED(rv) && aCallback) {
     // However, if it does fail, we still need to call the callback since we
     // discard the failure.  Do it asynchronously so that the caller is always
     // guaranteed async behavior.
     RefPtr<CallbackCaller> caller = new CallbackCaller(aCallback);
-    rv = doc->Dispatch("nsEditorSpellCheck::CallbackCaller",
-                       TaskCategory::Other, caller.forget());
+    rv = doc->Dispatch(TaskCategory::Other, caller.forget());
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsEditorSpellCheck::GetNextMisspelledWord(char16_t **aNextMisspelledWord)
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -230,17 +230,17 @@ static void DestroyTextureData(TextureDa
                                bool aDeallocate, bool aMainThreadOnly)
 {
   if (!aTextureData) {
     return;
   }
 
   if (aMainThreadOnly && !NS_IsMainThread()) {
     RefPtr<LayersIPCChannel> allocatorRef = aAllocator;
-    SystemGroup::Dispatch(nullptr, TaskCategory::Other, NS_NewRunnableFunction(
+    SystemGroup::Dispatch(TaskCategory::Other, NS_NewRunnableFunction(
         "layers::DestroyTextureData",
         [aTextureData, allocatorRef, aDeallocate]() -> void {
           DestroyTextureData(aTextureData, allocatorRef, aDeallocate, true);
         }));
     return;
   }
 
   if (aDeallocate) {
--- a/gfx/src/gfxCrashReporterUtils.cpp
+++ b/gfx/src/gfxCrashReporterUtils.cpp
@@ -105,18 +105,17 @@ private:
 void
 ScopedGfxFeatureReporter::WriteAppNote(char statusChar)
 {
   StaticMutexAutoLock al(gFeaturesAlreadyReportedMutex);
 
   if (!gFeaturesAlreadyReported) {
     gFeaturesAlreadyReported = new nsTArray<nsCString>;
     nsCOMPtr<nsIRunnable> r = new RegisterObserverRunnable();
-    SystemGroup::Dispatch("ScopedGfxFeatureReporter::RegisterObserverRunnable",
-                          TaskCategory::Other, r.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, r.forget());
   }
 
   nsAutoCString featureString;
   featureString.AppendPrintf("%s%c ",
                              mFeature,
                              statusChar);
 
   if (!gFeaturesAlreadyReported->Contains(featureString)) {
@@ -127,18 +126,17 @@ ScopedGfxFeatureReporter::WriteAppNote(c
 
 void
 ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage)
 {
   if (NS_IsMainThread()) {
     CrashReporter::AppendAppNotesToCrashReport(aMessage);
   } else {
     nsCOMPtr<nsIRunnable> r = new AppendAppNotesRunnable(aMessage);
-    SystemGroup::Dispatch("ScopedGfxFeatureReporter::AppendAppNotesRunnable",
-                          TaskCategory::Other, r.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, r.forget());
   }
 }
   
 } // end namespace mozilla
 
 #else
 
 namespace mozilla {
--- a/ipc/mscom/Ptr.h
+++ b/ipc/mscom/Ptr.h
@@ -37,18 +37,17 @@ struct MainThreadRelease
     if (!aPtr) {
       return;
     }
     if (NS_IsMainThread()) {
       aPtr->Release();
       return;
     }
     DebugOnly<nsresult> rv =
-      SystemGroup::Dispatch("mscom::MainThreadRelease",
-                            TaskCategory::Other,
+      SystemGroup::Dispatch(TaskCategory::Other,
                             NewNonOwningRunnableMethod("mscom::MainThreadRelease",
                                                        aPtr, &T::Release));
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
 };
 
 template <typename T>
 struct MTADelete
--- a/js/xpconnect/loader/ChromeScriptLoader.cpp
+++ b/js/xpconnect/loader/ChromeScriptLoader.cpp
@@ -116,19 +116,17 @@ AsyncScriptCompiler::Start(nsIPrincipal*
 static void
 OffThreadScriptLoaderCallback(void* aToken, void* aCallbackData)
 {
     RefPtr<AsyncScriptCompiler> scriptCompiler = dont_AddRef(
         static_cast<AsyncScriptCompiler*>(aCallbackData));
 
     scriptCompiler->SetToken(aToken);
 
-    SystemGroup::Dispatch("ScriptLoader::FinishCompile",
-                          TaskCategory::Other,
-                          scriptCompiler.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, scriptCompiler.forget());
 }
 
 bool
 AsyncScriptCompiler::StartCompile(JSContext* aCx)
 {
     Rooted<JSObject*> global(aCx, mGlobalObject->GetGlobalJSObject());
 
     if (JS::CanCompileOffThread(aCx, mOptions, mScriptLength)) {
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -2023,18 +2023,17 @@ PresShell::ResizeReflowIgnoreOverride(ns
         mAsyncResizeEventTimer->InitWithNamedFuncCallback(AsyncResizeEventCallback,
                                                           this, 15,
                                                           nsITimer::TYPE_ONE_SHOT,
                                                           "AsyncResizeEventCallback");
       }
     } else {
       RefPtr<nsRunnableMethod<PresShell>> event = NewRunnableMethod(
         "PresShell::FireResizeEvent", this, &PresShell::FireResizeEvent);
-      nsresult rv = mDocument->Dispatch("PresShell::FireResizeEvent",
-                                        TaskCategory::Other,
+      nsresult rv = mDocument->Dispatch(TaskCategory::Other,
                                         do_AddRef(event));
       if (NS_SUCCEEDED(rv)) {
         mResizeEvent = Move(event);
         SetNeedStyleFlush();
       }
     }
   }
 
@@ -6221,19 +6220,17 @@ PresShell::ScheduleApproximateFrameVisib
     return;
   }
 
   RefPtr<nsRunnableMethod<PresShell>> event =
     NewRunnableMethod("PresShell::UpdateApproximateFrameVisibility",
                       this,
                       &PresShell::UpdateApproximateFrameVisibility);
   nsresult rv =
-    mDocument->Dispatch("PresShell::UpdateApproximateFrameVisibility",
-                        TaskCategory::Other,
-                        do_AddRef(event));
+    mDocument->Dispatch(TaskCategory::Other, do_AddRef(event));
 
   if (NS_SUCCEEDED(rv)) {
     mUpdateApproximateFrameVisibilityEvent = Move(event);
   }
 }
 
 void
 PresShell::EnsureFrameInApproximatelyVisibleList(nsIFrame* aFrame)
--- a/layout/base/ZoomConstraintsClient.cpp
+++ b/layout/base/ZoomConstraintsClient.cpp
@@ -158,19 +158,17 @@ ZoomConstraintsClient::Observe(nsISuppor
     // We need to run this later because all the pref change listeners need
     // to execute before we can be guaranteed that gfxPrefs::ForceUserScalable()
     // returns the updated value.
 
     RefPtr<nsRunnableMethod<ZoomConstraintsClient>> event =
       NewRunnableMethod("ZoomConstraintsClient::RefreshZoomConstraints",
                         this,
                         &ZoomConstraintsClient::RefreshZoomConstraints);
-    mDocument->Dispatch("ZoomConstraintsClient::RefreshZoomConstraints",
-                        TaskCategory::Other,
-                        event.forget());
+    mDocument->Dispatch(TaskCategory::Other, event.forget());
   }
   return NS_OK;
 }
 
 void
 ZoomConstraintsClient::ScreenSizeChanged()
 {
   ZCC_LOG("Got a screen-size change notification in %p\n", this);
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2244,19 +2244,17 @@ nsDocumentViewer::Show(void)
       shell->UnsuppressPainting();
     }
   }
 
   // Notify observers that a new page has been shown. This will get run
   // from the event loop after we actually draw the page.
   RefPtr<nsDocumentShownDispatcher> event =
     new nsDocumentShownDispatcher(document);
-  document->Dispatch("nsDocumentShownDispatcher",
-                      TaskCategory::Other,
-                      event.forget());
+  document->Dispatch(TaskCategory::Other, event.forget());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::Hide(void)
 {
   if (!mAttachedToParent && mWindow) {
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1117,18 +1117,17 @@ NS_IMETHODIMP
 nsPresContext::Observe(nsISupports* aSubject,
                         const char* aTopic,
                         const char16_t* aData)
 {
   if (!nsCRT::strcmp(aTopic, "charset")) {
     auto encoding = Encoding::ForName(NS_LossyConvertUTF16toASCII(aData));
     RefPtr<CharSetChangingRunnable> runnable =
       new CharSetChangingRunnable(this, encoding);
-    return Document()->Dispatch("CharSetChangingRunnable",
-                                TaskCategory::Other,
+    return Document()->Dispatch(TaskCategory::Other,
                                 runnable.forget());
   }
 
   NS_WARNING("unrecognized topic in nsPresContext::Observe");
   return NS_ERROR_FAILURE;
 }
 
 nsPresContext*
@@ -1808,18 +1807,17 @@ nsPresContext::ThemeChanged()
   if (!mPendingThemeChanged) {
     sLookAndFeelChanged = true;
     sThemeChanged = true;
 
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::ThemeChangedInternal",
                         this,
                         &nsPresContext::ThemeChangedInternal);
-    nsresult rv = Document()->Dispatch("nsPresContext::ThemeChangedInternal",
-                                       TaskCategory::Other,
+    nsresult rv = Document()->Dispatch(TaskCategory::Other,
                                        ev.forget());
     if (NS_SUCCEEDED(rv)) {
       mPendingThemeChanged = true;
     }
   }
 }
 
 static bool
@@ -1873,18 +1871,17 @@ void
 nsPresContext::SysColorChanged()
 {
   if (!mPendingSysColorChanged) {
     sLookAndFeelChanged = true;
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::SysColorChangedInternal",
                         this,
                         &nsPresContext::SysColorChangedInternal);
-    nsresult rv = Document()->Dispatch("nsPresContext::SysColorChangedInternal",
-                                       TaskCategory::Other,
+    nsresult rv = Document()->Dispatch(TaskCategory::Other,
                                        ev.forget());
     if (NS_SUCCEEDED(rv)) {
       mPendingSysColorChanged = true;
     }
   }
 }
 
 void
@@ -1914,19 +1911,17 @@ void
 nsPresContext::UIResolutionChanged()
 {
   if (!mPendingUIResolutionChanged) {
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::UIResolutionChangedInternal",
                         this,
                         &nsPresContext::UIResolutionChangedInternal);
     nsresult rv =
-      Document()->Dispatch("nsPresContext::UIResolutionChangedInternal",
-                           TaskCategory::Other,
-                           ev.forget());
+      Document()->Dispatch(TaskCategory::Other, ev.forget());
     if (NS_SUCCEEDED(rv)) {
       mPendingUIResolutionChanged = true;
     }
   }
 }
 
 void
 nsPresContext::UIResolutionChangedSync()
@@ -2161,19 +2156,17 @@ nsPresContext::PostMediaFeatureValuesCha
   // FIXME: We should probably replace this event with use of
   // nsRefreshDriver::AddStyleFlushObserver (except the pres shell would
   // need to track whether it's been added).
   if (!mPendingMediaFeatureValuesChanged && mShell) {
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::HandleMediaFeatureValuesChangedEvent",
                         this, &nsPresContext::HandleMediaFeatureValuesChangedEvent);
     nsresult rv =
-      Document()->Dispatch("nsPresContext::HandleMediaFeatureValuesChangedEvent",
-                           TaskCategory::Other,
-                           ev.forget());
+      Document()->Dispatch(TaskCategory::Other, ev.forget());
     if (NS_SUCCEEDED(rv)) {
       mPendingMediaFeatureValuesChanged = true;
       mShell->SetNeedStyleFlush();
     }
   }
 }
 
 void
@@ -2386,19 +2379,17 @@ nsPresContext::RebuildCounterStyles()
   if (mShell) {
     mShell->SetNeedStyleFlush();
   }
   if (!mPostedFlushCounterStyles) {
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod("nsPresContext::HandleRebuildCounterStyles",
                         this, &nsPresContext::HandleRebuildCounterStyles);
     nsresult rv =
-      Document()->Dispatch("nsPresContext::HandleRebuildCounterStyles",
-                           TaskCategory::Other,
-                           ev.forget());
+      Document()->Dispatch(TaskCategory::Other, ev.forget());
     if (NS_SUCCEEDED(rv)) {
       mPostedFlushCounterStyles = true;
     }
   }
 }
 
 void
 nsPresContext::NotifyMissingFonts()
@@ -3435,18 +3426,17 @@ nsRootPresContext::CancelAllDidPaintTime
   mNotifyDidPaintTimers.Clear();
 }
 
 void
 nsRootPresContext::AddWillPaintObserver(nsIRunnable* aRunnable)
 {
   if (!mWillPaintFallbackEvent.IsPending()) {
     mWillPaintFallbackEvent = new RunWillPaintObservers(this);
-    Document()->Dispatch("RunWillPaintObservers",
-                         TaskCategory::Other,
+    Document()->Dispatch(TaskCategory::Other,
                          do_AddRef(mWillPaintFallbackEvent.get()));
   }
   mWillPaintObservers.AppendElement(aRunnable);
 }
 
 /**
  * Run all runnables that need to get called before the next paint.
  */
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -2137,18 +2137,17 @@ nsRefreshDriver::Thaw()
       // FIXME: This isn't quite right, since our EnsureTimerStarted call
       // updates our mMostRecentRefresh, but the DoRefresh call won't run
       // and notify our observers until we get back to the event loop.
       // Thus MostRecentRefresh() will lie between now and the DoRefresh.
       RefPtr<nsRunnableMethod<nsRefreshDriver>> event = NewRunnableMethod(
         "nsRefreshDriver::DoRefresh", this, &nsRefreshDriver::DoRefresh);
       nsPresContext* pc = GetPresContext();
       if (pc) {
-        pc->Document()->Dispatch("nsRefreshDriver::DoRefresh",
-                                 TaskCategory::Other,
+        pc->Document()->Dispatch(TaskCategory::Other,
                                  event.forget());
         EnsureTimerStarted();
       } else {
         NS_ERROR("Thawing while document is being destroyed");
       }
     }
   }
 }
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -665,18 +665,17 @@ void nsTextControlFrame::SetFocus(bool a
     if (doc) {
       nsIFocusManager* fm = nsFocusManager::GetFocusManager();
       if (fm) {
         fm->GetLastFocusMethod(doc->GetWindow(), &lastFocusMethod);
       }
     }
     if (!(lastFocusMethod & nsIFocusManager::FLAG_BYMOUSE)) {
       RefPtr<ScrollOnFocusEvent> event = new ScrollOnFocusEvent(this);
-      nsresult rv = mContent->OwnerDoc()->Dispatch("ScrollOnFocusEvent",
-                                                   TaskCategory::Other,
+      nsresult rv = mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                                    do_AddRef(event));
       if (NS_SUCCEEDED(rv)) {
         mScrollEvent = Move(event);
       }
     }
   }
 
   // tell the caret to use our selection
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -158,17 +158,17 @@ nsPagePrintTimer::Notify(nsITimer *timer
     bool donePrePrint = true;
     if (mPrintEngine) {
       donePrePrint = mPrintEngine->PrePrintPage();
     }
 
     if (donePrePrint && !mWaitingForRemotePrint) {
       StopWatchDogTimer();
       // Pass nullptr here since name already was set in constructor.
-      mDocument->Dispatch(nullptr, TaskCategory::Other, do_AddRef(this));
+      mDocument->Dispatch(TaskCategory::Other, do_AddRef(this));
     } else {
       // Start the watch dog if we're waiting for preprint to ensure that if any
       // mozPrintCallbacks take to long we error out.
       StartWatchDogTimer();
     }
 
   }
   return NS_OK;
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -3754,18 +3754,17 @@ nsPrintEngine::FirePrintCompletionEvent(
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsCOMPtr<nsIRunnable> event = new nsPrintCompletionEvent(mDocViewerPrint);
   nsCOMPtr<nsIContentViewer> cv = do_QueryInterface(mDocViewerPrint);
   NS_ENSURE_TRUE_VOID(cv);
   nsCOMPtr<nsIDocument> doc = cv->GetDocument();
   NS_ENSURE_TRUE_VOID(doc);
 
-  NS_ENSURE_SUCCESS_VOID(doc->Dispatch("nsPrintCompletionEvent",
-                                       TaskCategory::Other, event.forget()));
+  NS_ENSURE_SUCCESS_VOID(doc->Dispatch(TaskCategory::Other, event.forget()));
 }
 
 void
 nsPrintEngine::DisconnectPagePrintTimer()
 {
   if (mPagePrintTimer) {
     mPagePrintTimer->Disconnect();
     NS_RELEASE(mPagePrintTimer);
--- a/layout/style/ErrorReporter.cpp
+++ b/layout/style/ErrorReporter.cpp
@@ -160,18 +160,17 @@ ErrorReporter::ErrorReporter(const Servo
 ErrorReporter::~ErrorReporter()
 {
   // Schedule deferred cleanup for cached data. We want to strike a
   // balance between performance and memory usage, so we only allow
   // short-term caching.
   if (sSpecCache && sSpecCache->IsInUse() && !sSpecCache->IsPending()) {
     nsCOMPtr<nsIRunnable> runnable(sSpecCache);
     nsresult rv =
-      SystemGroup::Dispatch("ShortTermURISpecCache", TaskCategory::Other,
-                            runnable.forget());
+      SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
     if (NS_FAILED(rv)) {
       // Peform the "deferred" cleanup immediately if the dispatch fails.
       sSpecCache->Run();
     } else {
       sSpecCache->SetPending();
     }
   }
 }
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -1517,18 +1517,17 @@ FontFaceSet::DispatchCheckLoadingFinishe
     set->AppendTask(PostTraversalTask::DispatchFontFaceSetCheckLoadingFinishedAfterDelay(this));
     return;
   }
 
   nsCOMPtr<nsIRunnable> checkTask =
     NewRunnableMethod("dom::FontFaceSet::CheckLoadingFinishedAfterDelay",
                       this,
                       &FontFaceSet::CheckLoadingFinishedAfterDelay);
-  mDocument->Dispatch("FontFaceSet::CheckLoadingFinishedAfterDelay",
-                      TaskCategory::Other, checkTask.forget());
+  mDocument->Dispatch(TaskCategory::Other, checkTask.forget());
 }
 
 void
 FontFaceSet::DidRefresh()
 {
   CheckLoadingFinished();
 }
 
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -2471,24 +2471,21 @@ Loader::PostLoadEvent(nsIURI* aURI,
 
   if (!mPostedEvents.AppendElement(evt)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsresult rv;
   RefPtr<SheetLoadData> runnable(evt);
   if (mDocument) {
-    rv = mDocument->Dispatch("SheetLoadData", TaskCategory::Other,
-                             runnable.forget());
+    rv = mDocument->Dispatch(TaskCategory::Other, runnable.forget());
   } else if (mDocGroup) {
-    rv = mDocGroup->Dispatch("SheetLoadData", TaskCategory::Other,
-                             runnable.forget());
+    rv = mDocGroup->Dispatch(TaskCategory::Other, runnable.forget());
   } else {
-    rv = SystemGroup::Dispatch("SheetLoadData", TaskCategory::Other,
-                               runnable.forget());
+    rv = SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
   }
 
   if (NS_FAILED(rv)) {
     NS_WARNING("failed to dispatch stylesheet load event");
     mPostedEvents.RemoveElement(evt);
   } else {
     // We'll unblock onload when we handle the event.
     if (mDocument) {
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2026,18 +2026,17 @@ nsStyleImageRequest::~nsStyleImageReques
         new StyleImageRequestCleanupTask(mModeFlags,
                                          mRequestProxy.forget(),
                                          mImageValue.forget(),
                                          mImageTracker.forget());
     if (NS_IsMainThread()) {
       task->Run();
     } else {
       if (mDocGroup) {
-        mDocGroup->Dispatch("StyleImageRequestCleanupTask",
-                            TaskCategory::Other, task.forget());
+        mDocGroup->Dispatch(TaskCategory::Other, task.forget());
       } else {
         // if Resolve was not called at some point, mDocGroup is not set.
         NS_DispatchToMainThread(task.forget());
       }
     }
   }
 
   MOZ_ASSERT(!mRequestProxy);
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -5107,18 +5107,17 @@ nsTableFrame::BCRecalcNeeded(nsStyleCont
     // we need to recompute the borders and the caller needs to mark
     // the bc damage area
     // XXX In principle this should only be necessary for border style changes
     // However the bc painting code tries to maximize the drawn border segments
     // so it stores in the cellmap where a new border segment starts and this
     // introduces a unwanted cellmap data dependence on color
     nsCOMPtr<nsIRunnable> evt = new nsDelayedCalcBCBorders(this);
     nsresult rv =
-      GetContent()->OwnerDoc()->Dispatch("nsDelayedCalcBCBorders",
-                                         TaskCategory::Other, evt.forget());
+      GetContent()->OwnerDoc()->Dispatch(TaskCategory::Other, evt.forget());
     return NS_SUCCEEDED(rv);
   }
   return false;
 }
 
 
 // Compare two border segments, this comparison depends whether the two
 // segments meet at a corner and whether the second segment is inline-dir.
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -109,18 +109,17 @@ nsImageBoxFrameEvent::Run()
 
 void
 FireImageDOMEvent(nsIContent* aContent, EventMessage aMessage)
 {
   NS_ASSERTION(aMessage == eLoad || aMessage == eLoadError,
                "invalid message");
 
   nsCOMPtr<nsIRunnable> event = new nsImageBoxFrameEvent(aContent, aMessage);
-  nsresult rv = aContent->OwnerDoc()->Dispatch("nsImageBoxFrameEvent",
-                                               TaskCategory::Other,
+  nsresult rv = aContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                                event.forget());
   if (NS_FAILED(rv)) {
     NS_WARNING("failed to dispatch image event");
   }
 }
 
 //
 // NS_NewImageBoxFrame
--- a/layout/xul/nsListBoxBodyFrame.cpp
+++ b/layout/xul/nsListBoxBodyFrame.cpp
@@ -841,18 +841,17 @@ nsListBoxBodyFrame::InternalPositionChan
                                          -smoother->mDelta : smoother->mDelta);
 }
 
 nsresult
 nsListBoxBodyFrame::InternalPositionChanged(bool aUp, int32_t aDelta)
 {
   RefPtr<nsPositionChangedEvent> event =
     new nsPositionChangedEvent(this, aUp, aDelta);
-  nsresult rv = mContent->OwnerDoc()->Dispatch("nsPositionChangedEvent",
-                                               TaskCategory::Other,
+  nsresult rv = mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                                do_AddRef(event));
   if (NS_SUCCEEDED(rv)) {
     if (!mPendingPositionChangeEvents.AppendElement(event)) {
       rv = NS_ERROR_OUT_OF_MEMORY;
       event->Revoke();
     }
   }
   return rv;
--- a/layout/xul/nsMenuBarFrame.cpp
+++ b/layout/xul/nsMenuBarFrame.cpp
@@ -343,18 +343,17 @@ nsMenuBarFrame::ChangeMenuItem(nsMenuFra
     if (wasOpen && !aMenuItem->IsDisabled())
       aNewMenu = content;
   }
 
   // use an event so that hiding and showing can be done synchronously, which
   // avoids flickering
   nsCOMPtr<nsIRunnable> event =
     new nsMenuBarSwitchMenu(GetContent(), aOldMenu, aNewMenu, aSelectFirstItem);
-  return mContent->OwnerDoc()->Dispatch("nsMenuBarSwitchMenu",
-                                        TaskCategory::Other,
+  return mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                         event.forget());
 }
 
 nsMenuFrame*
 nsMenuBarFrame::Enter(WidgetGUIEvent* aEvent)
 {
   if (!mCurrentMenu)
     return nullptr;
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -602,18 +602,17 @@ nsMenuFrame::PopupClosed(bool aDeselectM
             return;
 
           parent = parent->GetParent();
         }
 
         nsCOMPtr<nsIRunnable> event =
           new nsMenuActivateEvent(current->GetContent(),
                                   PresContext(), true);
-        mContent->OwnerDoc()->Dispatch("nsMenuActivateEvent",
-                                       TaskCategory::Other,
+        mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                        event.forget());
       }
     }
   }
 }
 
 NS_IMETHODIMP
 nsMenuFrame::SelectMenu(bool aActivateFlag)
@@ -653,18 +652,17 @@ nsMenuFrame::SelectMenu(bool aActivateFl
     nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
     if (pm) {
       nsMenuParent* menuParent = GetMenuParent();
       pm->CancelMenuTimer(menuParent);
     }
 
     nsCOMPtr<nsIRunnable> event =
       new nsMenuActivateEvent(mContent, PresContext(), aActivateFlag);
-    mContent->OwnerDoc()->Dispatch("nsMenuActivateEvent",
-                                   TaskCategory::Other,
+    mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                    event.forget());
   }
 
   return NS_OK;
 }
 
 nsresult
 nsMenuFrame::AttributeChanged(int32_t aNameSpaceID,
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -592,18 +592,17 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayou
       mContent->AddSystemEventListener(NS_LITERAL_STRING("transitionend"),
                                        mPopupShownDispatcher, false, false);
       return;
     }
 #endif
 
     // If there are no transitions, fire the popupshown event right away.
     nsCOMPtr<nsIRunnable> event = new nsXULPopupShownEvent(GetContent(), pc);
-    mContent->OwnerDoc()->Dispatch("nsXULPopupShownEvent",
-                                   TaskCategory::Other,
+    mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                    event.forget());
   }
 
   if (needCallback && !mReflowCallbackData.mPosted) {
     pc->PresShell()->PostReflowCallback(this);
     mReflowCallbackData.MarkPosted(aAnchor, aSizedToPopup);
   }
 }
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -760,19 +760,17 @@ nsXULPopupManager::ShowMenu(nsIContent *
   InitTriggerEvent(nullptr, nullptr, nullptr);
   popupFrame->InitializePopup(menuFrame->GetAnchor(), nullptr, position, 0, 0,
                               MenuPopupAnchorType_Node, true);
 
   if (aAsynchronous) {
     nsCOMPtr<nsIRunnable> event =
       new nsXULPopupShowingEvent(popupFrame->GetContent(),
                                  parentIsContextMenu, aSelectFirstItem);
-    aMenu->OwnerDoc()->Dispatch("nsXULPopupShowingEvent",
-                                TaskCategory::Other,
-                                event.forget());
+    aMenu->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget());
   }
   else {
     nsCOMPtr<nsIContent> popupContent = popupFrame->GetContent();
     FirePopupShowingEvent(popupContent, parentIsContextMenu, aSelectFirstItem, nullptr);
   }
 }
 
 void
@@ -1084,18 +1082,17 @@ nsXULPopupManager::HidePopup(nsIContent*
       popupFrame->SetPopupState(ePopupHiding);
     }
 
     // For menus, popupToHide is always the frontmost item in the list to hide.
     if (aAsynchronous) {
       nsCOMPtr<nsIRunnable> event =
         new nsXULPopupHidingEvent(popupToHide, nextPopup, lastPopup,
                                   popupFrame->PopupType(), deselectMenu, aIsCancel);
-        aPopup->OwnerDoc()->Dispatch("nsXULPopupHidingEvent",
-                                     TaskCategory::Other,
+        aPopup->OwnerDoc()->Dispatch(TaskCategory::Other,
                                      event.forget());
     }
     else {
       FirePopupHidingEvent(popupToHide, nextPopup, lastPopup,
                            popupFrame->PresContext(), popupFrame->PopupType(),
                            deselectMenu, aIsCancel);
     }
   }
@@ -1416,18 +1413,17 @@ nsXULPopupManager::ExecuteMenu(nsIConten
 
     // Now hide the popups. If the closemenu mode is auto, deselect the menu,
     // otherwise only one popup is closing, so keep the parent menu selected.
     HidePopupsInList(popupsToHide);
   }
 
   aEvent->SetCloseMenuMode(cmm);
   nsCOMPtr<nsIRunnable> event = aEvent;
-  aMenu->OwnerDoc()->Dispatch("nsXULMenuCommandEvent",
-                              TaskCategory::Other,
+  aMenu->OwnerDoc()->Dispatch(TaskCategory::Other,
                               event.forget());
 }
 
 void
 nsXULPopupManager::FirePopupShowingEvent(nsIContent* aPopup,
                                          bool aIsContextMenu,
                                          bool aSelectFirstItem,
                                          nsIDOMEvent* aTriggerEvent)
@@ -2780,19 +2776,17 @@ nsXULPopupPositionedEvent::DispatchIfNee
                                             bool aIsContextMenu,
                                             bool aSelectFirstItem)
 {
   // The popuppositioned event only fires on arrow panels for now.
   if (aPopup->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
                           nsGkAtoms::arrow, eCaseMatters)) {
     nsCOMPtr<nsIRunnable> event =
       new nsXULPopupPositionedEvent(aPopup, aIsContextMenu, aSelectFirstItem);
-    aPopup->OwnerDoc()->Dispatch("nsXULPopupPositionedEvent",
-                                 TaskCategory::Other,
-                                 event.forget());
+    aPopup->OwnerDoc()->Dispatch(TaskCategory::Other, event.forget());
 
     return true;
   }
 
   return false;
 }
 
 NS_IMETHODIMP
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -4775,18 +4775,17 @@ nsTreeBodyFrame::FireScrollEvent()
 
 void
 nsTreeBodyFrame::PostScrollEvent()
 {
   if (mScrollEvent.IsPending())
     return;
 
   RefPtr<ScrollEvent> event = new ScrollEvent(this);
-  nsresult rv = mContent->OwnerDoc()->Dispatch("ScrollEvent",
-                                               TaskCategory::Other,
+  nsresult rv = mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                                do_AddRef(event));
   if (NS_FAILED(rv)) {
     NS_WARNING("failed to dispatch ScrollEvent");
   } else {
     mScrollEvent = Move(event);
   }
 }
 
@@ -4972,18 +4971,17 @@ nsTreeBodyFrame::FullScrollbarsUpdate(bo
   // Overflow checking dispatches synchronous events, which can cause infinite
   // recursion during reflow. Do the first overflow check synchronously, but
   // force any nested checks to round-trip through the event loop. See bug
   // 905909.
   RefPtr<nsOverflowChecker> checker = new nsOverflowChecker(this);
   if (!mCheckingOverflow) {
     nsContentUtils::AddScriptRunner(checker);
   } else {
-    mContent->OwnerDoc()->Dispatch("nsOverflowChecker",
-                                   TaskCategory::Other,
+    mContent->OwnerDoc()->Dispatch(TaskCategory::Other,
                                    checker.forget());
   }
   return weakFrame.IsAlive();
 }
 
 nsresult
 nsTreeBodyFrame::OnImageIsAnimated(imgIRequest* aRequest)
 {
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -373,18 +373,17 @@ public:
     if (prefs) {
       rv = PreferencesWriter::Write(mFile, *prefs);
 
       // Make a copy of these so we can have them in runnable lambda.
       // nsIFile is only there so that we would never release the
       // ref counted pointer off main thread.
       nsresult rvCopy = rv;
       nsCOMPtr<nsIFile> fileCopy(mFile);
-      SystemGroup::Dispatch("Preferences::WriterRunnable",
-                            TaskCategory::Other,
+      SystemGroup::Dispatch(TaskCategory::Other,
                             NS_NewRunnableFunction("Preferences::WriterRunnable", [fileCopy, rvCopy] {
         MOZ_RELEASE_ASSERT(NS_IsMainThread());
         if (NS_FAILED(rvCopy)) {
           Preferences::DirtyCallback();
         }
       }));
     }
     return rv;
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -1546,19 +1546,17 @@ Predictor::LearnNative(nsIURI *targetURI
 
   if (IsNeckoChild()) {
     MOZ_DIAGNOSTIC_ASSERT(gNeckoChild);
 
     PREDICTOR_LOG(("    called on child process"));
 
     RefPtr<PredictorLearnRunnable> runnable = new PredictorLearnRunnable(
       targetURI, sourceURI, reason, originAttributes);
-    SystemGroup::Dispatch("PredictorLearnRunnable",
-                          TaskCategory::Other,
-                          runnable.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
 
     return NS_OK;
   }
 
   PREDICTOR_LOG(("    called on parent process"));
 
   if (!mInitialized) {
     PREDICTOR_LOG(("    not initialized"));
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -209,17 +209,16 @@ DNSRequestChild::DNSRequestChild(const n
 }
 
 void
 DNSRequestChild::StartRequest()
 {
   // we can only do IPDL on the main thread
   if (!NS_IsMainThread()) {
     SystemGroup::Dispatch(
-      "StartDNSRequestChild",
       TaskCategory::Other,
       NewRunnableMethod("net::DNSRequestChild::StartRequest",
                         this,
                         &DNSRequestChild::StartRequest));
     return;
   }
 
   nsCOMPtr<nsIEventTarget> systemGroupEventTarget
@@ -322,18 +321,16 @@ NS_IMPL_ISUPPORTS(DNSRequestChild,
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 DNSRequestChild::Cancel(nsresult reason)
 {
   if(mIPCOpen) {
     // We can only do IPDL on the main thread
     nsCOMPtr<nsIRunnable> runnable = new CancelDNSRequestEvent(this, reason);
-    SystemGroup::Dispatch("CancelDNSRequest",
-                          TaskCategory::Other,
-                          runnable.forget());
+    SystemGroup::Dispatch(TaskCategory::Other, runnable.forget());
   }
   return NS_OK;
 }
 
 //------------------------------------------------------------------------------
 } // namespace net
 } // namespace mozilla
--- a/parser/html/nsHtml5StreamParser.cpp
+++ b/parser/html/nsHtml5StreamParser.cpp
@@ -1372,17 +1372,17 @@ nsHtml5StreamParser::FlushTreeOpsAndDisa
     }
     mFlushTimerArmed = false;
   }
   if (mMode == VIEW_SOURCE_HTML || mMode == VIEW_SOURCE_XML) {
     mTokenizer->FlushViewSource();
   }
   mTreeBuilder->Flush();
   nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
-  if (NS_FAILED(DispatchToMain("nsHtml5ExecutorFlusher", runnable.forget()))) {
+  if (NS_FAILED(DispatchToMain(runnable.forget()))) {
     NS_WARNING("failed to dispatch executor flush event");
   }
 }
 
 void
 nsHtml5StreamParser::ParseAvailableData()
 {
   NS_ASSERTION(IsParserThread(), "Wrong thread!");
@@ -1409,17 +1409,17 @@ nsHtml5StreamParser::ParseAvailableData(
             }
             mTreeBuilder->FlushLoads();
             {
               // Dispatch this runnable unconditionally, because the loads
               // that need flushing may have been flushed earlier even if the
               // flush right above here did nothing.
               nsCOMPtr<nsIRunnable> runnable(mLoadFlusher);
               if (NS_FAILED(
-                    DispatchToMain("nsHtml5LoadFlusher", runnable.forget()))) {
+                    DispatchToMain(runnable.forget()))) {
                 NS_WARNING("failed to dispatch load flush event");
               }
             }
             return; // no more data for now but expecting more
           case STREAM_ENDED:
             if (mAtEOF) {
               return;
             }
@@ -1752,27 +1752,27 @@ nsHtml5StreamParser::TimerFlush()
     return;
   }
 
   if (mMode == VIEW_SOURCE_HTML || mMode == VIEW_SOURCE_XML) {
     mTreeBuilder->Flush(); // delete useless ops
     if (mTokenizer->FlushViewSource()) {
       nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
       if (NS_FAILED(
-            DispatchToMain("nsHtml5ExecutorFlusher", runnable.forget()))) {
+            DispatchToMain(runnable.forget()))) {
         NS_WARNING("failed to dispatch executor flush event");
       }
     }
   } else {
     // we aren't speculating and we don't know when new data is
     // going to arrive. Send data to the main thread.
     if (mTreeBuilder->Flush(true)) {
       nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
       if (NS_FAILED(
-            DispatchToMain("nsHtml5ExecutorFlusher", runnable.forget()))) {
+            DispatchToMain(runnable.forget()))) {
         NS_WARNING("failed to dispatch executor flush event");
       }
     }
   }
 }
 
 void
 nsHtml5StreamParser::MarkAsBroken(nsresult aRv)
@@ -1780,24 +1780,21 @@ nsHtml5StreamParser::MarkAsBroken(nsresu
   NS_ASSERTION(IsParserThread(), "Wrong thread!");
   mTokenizerMutex.AssertCurrentThreadOwns();
 
   Terminate();
   mTreeBuilder->MarkAsBroken(aRv);
   mozilla::DebugOnly<bool> hadOps = mTreeBuilder->Flush(false);
   NS_ASSERTION(hadOps, "Should have had the markAsBroken op!");
   nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
-  if (NS_FAILED(DispatchToMain("nsHtml5ExecutorFlusher", runnable.forget()))) {
+  if (NS_FAILED(DispatchToMain(runnable.forget()))) {
     NS_WARNING("failed to dispatch executor flush event");
   }
 }
 
 nsresult
-nsHtml5StreamParser::DispatchToMain(const char* aName,
-                                    already_AddRefed<nsIRunnable>&& aRunnable)
+nsHtml5StreamParser::DispatchToMain(already_AddRefed<nsIRunnable>&& aRunnable)
 {
-  nsCOMPtr<nsIRunnable> runnable(aRunnable);
   if (mDocGroup) {
-    return mDocGroup->Dispatch(aName, TaskCategory::Network, runnable.forget());
+    return mDocGroup->Dispatch(TaskCategory::Network, Move(aRunnable));
   }
-  return SchedulerGroup::UnlabeledDispatch(
-    aName, TaskCategory::Network, runnable.forget());
+  return SchedulerGroup::UnlabeledDispatch(TaskCategory::Network, Move(aRunnable));
 }
--- a/parser/html/nsHtml5StreamParser.h
+++ b/parser/html/nsHtml5StreamParser.h
@@ -385,18 +385,17 @@ public:
     {
         return mSpeculationFailureCount < 100;
     }
 
     /**
      * Dispatch an event to a Quantum DOM main thread-ish thread.
      * (Not the parser thread.)
      */
-    nsresult DispatchToMain(const char* aName,
-                            already_AddRefed<nsIRunnable>&& aRunnable);
+    nsresult DispatchToMain(already_AddRefed<nsIRunnable>&& aRunnable);
 
     nsCOMPtr<nsIRequest>          mRequest;
     nsCOMPtr<nsIRequestObserver>  mObserver;
 
     /**
      * The document title to use if this turns out to be a View Source parser.
      */
     nsCString                     mViewSourceTitle;
--- a/parser/html/nsHtml5StreamParserPtr.h
+++ b/parser/html/nsHtml5StreamParserPtr.h
@@ -47,18 +47,17 @@ private:
     nsHtml5StreamParser* oldPtr = mRawPtr;
     mRawPtr = newPtr;
     if (oldPtr)
       release(oldPtr);
   }
   void release(nsHtml5StreamParser* aPtr)
   {
     nsCOMPtr<nsIRunnable> releaser = new nsHtml5StreamParserReleaser(aPtr);
-    if (NS_FAILED(aPtr->DispatchToMain("nsHtml5StreamParserReleaser",
-                                       releaser.forget()))) {
+    if (NS_FAILED(aPtr->DispatchToMain(releaser.forget()))) {
       NS_WARNING("Failed to dispatch releaser event.");
     }
   }
 
 private:
   nsHtml5StreamParser* mRawPtr;
 
 public:
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -237,18 +237,17 @@ nsHtml5TreeOpExecutor::MarkAsBroken(nsre
     mStreamParser->Terminate();
   }
   // We are under memory pressure, but let's hope the following allocation
   // works out so that we get to terminate and clean up the parser from
   // a safer point.
   if (mParser && mDocument) { // can mParser ever be null here?
     nsCOMPtr<nsIRunnable> terminator =
       NewRunnableMethod("nsHtml5Parser::Terminate", GetParser(), &nsHtml5Parser::Terminate);
-    if (NS_FAILED(mDocument->Dispatch("nsHtml5Parser::Terminate",
-                                      TaskCategory::Network,
+    if (NS_FAILED(mDocument->Dispatch(TaskCategory::Network,
                                       terminator.forget()))) {
       NS_WARNING("failed to dispatch executor flush event");
     }
   }
   return aReason;
 }
 
 void
@@ -266,18 +265,17 @@ FlushTimerCallback(nsITimer* aTimer, voi
   }
 }
 
 void
 nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync()
 {
   if (!mDocument || !mDocument->IsInBackgroundWindow()) {
     nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
-    if (NS_FAILED(mDocument->Dispatch("nsHtml5ExecutorReflusher",
-                                      TaskCategory::Network,
+    if (NS_FAILED(mDocument->Dispatch(TaskCategory::Network,
                                       flusher.forget()))) {
       NS_WARNING("failed to dispatch executor flush event");
     }
   } else {
     if (!gBackgroundFlushList) {
       gBackgroundFlushList = new mozilla::LinkedList<nsHtml5TreeOpExecutor>();
     }
     if (!isInList()) {
--- a/parser/html/nsHtml5TreeOperation.cpp
+++ b/parser/html/nsHtml5TreeOperation.cpp
@@ -592,17 +592,17 @@ nsHtml5TreeOperation::DoneCreatingElemen
   aNode->DoneCreatingElement();
 }
 
 void
 nsHtml5TreeOperation::SvgLoad(nsIContent* aNode)
 {
   nsCOMPtr<nsIRunnable> event = new nsHtml5SVGLoadDispatcher(aNode);
   if (NS_FAILED(aNode->OwnerDoc()->Dispatch(
-        "nsHtml5SVGLoadDispatcher", TaskCategory::Network, event.forget()))) {
+        TaskCategory::Network, event.forget()))) {
     NS_WARNING("failed to dispatch svg load dispatcher");
   }
 }
 
 void
 nsHtml5TreeOperation::MarkMalformedIfScript(nsIContent* aNode)
 {
   nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(aNode);
--- a/tools/profiler/gecko/ThreadResponsiveness.cpp
+++ b/tools/profiler/gecko/ThreadResponsiveness.cpp
@@ -44,18 +44,17 @@ public:
   void DoFirstDispatchIfNeeded()
   {
     if (mHasEverBeenSuccessfullyDispatched) {
       return;
     }
 
     // Dispatching can fail during early startup, particularly when
     // MOZ_PROFILER_STARTUP is used.
-    nsresult rv = SystemGroup::Dispatch("CheckResponsivenessTask",
-                                        TaskCategory::Other,
+    nsresult rv = SystemGroup::Dispatch(TaskCategory::Other,
                                         do_AddRef(this));
     if (NS_SUCCEEDED(rv)) {
       mHasEverBeenSuccessfullyDispatched = true;
     }
   }
 
   // Can only run on the main thread.
   NS_IMETHOD Run() override
@@ -76,18 +75,17 @@ public:
     }
     mTimer->InitWithCallback(this, 16, nsITimer::TYPE_ONE_SHOT);
 
     return NS_OK;
   }
 
   NS_IMETHOD Notify(nsITimer* aTimer) final
   {
-    SystemGroup::Dispatch("CheckResponsivenessTask",
-                          TaskCategory::Other,
+    SystemGroup::Dispatch(TaskCategory::Other,
                           do_AddRef(this));
     return NS_OK;
   }
 
   void Terminate() {
     MutexAutoLock mon(mMutex);
     mStop = true;
   }
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -305,17 +305,17 @@ PuppetWidget::Invalidate(const LayoutDev
     return;
   }
 
   mDirtyRegion.Or(mDirtyRegion, aRect);
 
   if (mTabChild && !mDirtyRegion.IsEmpty() && !mPaintTask.IsPending()) {
     mPaintTask = new PaintTask(this);
     nsCOMPtr<nsIRunnable> event(mPaintTask.get());
-    mTabChild->TabGroup()->Dispatch("PuppetWidget::Invalidate", TaskCategory::Other, event.forget());
+    mTabChild->TabGroup()->Dispatch(TaskCategory::Other, event.forget());
     return;
   }
 }
 
 void
 PuppetWidget::InitEvent(WidgetGUIEvent& aEvent, LayoutDeviceIntPoint* aPoint)
 {
   if (nullptr == aPoint) {
--- a/xpcom/base/DebuggerOnGCRunnable.cpp
+++ b/xpcom/base/DebuggerOnGCRunnable.cpp
@@ -20,17 +20,17 @@ DebuggerOnGCRunnable::Enqueue(JSContext*
   auto gcEvent = aDesc.toGCEvent(aCx);
   if (!gcEvent) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   RefPtr<DebuggerOnGCRunnable> runOnGC =
     new DebuggerOnGCRunnable(Move(gcEvent));
   if (NS_IsMainThread()) {
-    return SystemGroup::Dispatch("DebuggerOnGCRunnable", TaskCategory::GarbageCollection, runOnGC.forget());
+    return SystemGroup::Dispatch(TaskCategory::GarbageCollection, runOnGC.forget());
   } else {
     return NS_DispatchToCurrentThread(runOnGC);
   }
 }
 
 NS_IMETHODIMP
 DebuggerOnGCRunnable::Run()
 {
--- a/xpcom/base/nsConsoleService.cpp
+++ b/xpcom/base/nsConsoleService.cpp
@@ -326,17 +326,17 @@ nsConsoleService::LogMessageWithMode(nsI
     NS_ReleaseOnMainThreadSystemGroup(
       "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());
+      SystemGroup::Dispatch(TaskCategory::Other, r.forget());
     }
   }
 
   return NS_OK;
 }
 
 void
 nsConsoleService::CollectCurrentListeners(
--- a/xpcom/threads/BackgroundHangMonitor.cpp
+++ b/xpcom/threads/BackgroundHangMonitor.cpp
@@ -629,18 +629,17 @@ BackgroundHangThread::ReportHang(PRInter
     // runnable in case the dispatch fails. If it fails, the already_AddRefed
     // runnable which we passed in has been leaked, and we need to free it
     // ourselves. The only time when this should fail is if we're shutting down.
     //
     // Most components just avoid dispatching runnables during shutdown, but BHR
     // is not shut down until way too late, so we cannot do that. Instead, we
     // just detect that the dispatch failed and manually unleak the leaked
     // nsIRunnable in that situation.
-    nsresult rv = SystemGroup::Dispatch("NotifyBHRHangObservers",
-                                        TaskCategory::Other,
+    nsresult rv = SystemGroup::Dispatch(TaskCategory::Other,
                                         do_AddRef(runnable.get()));
     if (NS_FAILED(rv)) {
       // NOTE: We go through `get()` here in order to avoid the
       // MOZ_NO_ADDREF_RELEASE_ON_RETURN static analysis.
       nsrefcnt refcnt = runnable.get()->Release();
       MOZ_RELEASE_ASSERT(refcnt == 1, "runnable should have had 1 reference leaked");
     }
   }
--- a/xpcom/threads/SchedulerGroup.cpp
+++ b/xpcom/threads/SchedulerGroup.cpp
@@ -141,17 +141,17 @@ SchedulerEventTarget::DispatchFromScript
 }
 
 NS_IMETHODIMP
 SchedulerEventTarget::Dispatch(already_AddRefed<nsIRunnable> aRunnable, uint32_t aFlags)
 {
   if (NS_WARN_IF(aFlags != NS_DISPATCH_NORMAL)) {
     return NS_ERROR_UNEXPECTED;
   }
-  return mDispatcher->Dispatch(nullptr, mCategory, Move(aRunnable));
+  return mDispatcher->Dispatch(mCategory, Move(aRunnable));
 }
 
 NS_IMETHODIMP
 SchedulerEventTarget::DelayedDispatch(already_AddRefed<nsIRunnable>, uint32_t)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
@@ -164,18 +164,17 @@ SchedulerEventTarget::IsOnCurrentThread(
 
 NS_IMETHODIMP_(bool)
 SchedulerEventTarget::IsOnCurrentThreadInfallible()
 {
   return NS_IsMainThread();
 }
 
 /* static */ nsresult
-SchedulerGroup::UnlabeledDispatch(const char* aName,
-                                  TaskCategory aCategory,
+SchedulerGroup::UnlabeledDispatch(TaskCategory aCategory,
                                   already_AddRefed<nsIRunnable>&& aRunnable)
 {
   if (NS_IsMainThread()) {
     return NS_DispatchToCurrentThread(Move(aRunnable));
   } else {
     return NS_DispatchToMainThread(Move(aRunnable));
   }
 }
@@ -208,21 +207,20 @@ SchedulerGroup::MarkVsyncRan()
 SchedulerGroup* SchedulerGroup::sRunningDispatcher;
 
 SchedulerGroup::SchedulerGroup()
  : mAccessValid(false)
 {
 }
 
 nsresult
-SchedulerGroup::Dispatch(const char* aName,
-                         TaskCategory aCategory,
+SchedulerGroup::Dispatch(TaskCategory aCategory,
                          already_AddRefed<nsIRunnable>&& aRunnable)
 {
-  return LabeledDispatch(aName, aCategory, Move(aRunnable));
+  return LabeledDispatch(aCategory, Move(aRunnable));
 }
 
 nsISerialEventTarget*
 SchedulerGroup::EventTargetFor(TaskCategory aCategory) const
 {
   MOZ_ASSERT(aCategory != TaskCategory::Count);
   MOZ_ASSERT(mEventTargets[size_t(aCategory)]);
   return mEventTargets[size_t(aCategory)];
@@ -294,25 +292,24 @@ SchedulerGroup::FromEventTarget(nsIEvent
   RefPtr<SchedulerEventTarget> target = do_QueryObject(aEventTarget);
   if (!target) {
     return nullptr;
   }
   return target->Dispatcher();
 }
 
 nsresult
-SchedulerGroup::LabeledDispatch(const char* aName,
-                                TaskCategory aCategory,
+SchedulerGroup::LabeledDispatch(TaskCategory aCategory,
                                 already_AddRefed<nsIRunnable>&& aRunnable)
 {
   nsCOMPtr<nsIRunnable> runnable(aRunnable);
   if (XRE_IsContentProcess()) {
     runnable = new Runnable(runnable.forget(), this);
   }
-  return UnlabeledDispatch(aName, aCategory, runnable.forget());
+  return UnlabeledDispatch(aCategory, runnable.forget());
 }
 
 void
 SchedulerGroup::SetValidatingAccess(ValidationType aType)
 {
   sRunningDispatcher = aType == StartValidation ? this : nullptr;
   mAccessValid = aType == StartValidation;
 
--- a/xpcom/threads/SchedulerGroup.h
+++ b/xpcom/threads/SchedulerGroup.h
@@ -104,32 +104,30 @@ public:
 
     nsCOMPtr<nsIRunnable> mRunnable;
     RefPtr<SchedulerGroup> mGroup;
   };
   friend class Runnable;
 
   bool* GetValidAccessPtr() { return &mAccessValid; }
 
-  virtual nsresult Dispatch(const char* aName,
-                            TaskCategory aCategory,
+  virtual nsresult Dispatch(TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable);
 
   virtual nsISerialEventTarget* EventTargetFor(TaskCategory aCategory) const;
 
   // Must always be called on the main thread. The returned AbstractThread can
   // always be used off the main thread.
   AbstractThread* AbstractMainThreadFor(TaskCategory aCategory);
 
   // This method performs a safe cast. It returns null if |this| is not of the
   // requested type.
   virtual dom::TabGroup* AsTabGroup() { return nullptr; }
 
-  static nsresult UnlabeledDispatch(const char* aName,
-                                    TaskCategory aCategory,
+  static nsresult UnlabeledDispatch(TaskCategory aCategory,
                                     already_AddRefed<nsIRunnable>&& aRunnable);
 
   static void MarkVsyncReceived();
 
   static void MarkVsyncRan();
 
 protected:
   // Implementations are guaranteed that this method is called on the main
@@ -139,18 +137,17 @@ protected:
   // Helper method to create an event target specific to a particular TaskCategory.
   virtual already_AddRefed<nsISerialEventTarget>
   CreateEventTargetFor(TaskCategory aCategory);
 
   // Given an event target returned by |dispatcher->CreateEventTargetFor|, this
   // function returns |dispatcher|.
   static SchedulerGroup* FromEventTarget(nsIEventTarget* aEventTarget);
 
-  nsresult LabeledDispatch(const char* aName,
-                           TaskCategory aCategory,
+  nsresult LabeledDispatch(TaskCategory aCategory,
                            already_AddRefed<nsIRunnable>&& aRunnable);
 
   void CreateEventTargets(bool aNeedValidation);
 
   // Shuts down this dispatcher. If aXPCOMShutdown is true, invalidates this
   // dispatcher.
   void Shutdown(bool aXPCOMShutdown);
 
--- a/xpcom/threads/SystemGroup.cpp
+++ b/xpcom/threads/SystemGroup.cpp
@@ -80,21 +80,20 @@ SystemGroup::Shutdown()
 
 bool
 SystemGroup::Initialized()
 {
   return SystemGroupImpl::Initialized();
 }
 
 /* static */ nsresult
-SystemGroup::Dispatch(const char* aName,
-                      TaskCategory aCategory,
+SystemGroup::Dispatch(TaskCategory aCategory,
                       already_AddRefed<nsIRunnable>&& aRunnable)
 {
-  return SystemGroupImpl::Get()->Dispatch(aName, aCategory, Move(aRunnable));
+  return SystemGroupImpl::Get()->Dispatch(aCategory, Move(aRunnable));
 }
 
 /* static */ nsISerialEventTarget*
 SystemGroup::EventTargetFor(TaskCategory aCategory)
 {
   return SystemGroupImpl::Get()->EventTargetFor(aCategory);
 }
 
--- a/xpcom/threads/SystemGroup.h
+++ b/xpcom/threads/SystemGroup.h
@@ -16,18 +16,17 @@
 // undefined.
 
 namespace mozilla {
 
 class SystemGroup
 {
  public:
   // This method is safe to use from any thread.
-  static nsresult Dispatch(const char* aName,
-                           TaskCategory aCategory,
+  static nsresult Dispatch(TaskCategory aCategory,
                            already_AddRefed<nsIRunnable>&& aRunnable);
 
   // This method is safe to use from any thread.
   static nsISerialEventTarget* EventTargetFor(TaskCategory aCategory);
 
   // Must be called on the main thread. The AbstractThread can always be used
   // off the main thread.
   static AbstractThread* AbstractMainThreadFor(TaskCategory aCategory);