зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1268160: Assert that PostIdleTask is only used on the main thread. r=jld
This commit is contained in:
Родитель
6277b426b1
Коммит
d3cc4b02b6
|
@ -271,6 +271,7 @@ void MessageLoop::PostDelayedTask(already_AddRefed<Runnable> task, int delay_ms)
|
|||
|
||||
void MessageLoop::PostIdleTask(already_AddRefed<Runnable> task) {
|
||||
DCHECK(current() == this);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
PendingTask pending_task(Move(task), false);
|
||||
deferred_non_nestable_work_queue_.push(Move(pending_task));
|
||||
|
|
|
@ -356,7 +356,8 @@ MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate* aDelegate)
|
|||
continue;
|
||||
}
|
||||
|
||||
didWork = aDelegate->DoIdleWork();
|
||||
DebugOnly<bool> didIdleWork = aDelegate->DoIdleWork();
|
||||
MOZ_ASSERT(!didIdleWork);
|
||||
if (!keep_running_) {
|
||||
break;
|
||||
}
|
||||
|
@ -418,7 +419,8 @@ MessagePumpForNonMainUIThreads::DoRunLoop()
|
|||
continue;
|
||||
}
|
||||
|
||||
didWork = state_->delegate->DoIdleWork();
|
||||
DebugOnly<bool> didIdleWork = state_->delegate->DoIdleWork();
|
||||
MOZ_ASSERT(!didIdleWork);
|
||||
CHECK_QUIT_STATE
|
||||
|
||||
SetInWait();
|
||||
|
|
|
@ -13,8 +13,8 @@ interface nsIRunnable;
|
|||
* or may not make sense for you to use this interface. If you're calling from
|
||||
* JS, you don't have a choice!
|
||||
*
|
||||
* Right now, you can only call PostIdleTask(), but nothing is stopping you
|
||||
* from adding other methods.
|
||||
* Right now, you can only call PostIdleTask(), and the wrath of khuey is
|
||||
* stopping you from adding other methods.
|
||||
*
|
||||
* nsIMessageLoop's contractid is "@mozilla.org/message-loop;1".
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче