From 96e96d9ebc43de032552a340df22ddf6993e8a6b Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 10 Feb 2016 18:14:17 +1100 Subject: [PATCH] Bug 1245463: [MSE] P4. Remove dead code. r=gerald MozReview-Commit-ID: Elnm0WPuqHC --- dom/media/mediasource/TrackBuffersManager.cpp | 36 +++---------------- dom/media/mediasource/TrackBuffersManager.h | 4 +-- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp index e453c889d2a1..3361abf4a7da 100644 --- a/dom/media/mediasource/TrackBuffersManager.cpp +++ b/dom/media/mediasource/TrackBuffersManager.cpp @@ -173,20 +173,12 @@ TrackBuffersManager::ResetParserState() MSE_DEBUG(""); // 1. If the append state equals PARSING_MEDIA_SEGMENT and the input buffer contains some complete coded frames, then run the coded frame processing algorithm until all of these complete coded frames have been processed. - if (mAppendState == AppendState::PARSING_MEDIA_SEGMENT) { - nsCOMPtr task = - NS_NewRunnableMethod(this, &TrackBuffersManager::FinishCodedFrameProcessing); - GetTaskQueue()->Dispatch(task.forget()); - } else { - nsCOMPtr task = - NS_NewRunnableMethod(this, &TrackBuffersManager::CompleteResetParserState); - GetTaskQueue()->Dispatch(task.forget()); - } + // SourceBuffer.abort() has ensured that all complete coded frames have been + // processed. As such, we don't need to check for the value of mAppendState. + nsCOMPtr task = + NS_NewRunnableMethod(this, &TrackBuffersManager::CompleteResetParserState); + GetTaskQueue()->Dispatch(task.forget()); - // Our ResetParserState is really asynchronous, the current task has been - // interrupted and will complete shortly (or has already completed). - // We must however present to the main thread a stable, reset state. - // So we run the following operation now in the main thread. // 7. Set append state to WAITING_FOR_SEGMENT. SetAppendState(AppendState::WAITING_FOR_SEGMENT); } @@ -313,24 +305,6 @@ TrackBuffersManager::Dump(const char* aPath) } #endif -void -TrackBuffersManager::FinishCodedFrameProcessing() -{ - MOZ_ASSERT(OnTaskQueue()); - - if (mProcessingRequest.Exists()) { - NS_WARNING("Processing request pending"); - mProcessingRequest.Disconnect(); - } - // The spec requires us to complete parsing synchronously any outstanding - // frames in the current media segment. This can't be implemented in a way - // that makes sense. - // As such we simply completely ignore the result of any pending input buffer. - // TODO: Link to W3C bug. - - CompleteResetParserState(); -} - void TrackBuffersManager::CompleteResetParserState() { diff --git a/dom/media/mediasource/TrackBuffersManager.h b/dom/media/mediasource/TrackBuffersManager.h index 84766756992c..b4eb17ba8c45 100644 --- a/dom/media/mediasource/TrackBuffersManager.h +++ b/dom/media/mediasource/TrackBuffersManager.h @@ -123,9 +123,7 @@ private: // media segment have been processed. RefPtr CodedFrameProcessing(); void CompleteCodedFrameProcessing(); - // Called by ResetParserState. Complete parsing the input buffer for the - // current media segment. - void FinishCodedFrameProcessing(); + // Called by ResetParserState. void CompleteResetParserState(); RefPtr CodedFrameRemovalWithPromise(media::TimeInterval aInterval);