Bug 1412189 - Avoid main-thread access in PrioritizedEventQueue::SelectQueue (r=stone)

MozReview-Commit-ID: GY43FXgqr2h
This commit is contained in:
Bill McCloskey 2017-09-20 12:18:51 -07:00
Родитель b2b66a61f5
Коммит 38f2553236
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -124,8 +124,10 @@ PrioritizedEventQueue<InnerQueueT>::SelectQueue(bool aUpdateState,
bool normalPending = !mNormalQueue->IsEmpty(aProofOfLock);
size_t inputCount = mInputQueue->Count(aProofOfLock);
if (mInputQueueState == STATE_ENABLED &&
mInputHandlingStartTime.IsNull() && inputCount > 0) {
if (aUpdateState &&
mInputQueueState == STATE_ENABLED &&
mInputHandlingStartTime.IsNull() &&
inputCount > 0) {
mInputHandlingStartTime =
InputEventStatistics::Get()
.GetInputHandlingStartTime(inputCount);
@ -156,6 +158,7 @@ PrioritizedEventQueue<InnerQueueT>::SelectQueue(bool aUpdateState,
queue = EventPriority::High;
} else if (inputCount > 0 && (mInputQueueState == STATE_FLUSHING ||
(mInputQueueState == STATE_ENABLED &&
!mInputHandlingStartTime.IsNull() &&
TimeStamp::Now() > mInputHandlingStartTime))) {
queue = EventPriority::Input;
} else if (normalPending) {