diff --git a/xpcom/threads/IdleTaskRunner.cpp b/xpcom/threads/IdleTaskRunner.cpp index 0ea4b8d425a6..404410bec867 100644 --- a/xpcom/threads/IdleTaskRunner.cpp +++ b/xpcom/threads/IdleTaskRunner.cpp @@ -84,6 +84,7 @@ void IdleTaskRunner::SetBudget(int64_t aBudget) { void IdleTaskRunner::SetTimer(uint32_t aDelay, nsIEventTarget* aTarget) { MOZ_ASSERT(NS_IsMainThread()); + MOZ_ASSERT(aTarget->IsOnCurrentThread()); // aTarget is always the main thread event target provided from // NS_DispatchToCurrentThreadQueue(). We ignore aTarget here to ensure that // CollectorRunner always run specifically the main thread. diff --git a/xpcom/threads/IdleTaskRunner.h b/xpcom/threads/IdleTaskRunner.h index 7063d7b1dc26..93a55b3d7f4c 100644 --- a/xpcom/threads/IdleTaskRunner.h +++ b/xpcom/threads/IdleTaskRunner.h @@ -14,11 +14,10 @@ namespace mozilla { -// A general purpose repeating callback runner (it can be configured -// to a one-time runner, too.) If it is running repeatedly, -// one has to either explicitly Cancel() the runner or have -// MayContinueProcessing() callback return false to completely remove -// the runner. +// A general purpose repeating callback runner (it can be configured to a +// one-time runner, too.) If it is running repeatedly, one has to either +// explicitly Cancel() the runner or have MayStopProcessing() callback return +// true to completely remove the runner. class IdleTaskRunner final : public CancelableIdleRunnable { public: // Return true if some meaningful work was done.