Bug 1241531 - Part 1: Only pop jobs from the queue when the correct job completes. r=ehsan, a=sylvestre
authorBen Kelly <ben@wanderview.com>
Thu, 21 Jan 2016 08:48:00 -0500
changeset 298509 b0e72ac2a04a7527b8dfdabf5f63059e749f7f11
parent 298508 e5961b5798f237b9d1d35c72f173eb2583a1ddb8
child 298510 e447e2dffa477e57a5337843595578c8d3cf0333
push id8972
push usercbook@mozilla.com
push dateMon, 25 Jan 2016 11:05:12 +0000
treeherdermozilla-aurora@840b94bdff0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, sylvestre
bugs1241531
milestone45.0a2
Bug 1241531 - Part 1: Only pop jobs from the queue when the correct job completes. r=ehsan, a=sylvestre
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -293,16 +293,19 @@ private:
 
   void
   Done(ServiceWorkerJob* aJob)
   {
     MOZ_ASSERT(aJob);
     QueueData& queue = GetQueue(aJob->mJobType);
     MOZ_ASSERT(!queue.mJobs.IsEmpty());
     MOZ_ASSERT(queue.mJobs[0] == aJob);
+    if (NS_WARN_IF(queue.mJobs[0] != aJob)) {
+      return;
+    }
     Pop(queue);
   }
 };
 
 namespace {
 
 nsresult
 PopulateRegistrationData(nsIPrincipal* aPrincipal,