Bug 1283418 - In WorkerPrivate we often use !mSyncLoopStack.Length() instead mSyncLoopStack.IsEmpty(), r=smaug

This commit is contained in:
Andrea Marchesini 2016-07-04 08:18:53 +02:00
Родитель f50985e2bc
Коммит 427fa3afd0
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -5104,7 +5104,7 @@ WorkerPrivate::ClearMainEventQueue(WorkerRanOrNot aRanOrNot)
{
AssertIsOnWorkerThread();
MOZ_ASSERT(!mSyncLoopStack.Length());
MOZ_ASSERT(mSyncLoopStack.IsEmpty());
MOZ_ASSERT(!mCancelAllPendingRunnables);
mCancelAllPendingRunnables = true;
@ -5502,7 +5502,7 @@ WorkerPrivate::DestroySyncLoop(uint32_t aLoopIndex, nsIThreadInternal* aThread)
MOZ_ALWAYS_SUCCEEDS(aThread->PopEventQueue(nestedEventTarget));
if (!mSyncLoopStack.Length() && mPendingEventQueueClearing) {
if (mSyncLoopStack.IsEmpty() && mPendingEventQueueClearing) {
ClearMainEventQueue(WorkerRan);
mPendingEventQueueClearing = false;
}
@ -5802,7 +5802,7 @@ WorkerPrivate::NotifyInternal(JSContext* aCx, Status aStatus)
if (previousStatus == Running) {
// 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.
if (mSyncLoopStack.Length()) {
if (!mSyncLoopStack.IsEmpty()) {
mPendingEventQueueClearing = true;
} else {
ClearMainEventQueue(WorkerRan);