Bug 1039884 - Let ControlMessages added by runnables in stable state be run during shutdown. r=roc r=karlt
authorAndreas Pehrson <pehrsons@gmail.com>
Thu, 08 Jan 2015 06:21:00 +0100
changeset 248699 2e983faaa3a5b7751b856e9fba4af91a4659534c
parent 248698 59452425e446c374a486169652abfff985df6759
child 248700 5f8dbb4956752d9759c92ac84b37c79d046805d2
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, karlt
bugs1039884
milestone37.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 1039884 - Let ControlMessages added by runnables in stable state be run during shutdown. r=roc r=karlt
dom/media/MediaStreamGraph.cpp
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1708,27 +1708,28 @@ MediaStreamGraphImpl::RunInStableState(b
   }
 
   // Make sure we get a new current time in the next event loop task
   if (!aSourceIsMSG) {
     MOZ_ASSERT(mPostedRunInStableState);
     mPostedRunInStableState = false;
   }
 
-  for (uint32_t i = 0; i < runnables.Length(); ++i) {
-    runnables[i]->Run();
-  }
   for (uint32_t i = 0; i < controlMessagesToRunDuringShutdown.Length(); ++i) {
     controlMessagesToRunDuringShutdown[i]->RunDuringShutdown();
   }
 
 #ifdef DEBUG
   mCanRunMessagesSynchronously = mDetectedNotRunning &&
     mLifecycleState >= LIFECYCLE_WAITING_FOR_THREAD_SHUTDOWN;
 #endif
+
+  for (uint32_t i = 0; i < runnables.Length(); ++i) {
+    runnables[i]->Run();
+  }
 }
 
 
 static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
 
 void
 MediaStreamGraphImpl::EnsureRunInStableState()
 {