Bug 1289976. Part 7 - Remove the IsShutdown() check from MediaDecoder::Seek(). r?kaku draft
authorJW Wang <jwwang@mozilla.com>
Wed, 27 Jul 2016 10:49:14 +0800
changeset 394663 048c9276f7a27fb51fa6e526842e29080bbee5c7
parent 394662 2823e093d2a6787544e180e659793f242ea7593c
child 394664 037c4523217cb7131867e5b8a83d36f16b2f5f39
push id24619
push userjwwang@mozilla.com
push dateSat, 30 Jul 2016 10:57:17 +0000
reviewerskaku
bugs1289976
milestone50.0a1
Bug 1289976. Part 7 - Remove the IsShutdown() check from MediaDecoder::Seek(). r?kaku 1. It is called from DurationChanged() which returns early when IsShutdown() is true. 2. It is called from Play() when IsEnded() is true. MozReview-Commit-ID: Ixy5OMZHxIm
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -794,17 +794,17 @@ MediaDecoder::Play()
   ChangeState(PLAY_STATE_PLAYING);
   return NS_OK;
 }
 
 nsresult
 MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType, dom::Promise* aPromise /*=nullptr*/)
 {
   MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_TRUE(!IsShutdown(), NS_ERROR_FAILURE);
+  MOZ_ASSERT(!IsShutdown());
 
   UpdateDormantState(false /* aDormantTimeout */, true /* aActivity */);
 
   MOZ_ASSERT(!mIsDormant, "should be out of dormant by now");
   MOZ_ASSERT(aTime >= 0.0, "Cannot seek to a negative value.");
 
   int64_t timeUsecs = TimeUnit::FromSeconds(aTime).ToMicroseconds();