зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1094248 - Process remaining Promise microtasks before blocking inside a nested event loop in the main thread. r=bz
This commit is contained in:
Родитель
ba9efacd5d
Коммит
b5b99e684e
|
@ -1026,6 +1026,13 @@ NS_IMETHODIMP
|
||||||
nsXPConnect::OnProcessNextEvent(nsIThreadInternal *aThread, bool aMayWait,
|
nsXPConnect::OnProcessNextEvent(nsIThreadInternal *aThread, bool aMayWait,
|
||||||
uint32_t aRecursionDepth)
|
uint32_t aRecursionDepth)
|
||||||
{
|
{
|
||||||
|
// If ProcessNextEvent was called during a Promise "then" callback, we
|
||||||
|
// must process any pending microtasks before blocking in the event loop,
|
||||||
|
// otherwise we may deadlock until an event enters the queue later.
|
||||||
|
if (aMayWait) {
|
||||||
|
Promise::PerformMicroTaskCheckpoint();
|
||||||
|
}
|
||||||
|
|
||||||
// Record this event.
|
// Record this event.
|
||||||
mEventDepth++;
|
mEventDepth++;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче