Bug 1317576. Part 3 - remove unused parameter/member. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 14 Nov 2016 16:47:07 +0800
changeset 439470 920ba568111fa3614821480687197b916bb6007c
parent 439469 c5c141c6d03920aab2012835f40bdf63a85c13a5
child 439471 8cbf64a955d6d47dc8ae0436738ed9258eafa530
push id36009
push userjwwang@mozilla.com
push dateWed, 16 Nov 2016 02:24:06 +0000
bugs1317576
milestone53.0a1
Bug 1317576. Part 3 - remove unused parameter/member. MozReview-Commit-ID: Ff6a8MKVY8q
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
dom/media/MediaDecoderStateMachine.cpp
dom/media/SeekJob.cpp
dom/media/SeekJob.h
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1126,36 +1126,28 @@ MediaDecoder::NotifyBytesConsumed(int64_
 
 void
 MediaDecoder::OnSeekResolved(SeekResolveValue aVal)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!IsShutdown());
   mSeekRequest.Complete();
 
-  bool fireEnded = false;
   {
     // An additional seek was requested while the current seek was
     // in operation.
     UnpinForSeek();
-    fireEnded = aVal.mAtEnd;
-    if (aVal.mAtEnd) {
-      ChangeState(PLAY_STATE_ENDED);
-    }
     mLogicallySeeking = false;
   }
 
   // Ensure logical position is updated after seek.
   UpdateLogicalPositionInternal();
 
   mOwner->SeekCompleted();
   AsyncResolveSeekDOMPromiseIfExists();
-  if (fireEnded) {
-    mOwner->PlaybackEnded();
-  }
 }
 
 void
 MediaDecoder::OnSeekRejected()
 {
   MOZ_ASSERT(NS_IsMainThread());
   mSeekRequest.Complete();
   mLogicallySeeking = false;
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -54,17 +54,16 @@ enum class MediaEventType : int8_t;
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 
 class MediaDecoder : public AbstractMediaDecoder
 {
 public:
   struct SeekResolveValue {
-    bool mAtEnd;
   };
 
   // Used to register with MediaResource to receive notifications which will
   // be forwarded to MediaDecoder.
   class ResourceCallback : public MediaResourceCallback {
     // Throttle calls to MediaDecoder::NotifyDataArrived()
     // to be at most once per 500ms.
     static const uint32_t sDelay = 500;
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1506,17 +1506,17 @@ SeekingState::SeekCompleted()
     // this when playing a live stream, since the end of media will advance
     // once we download more data!
     AudioQueue().Finish();
     VideoQueue().Finish();
   }
 
   // We want to resolve the seek request prior finishing the first frame
   // to ensure that the seeked event is fired prior loadeded.
-  mSeekJob.Resolve(false, __func__);
+  mSeekJob.Resolve(__func__);
 
   // Notify FirstFrameLoaded now if we haven't since we've decoded some data
   // for readyState to transition to HAVE_CURRENT_DATA and fire 'loadeddata'.
   if (!mMaster->mSentFirstFrameLoadedEvent) {
     // Only MSE can start seeking before finishing decoding first frames.
     MOZ_ASSERT(Reader()->ForceZeroStartTime());
     mMaster->FinishDecodeFirstFrame();
   }
--- a/dom/media/SeekJob.cpp
+++ b/dom/media/SeekJob.cpp
@@ -34,20 +34,19 @@ SeekJob& SeekJob::operator=(SeekJob&& aO
 }
 
 bool SeekJob::Exists() const
 {
   MOZ_ASSERT(mTarget.IsValid() == !mPromise.IsEmpty());
   return mTarget.IsValid();
 }
 
-void SeekJob::Resolve(bool aAtEnd, const char* aCallSite)
+void SeekJob::Resolve(const char* aCallSite)
 {
   MediaDecoder::SeekResolveValue val;
-  val.mAtEnd = aAtEnd;
   mPromise.Resolve(val, aCallSite);
   mTarget.Reset();
 }
 
 void SeekJob::RejectIfExists(const char* aCallSite)
 {
   mTarget.Reset();
   mPromise.RejectIfExists(true, aCallSite);
--- a/dom/media/SeekJob.h
+++ b/dom/media/SeekJob.h
@@ -18,17 +18,17 @@ struct SeekJob {
   SeekJob();
 
   SeekJob(SeekJob&& aOther);
 
   SeekJob& operator=(SeekJob&& aOther);
 
   bool Exists() const;
 
-  void Resolve(bool aAtEnd, const char* aCallSite);
+  void Resolve(const char* aCallSite);
 
   void RejectIfExists(const char* aCallSite);
 
   ~SeekJob();
 
   SeekTarget mTarget;
   MozPromiseHolder<MediaDecoder::SeekPromise> mPromise;
 };