From 6aa248ee6020407f6010e3f27c0371f40ae5626f Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 23 Mar 2015 16:15:54 -0700 Subject: [PATCH] Bug 1136827 - Stop proxying DecodeError to the decode thread. r=mattwoodrow At this point, all the callers actually call it on the state machine thread, where it belongs. --- dom/media/MediaDecoderStateMachine.cpp | 23 ++--------------------- dom/media/MediaDecoderStateMachine.h | 3 --- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 5f6f034e49f7..6aa3c44a6c5d 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -930,13 +930,6 @@ MediaDecoderStateMachine::OnNotDecoded(MediaData::Type aType, } } -void -MediaDecoderStateMachine::AcquireMonitorAndInvokeDecodeError() -{ - ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); - DecodeError(); -} - void MediaDecoderStateMachine::MaybeFinishDecodeFirstFrame() { @@ -2096,25 +2089,13 @@ bool MediaDecoderStateMachine::HasLowUndecodedData(int64_t aUsecs) void MediaDecoderStateMachine::DecodeError() { - AssertCurrentThreadInMonitor(); + MOZ_ASSERT(OnStateMachineThread()); + ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); if (mState == DECODER_STATE_SHUTDOWN) { // Already shutdown. return; } - // DecodeError should probably be redesigned so that it doesn't need to run - // on the Decode Task Queue, but this does the trick for now. - if (!OnDecodeThread()) { - RefPtr task( - NS_NewRunnableMethod(this, &MediaDecoderStateMachine::AcquireMonitorAndInvokeDecodeError)); - nsresult rv = DecodeTaskQueue()->Dispatch(task); - - if (NS_FAILED(rv)) { - DECODER_WARN("Failed to dispatch AcquireMonitorAndInvokeDecodeError"); - } - return; - } - // Change state to shutdown before sending error report to MediaDecoder // and the HTMLMediaElement, so that our pipeline can start exiting // cleanly during the sync dispatch below. diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index a5af50e265e8..a783f6f5d3da 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -410,9 +410,6 @@ public: // and aborting all pending operations on the decode task queue. void Reset(); -private: - void AcquireMonitorAndInvokeDecodeError(); - protected: virtual ~MediaDecoderStateMachine();