Bug 1292449. Part 1 - Assert IsShutdown() is false in NotifyDataArrived(). r=jya
authorJW Wang <jwwang@mozilla.com>
Mon, 01 Aug 2016 15:58:10 +0800
changeset 308529 c39c23a88c7a8cd54ee94cc345e9bdeef77c932a
parent 308528 1ed87253fdf1d9e8e6c3a5280a4441cebe7bcf06
child 308530 a62419846b2f5e386115cc4bf78e6d2066e278bc
push id31133
push userjwwang@mozilla.com
push dateMon, 08 Aug 2016 03:37:28 +0000
treeherderautoland@e47457d354ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1292449
milestone51.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 1292449. Part 1 - Assert IsShutdown() is false in NotifyDataArrived(). r=jya 1. Called from SourceBuffer::AppendDataCompletedWithSuccess() where mMediaSource->GetDecoder() is not null so this must happen before Shutdown(). 2. Called from SourceBuffer::Ended() where mMediaSource->GetDecoder() is not null. 3. Called from MediaDecoder::ResourceCallback::TimerCallback() which is canceled in Disconnect(). MozReview-Commit-ID: 5dqVuOcrABy
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1648,22 +1648,17 @@ void MediaDecoder::AddSizeOfResources(Re
   if (GetResource()) {
     aSizes->mByteSize += GetResource()->SizeOfIncludingThis(aSizes->mMallocSizeOf);
   }
 }
 
 void
 MediaDecoder::NotifyDataArrived() {
   MOZ_ASSERT(NS_IsMainThread());
-
-  // Don't publish events since task queues might be shutting down.
-  if (IsShutdown()) {
-    return;
-  }
-
+  MOZ_ASSERT(!IsShutdown());
   mDataArrivedEvent.Notify();
 }
 
 // Provide access to the state machine object
 MediaDecoderStateMachine*
 MediaDecoder::GetStateMachine() const {
   MOZ_ASSERT(NS_IsMainThread());
   return mDecoderStateMachine;