зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1283418 - In WorkerPrivate we often use !mSyncLoopStack.Length() instead mSyncLoopStack.IsEmpty(), r=smaug
This commit is contained in:
Родитель
f50985e2bc
Коммит
427fa3afd0
|
@ -5104,7 +5104,7 @@ WorkerPrivate::ClearMainEventQueue(WorkerRanOrNot aRanOrNot)
|
||||||
{
|
{
|
||||||
AssertIsOnWorkerThread();
|
AssertIsOnWorkerThread();
|
||||||
|
|
||||||
MOZ_ASSERT(!mSyncLoopStack.Length());
|
MOZ_ASSERT(mSyncLoopStack.IsEmpty());
|
||||||
MOZ_ASSERT(!mCancelAllPendingRunnables);
|
MOZ_ASSERT(!mCancelAllPendingRunnables);
|
||||||
mCancelAllPendingRunnables = true;
|
mCancelAllPendingRunnables = true;
|
||||||
|
|
||||||
|
@ -5502,7 +5502,7 @@ WorkerPrivate::DestroySyncLoop(uint32_t aLoopIndex, nsIThreadInternal* aThread)
|
||||||
|
|
||||||
MOZ_ALWAYS_SUCCEEDS(aThread->PopEventQueue(nestedEventTarget));
|
MOZ_ALWAYS_SUCCEEDS(aThread->PopEventQueue(nestedEventTarget));
|
||||||
|
|
||||||
if (!mSyncLoopStack.Length() && mPendingEventQueueClearing) {
|
if (mSyncLoopStack.IsEmpty() && mPendingEventQueueClearing) {
|
||||||
ClearMainEventQueue(WorkerRan);
|
ClearMainEventQueue(WorkerRan);
|
||||||
mPendingEventQueueClearing = false;
|
mPendingEventQueueClearing = false;
|
||||||
}
|
}
|
||||||
|
@ -5802,7 +5802,7 @@ WorkerPrivate::NotifyInternal(JSContext* aCx, Status aStatus)
|
||||||
if (previousStatus == Running) {
|
if (previousStatus == Running) {
|
||||||
// NB: If we're in a sync loop, we can't clear the queue immediately,
|
// NB: If we're in a sync loop, we can't clear the queue immediately,
|
||||||
// because this is the wrong queue. So we have to defer it until later.
|
// because this is the wrong queue. So we have to defer it until later.
|
||||||
if (mSyncLoopStack.Length()) {
|
if (!mSyncLoopStack.IsEmpty()) {
|
||||||
mPendingEventQueueClearing = true;
|
mPendingEventQueueClearing = true;
|
||||||
} else {
|
} else {
|
||||||
ClearMainEventQueue(WorkerRan);
|
ClearMainEventQueue(WorkerRan);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче