Bug 1292449. Part 1 - Assert IsShutdown() is false in NotifyDataArrived(). draft
authorJW Wang <jwwang@mozilla.com>
Mon, 01 Aug 2016 15:58:10 +0800
changeset 397120 a2508b56bd12ff02803caf004f9f9424dfd0a043
parent 397119 9ac81b79d4f0849fa4cfb8cecbdbfe49218681aa
child 397121 f65ed4759fc43837d60ff6bbb46b52216bd5c917
push id25207
push userjwwang@mozilla.com
push dateFri, 05 Aug 2016 07:05:11 +0000
bugs1292449
milestone51.0a1
Bug 1292449. Part 1 - Assert IsShutdown() is false in NotifyDataArrived(). 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
@@ -1647,22 +1647,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;