Bug 1241531 - Part 1: Only pop jobs from the queue when the correct job completes. r=ehsan
authorBen Kelly <ben@wanderview.com>
Thu, 21 Jan 2016 08:48:00 -0500
changeset 281183 cca3ee01a8623c5f5d82ffd14a71f8efa70ae732
parent 281182 7ac2a3d757a9f6373c1d8a654ed99992fd912189
child 281184 62452453a63600b7cb86ab72b2d4540ee4462907
push id29930
push usercbook@mozilla.com
push dateFri, 22 Jan 2016 11:05:50 +0000
treeherdermozilla-central@7104d650a97d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1241531
milestone46.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 1241531 - Part 1: Only pop jobs from the queue when the correct job completes. r=ehsan
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,