Bug 1398423 - Fix LabeledEventQueue bug with unlabeled events (r=froydnj)
authorBill McCloskey <billm@mozilla.com>
Fri, 08 Sep 2017 15:55:06 -0700
changeset 429732 cf8105474157f0da838eba590812e923044f6a35
parent 429731 96767196afa83853df8212c03c4db443f2686989
child 429733 a4eac2ea9733b33d1ee69d09d910739d736d5bca
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)
reviewersfroydnj
bugs1398423
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 1398423 - Fix LabeledEventQueue bug with unlabeled events (r=froydnj) MozReview-Commit-ID: 7ru62QTkya2
xpcom/threads/LabeledEventQueue.cpp
--- a/xpcom/threads/LabeledEventQueue.cpp
+++ b/xpcom/threads/LabeledEventQueue.cpp
@@ -157,23 +157,25 @@ LabeledEventQueue::GetEvent(EventPriorit
 {
   if (mEpochs.IsEmpty()) {
     return nullptr;
   }
 
   Epoch epoch = mEpochs.FirstElement();
   if (!epoch.IsLabeled()) {
     QueueEntry entry = mUnlabeled.FirstElement();
-    if (IsReadyToRun(entry.mRunnable, nullptr)) {
-      PopEpoch();
-      mUnlabeled.Pop();
-      MOZ_ASSERT(entry.mEpochNumber == epoch.mEpochNumber);
-      MOZ_ASSERT(entry.mRunnable.get());
-      return entry.mRunnable.forget();
+    if (!IsReadyToRun(entry.mRunnable, nullptr)) {
+      return nullptr;
     }
+
+    PopEpoch();
+    mUnlabeled.Pop();
+    MOZ_ASSERT(entry.mEpochNumber == epoch.mEpochNumber);
+    MOZ_ASSERT(entry.mRunnable.get());
+    return entry.mRunnable.forget();
   }
 
   if (!sCurrentSchedulerGroup) {
     return nullptr;
   }
 
   // Move active tabs to the front of the queue. The mAvoidActiveTabCount field
   // prevents us from preferentially processing events from active tabs twice in