Bug 1398417 - Fix PrioritizedEventQueue bugs with input event prioritization (r=stone)
authorBill McCloskey <billm@mozilla.com>
Fri, 08 Sep 2017 13:57:29 -0700
changeset 429729 ec8757f33153587f157da793a30e2488cd7bae86
parent 429728 da62db8d01c922953e0ddf6271352c07521bc6de
child 429730 f3f0ff3546ee61f2c4c9ded7648b9feb2e4f8b76
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstone
bugs1398417
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1398417 - Fix PrioritizedEventQueue bugs with input event prioritization (r=stone) MozReview-Commit-ID: 4wk8EUv0h7C
xpcom/threads/PrioritizedEventQueue.cpp
--- a/xpcom/threads/PrioritizedEventQueue.cpp
+++ b/xpcom/threads/PrioritizedEventQueue.cpp
@@ -117,17 +117,17 @@ template<class InnerQueueT>
 EventPriority
 PrioritizedEventQueue<InnerQueueT>::SelectQueue(bool aUpdateState,
                                                 const MutexAutoLock& aProofOfLock)
 {
   bool highPending = !mHighQueue->IsEmpty(aProofOfLock);
   bool normalPending = !mNormalQueue->IsEmpty(aProofOfLock);
   size_t inputCount = mInputQueue->Count(aProofOfLock);
 
-  if (aUpdateState && mInputQueueState == STATE_ENABLED &&
+  if (mInputQueueState == STATE_ENABLED &&
       mInputHandlingStartTime.IsNull() && inputCount > 0) {
     mInputHandlingStartTime =
       InputEventStatistics::Get()
       .GetInputHandlingStartTime(inputCount);
   }
 
   // We check the different queues in the following order. The conditions we use
   // are meant to avoid starvation and to ensure that we don't process an event
@@ -269,17 +269,17 @@ PrioritizedEventQueue<InnerQueueT>::HasR
 {
   mHasPendingEventsPromisedIdleEvent = false;
 
   EventPriority queue = SelectQueue(false, aProofOfLock);
 
   if (queue == EventPriority::High) {
     return mHighQueue->HasReadyEvent(aProofOfLock);
   } else if (queue == EventPriority::Input) {
-    return mIdleQueue->HasReadyEvent(aProofOfLock);
+    return mInputQueue->HasReadyEvent(aProofOfLock);
   } else if (queue == EventPriority::Normal) {
     return mNormalQueue->HasReadyEvent(aProofOfLock);
   }
 
   MOZ_ASSERT(queue == EventPriority::Idle);
 
   // If we get here, then both the high and normal queues are empty.