Bug 1388668 - Replace NS_DispatchToCurrentThread call with AbstractThread dispatch. r?padenot draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 09 Aug 2017 17:02:52 +0800
changeset 643097 ae10136ac0881d296998917e38eca63abf0c5089
parent 643089 06215eec4f19a46dc5e7243f1be02a1bfb974ddf
child 725208 ef34e6bab97edf35b857eb2f2c600c05503b0d3b
push id72993
push userbmo:cpearce@mozilla.com
push dateWed, 09 Aug 2017 09:08:44 +0000
reviewerspadenot
bugs1388668
milestone57.0a1
Bug 1388668 - Replace NS_DispatchToCurrentThread call with AbstractThread dispatch. r?padenot We should be dispatching this event to a tab group so that it can be associated with it. MozReview-Commit-ID: FcEQD7cN2Xj
dom/media/webaudio/AudioDestinationNode.cpp
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -408,20 +408,21 @@ AudioDestinationNode::DestroyMediaStream
     MediaStreamGraph::DestroyNonRealtimeInstance(graph);
   }
   AudioNode::DestroyMediaStream();
 }
 
 void
 AudioDestinationNode::NotifyMainThreadStreamFinished()
 {
+  MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mStream->IsFinished());
 
   if (mIsOffline) {
-    NS_DispatchToCurrentThread(
+    AbstractMainThread()->Dispatch(
       NewRunnableMethod("dom::AudioDestinationNode::FireOfflineCompletionEvent",
                         this,
                         &AudioDestinationNode::FireOfflineCompletionEvent));
   }
 }
 
 void
 AudioDestinationNode::FireOfflineCompletionEvent()