tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 551ebf0dfb122f7d43eb9e7a6f1778540fd5fa60
parent 2d8fef47e55b10b5ecd2cc151a72c9d632b43773
Author: Jens Stutte <jstutte@mozilla.com>
Date:   Tue, 25 Nov 2025 12:47:18 +0000

Bug 2001984 - Log IdleTaskRunner name on failing timer creation. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D273977

Diffstat:
Mxpcom/threads/IdleTaskRunner.cpp | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/xpcom/threads/IdleTaskRunner.cpp b/xpcom/threads/IdleTaskRunner.cpp @@ -238,6 +238,12 @@ void IdleTaskRunner::Schedule(bool aAllowIdleDispatch) { DebugOnly<nsresult> rv = mScheduleTimer->InitWithNamedFuncCallback( ScheduleTimedOut, this, waitToSchedule, nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY, mName); +#ifdef DEBUG + if (NS_FAILED(rv)) { + NS_WARNING(nsCString("Failed to set IdleTaskRunner timer for:"_ns + mName) + .get()); + } +#endif MOZ_ASSERT(NS_SUCCEEDED(rv)); } } @@ -282,6 +288,12 @@ void IdleTaskRunner::ResetTimer(TimeDuration aDelay) { DebugOnly<nsresult> rv = mTimer->InitWithNamedFuncCallback( TimedOut, this, aDelay.ToMilliseconds(), nsITimer::TYPE_ONE_SHOT, mName); +#ifdef DEBUG + if (NS_FAILED(rv)) { + NS_WARNING(nsCString("Failed to set IdleTaskRunner timer for:"_ns + mName) + .get()); + } +#endif MOZ_ASSERT(NS_SUCCEEDED(rv)); mTimerActive = true; }