Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit f115503

Browse files
Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
1 parent 3f0e196 commit f115503

624 files changed

Lines changed: 6358 additions & 3585 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessible/generic/Accessible.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,8 +1803,13 @@ Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
18031803
class Runnable final : public mozilla::Runnable
18041804
{
18051805
public:
1806-
Runnable(Accessible* aAcc, nsIContent* aContent, uint32_t aIdx) :
1807-
mAcc(aAcc), mContent(aContent), mIdx(aIdx) { }
1806+
Runnable(Accessible* aAcc, nsIContent* aContent, uint32_t aIdx)
1807+
: mozilla::Runnable("Runnable")
1808+
, mAcc(aAcc)
1809+
, mContent(aContent)
1810+
, mIdx(aIdx)
1811+
{
1812+
}
18081813

18091814
NS_IMETHOD Run() override
18101815
{

accessible/generic/DocAccessible.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,12 @@ DocAccessible::ScrollPositionDidChange(nscoord aX, nscoord aY)
649649
mScrollWatchTimer = do_CreateInstance("@mozilla.org/timer;1");
650650
if (mScrollWatchTimer) {
651651
NS_ADDREF_THIS(); // Kung fu death grip
652-
mScrollWatchTimer->InitWithFuncCallback(ScrollTimerCallback, this,
653-
kScrollPosCheckWait,
654-
nsITimer::TYPE_REPEATING_SLACK);
652+
mScrollWatchTimer->InitWithNamedFuncCallback(
653+
ScrollTimerCallback,
654+
this,
655+
kScrollPosCheckWait,
656+
nsITimer::TYPE_REPEATING_SLACK,
657+
"a11y::DocAccessible::ScrollPositionDidChange");
655658
}
656659
}
657660
mScrollPositionChangedTicks = 1;

accessible/ipc/win/HandlerProvider.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ HandlerProvider::GetAndSerializePayload(const MutexAutoLock&)
9595

9696
IA2Payload payload{};
9797

98-
if (!mscom::InvokeOnMainThread(this, &HandlerProvider::BuildIA2Data,
98+
if (!mscom::InvokeOnMainThread("HandlerProvider::BuildIA2Data",
99+
this, &HandlerProvider::BuildIA2Data,
99100
&payload.mData) ||
100101
!payload.mData.mUniqueId) {
101102
return;
@@ -236,7 +237,8 @@ HandlerProvider::put_HandlerControl(long aPid, IHandlerControl* aCtrl)
236237

237238
auto ptrProxy = mscom::ToProxyUniquePtr(aCtrl);
238239

239-
if (!mscom::InvokeOnMainThread(this,
240+
if (!mscom::InvokeOnMainThread("HandlerProvider::SetHandlerControlOnMainThread",
241+
this,
240242
&HandlerProvider::SetHandlerControlOnMainThread,
241243
static_cast<DWORD>(aPid), Move(ptrProxy))) {
242244
return E_FAIL;
@@ -250,7 +252,8 @@ HandlerProvider::Refresh(IA2Data* aOutData)
250252
{
251253
MOZ_ASSERT(mscom::IsCurrentThreadMTA());
252254

253-
if (!mscom::InvokeOnMainThread(this, &HandlerProvider::BuildIA2Data,
255+
if (!mscom::InvokeOnMainThread("HandlerProvider::BuildIA2Data",
256+
this, &HandlerProvider::BuildIA2Data,
254257
aOutData)) {
255258
return E_FAIL;
256259
}

accessible/windows/msaa/AccessibleWrap.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ AccessibleWrap::accSelect(
841841
// is happening, so we dispatch TakeFocus from the main thread to
842842
// guarantee that we are outside any IPC.
843843
nsCOMPtr<nsIRunnable> runnable =
844-
mozilla::NewRunnableMethod(this, &Accessible::TakeFocus);
844+
mozilla::NewRunnableMethod("Accessible::TakeFocus",
845+
this, &Accessible::TakeFocus);
845846
NS_DispatchToMainThread(runnable, NS_DISPATCH_NORMAL);
846847
return S_OK;
847848
}

accessible/windows/msaa/LazyInstantiator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
264264
// the executable file to retrieve version information.
265265
nsCOMPtr<nsIRunnable> runnable(
266266
NewRunnableMethod<nsCOMPtr<nsIFile>, RefPtr<AccumulateRunnable>>(
267+
"LazyInstantiator::GatherTelemetry",
267268
this,
268269
&LazyInstantiator::GatherTelemetry,
269270
clientExe,

accessible/xpcom/xpcAccessibilityService.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ xpcAccessibilityService::Release(void)
7979
if (count == 1 && !mShutdownTimer) {
8080
mShutdownTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
8181
if (mShutdownTimer) {
82-
mShutdownTimer->InitWithFuncCallback(ShutdownCallback, this, 100,
83-
nsITimer::TYPE_ONE_SHOT);
82+
mShutdownTimer->InitWithNamedFuncCallback(
83+
ShutdownCallback,
84+
this,
85+
100,
86+
nsITimer::TYPE_ONE_SHOT,
87+
"xpcAccessibilityService::Release");
8488
}
8589
}
8690

docshell/base/nsDocShell.cpp

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,12 @@ nsPingListener::StartTimeout(DocGroup* aDocGroup)
454454
timer->SetTarget(aDocGroup->EventTargetFor(TaskCategory::Network));
455455

456456
if (timer) {
457-
nsresult rv = timer->InitWithFuncCallback(OnPingTimeout, mLoadGroup,
458-
PING_TIMEOUT,
459-
nsITimer::TYPE_ONE_SHOT);
457+
nsresult rv =
458+
timer->InitWithNamedFuncCallback(OnPingTimeout,
459+
mLoadGroup,
460+
PING_TIMEOUT,
461+
nsITimer::TYPE_ONE_SHOT,
462+
"nsPingListener::StartTimeout");
460463
if (NS_SUCCEEDED(rv)) {
461464
mTimer = timer;
462465
return NS_OK;
@@ -1767,10 +1770,12 @@ nsDocShell::DispatchToTabGroup(const char* aName,
17671770
NS_IMETHODIMP
17681771
nsDocShell::DispatchLocationChangeEvent()
17691772
{
1770-
return DispatchToTabGroup("nsDocShell::FireDummyOnLocationChange",
1771-
TaskCategory::Other,
1772-
NewRunnableMethod(this,
1773-
&nsDocShell::FireDummyOnLocationChange));
1773+
return DispatchToTabGroup(
1774+
"nsDocShell::FireDummyOnLocationChange",
1775+
TaskCategory::Other,
1776+
NewRunnableMethod("nsDocShell::FireDummyOnLocationChange",
1777+
this,
1778+
&nsDocShell::FireDummyOnLocationChange));
17741779
}
17751780

17761781
bool
@@ -9644,13 +9649,20 @@ class InternalLoadEvent : public Runnable
96449649
bool aLoadReplace,
96459650
nsIURI* aReferrer, uint32_t aReferrerPolicy,
96469651
nsIPrincipal* aTriggeringPrincipal,
9647-
nsIPrincipal* aPrincipalToInherit, uint32_t aFlags,
9648-
const char* aTypeHint, nsIInputStream* aPostData,
9649-
nsIInputStream* aHeadersData, uint32_t aLoadType,
9650-
nsISHEntry* aSHEntry, bool aFirstParty,
9651-
const nsAString& aSrcdoc, nsIDocShell* aSourceDocShell,
9652-
nsIURI* aBaseURI, bool aCheckForPrerender)
9653-
: mSrcdoc(aSrcdoc)
9652+
nsIPrincipal* aPrincipalToInherit,
9653+
uint32_t aFlags,
9654+
const char* aTypeHint,
9655+
nsIInputStream* aPostData,
9656+
nsIInputStream* aHeadersData,
9657+
uint32_t aLoadType,
9658+
nsISHEntry* aSHEntry,
9659+
bool aFirstParty,
9660+
const nsAString& aSrcdoc,
9661+
nsIDocShell* aSourceDocShell,
9662+
nsIURI* aBaseURI,
9663+
bool aCheckForPrerender)
9664+
: mozilla::Runnable("InternalLoadEvent")
9665+
, mSrcdoc(aSrcdoc)
96549666
, mDocShell(aDocShell)
96559667
, mURI(aURI)
96569668
, mOriginalURI(aOriginalURI)
@@ -14042,7 +14054,8 @@ OnLinkClickEvent::OnLinkClickEvent(nsDocShell* aHandler,
1404214054
bool aNoOpenerImplied,
1404314055
bool aIsTrusted,
1404414056
nsIPrincipal* aTriggeringPrincipal)
14045-
: mHandler(aHandler)
14057+
: mozilla::Runnable("OnLinkClickEvent")
14058+
, mHandler(aHandler)
1404614059
, mURI(aURI)
1404714060
, mTargetSpec(aTargetSpec)
1404814061
, mFileName(aFileName)

docshell/base/nsDocShell.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,11 @@ class nsDocShell final
777777
{
778778
public:
779779
NS_DECL_NSIRUNNABLE
780-
explicit RestorePresentationEvent(nsDocShell* aDs) : mDocShell(aDs) {}
780+
explicit RestorePresentationEvent(nsDocShell* aDs)
781+
: mozilla::Runnable("nsDocShell::RestorePresentationEvent")
782+
, mDocShell(aDs)
783+
{
784+
}
781785
void Revoke() { mDocShell = nullptr; }
782786
private:
783787
RefPtr<nsDocShell> mDocShell;

docshell/base/nsDocShellTreeOwner.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,12 @@ ChromeTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent)
12601260
}
12611261
}
12621262
if (mPossibleTooltipNode) {
1263-
nsresult rv = mTooltipTimer->InitWithFuncCallback(
1264-
sTooltipCallback, this,
1263+
nsresult rv = mTooltipTimer->InitWithNamedFuncCallback(
1264+
sTooltipCallback,
1265+
this,
12651266
LookAndFeel::GetInt(LookAndFeel::eIntID_TooltipDelay, 500),
1266-
nsITimer::TYPE_ONE_SHOT);
1267+
nsITimer::TYPE_ONE_SHOT,
1268+
"ChromeTooltipListener::MouseMove");
12671269
if (NS_FAILED(rv)) {
12681270
mPossibleTooltipNode = nullptr;
12691271
}

docshell/shistory/nsSHEntryShared.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ class DestroyViewerEvent : public mozilla::Runnable
185185
{
186186
public:
187187
DestroyViewerEvent(nsIContentViewer* aViewer, nsIDocument* aDocument)
188-
: mViewer(aViewer)
188+
: mozilla::Runnable("DestroyViewerEvent")
189+
, mViewer(aViewer)
189190
, mDocument(aDocument)
190191
{
191192
}

0 commit comments

Comments
 (0)