Bug 1282658. Part 17 - rename and remove some functions. r=kaku
authorJW Wang <jwwang@mozilla.com>
Tue, 05 Jul 2016 17:00:28 +0800
changeset 303774 28c44b72633b5f94f60863f0fcec408e633db675
parent 303773 0468b7cedfcf9afdee4a37b79399bc4fa50d3aed
child 303775 78d2fb74e22f7d4858c88173071a5b6988c07389
push id30401
push usercbook@mozilla.com
push dateWed, 06 Jul 2016 09:40:34 +0000
treeherdermozilla-central@a7d6bb9e7d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1282658
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1282658. Part 17 - rename and remove some functions. r=kaku MozReview-Commit-ID: 1v8WOlz2671
dom/media/AccurateSeekTask.cpp
dom/media/AccurateSeekTask.h
--- a/dom/media/AccurateSeekTask.cpp
+++ b/dom/media/AccurateSeekTask.cpp
@@ -99,63 +99,35 @@ AccurateSeekTask::Seek(const media::Time
   mSeekRequest.Begin(mReader->Seek(mSeekJob.mTarget, aDuration)
     ->Then(OwnerThread(), __func__, this,
            &AccurateSeekTask::OnSeekResolved, &AccurateSeekTask::OnSeekRejected));
 
   return mSeekTaskPromise.Ensure(__func__);
 }
 
 void
-AccurateSeekTask::EnsureAudioDecodeTaskQueued()
+AccurateSeekTask::RequestAudioData()
 {
   AssertOwnerThread();
   MOZ_ASSERT(!mDoneAudioSeeking);
   MOZ_ASSERT(!mReader->IsRequestingAudioData());
   MOZ_ASSERT(!mReader->IsWaitingAudioData());
   mReader->RequestAudioData();
 }
 
 void
-AccurateSeekTask::EnsureVideoDecodeTaskQueued()
+AccurateSeekTask::RequestVideoData()
 {
   AssertOwnerThread();
   MOZ_ASSERT(!mDoneVideoSeeking);
   MOZ_ASSERT(!mReader->IsRequestingVideoData());
   MOZ_ASSERT(!mReader->IsWaitingVideoData());
   mReader->RequestVideoData(false, media::TimeUnit());
 }
 
-const char*
-AccurateSeekTask::AudioRequestStatus()
-{
-  AssertOwnerThread();
-
-  if (mReader->IsRequestingAudioData()) {
-    MOZ_DIAGNOSTIC_ASSERT(!mReader->IsWaitingAudioData());
-    return "pending";
-  } else if (mReader->IsWaitingAudioData()) {
-    return "waiting";
-  }
-  return "idle";
-}
-
-const char*
-AccurateSeekTask::VideoRequestStatus()
-{
-  AssertOwnerThread();
-
-  if (mReader->IsRequestingVideoData()) {
-    MOZ_DIAGNOSTIC_ASSERT(!mReader->IsWaitingVideoData());
-    return "pending";
-  } else if (mReader->IsWaitingVideoData()) {
-    return "waiting";
-  }
-  return "idle";
-}
-
 nsresult
 AccurateSeekTask::DropAudioUpToSeekTarget(MediaData* aSample)
 {
   AssertOwnerThread();
 
   RefPtr<AudioData> audio(aSample->As<AudioData>());
   MOZ_ASSERT(audio && mSeekJob.Exists() && mSeekJob.mTarget.IsAccurate());
 
@@ -283,20 +255,20 @@ void
 AccurateSeekTask::OnSeekResolved(media::TimeUnit)
 {
   AssertOwnerThread();
 
   mSeekRequest.Complete();
   // We must decode the first samples of active streams, so we can determine
   // the new stream time. So dispatch tasks to do that.
   if (!mDoneVideoSeeking) {
-    EnsureVideoDecodeTaskQueued();
+    RequestVideoData();
   }
   if (!mDoneAudioSeeking) {
-    EnsureAudioDecodeTaskQueued();
+    RequestAudioData();
   }
 }
 
 void
 AccurateSeekTask::OnSeekRejected(nsresult aResult)
 {
   AssertOwnerThread();
 
@@ -349,17 +321,17 @@ AccurateSeekTask::OnAudioDecoded(MediaDa
     mSeekedAudioData = audio;
     mDoneAudioSeeking = true;
   } else if (NS_FAILED(DropAudioUpToSeekTarget(audio))) {
     RejectIfExist(__func__);
     return;
   }
 
   if (!mDoneAudioSeeking) {
-    EnsureAudioDecodeTaskQueued();
+    RequestAudioData();
     return;
   }
   MaybeFinishSeek();
 }
 
 void
 AccurateSeekTask::OnNotDecoded(MediaData::Type aType,
                                MediaDecoderReader::NotDecodedReason aReason)
@@ -379,19 +351,19 @@ AccurateSeekTask::OnNotDecoded(MediaData
   // data arrives.
   if (aReason == MediaDecoderReader::WAITING_FOR_DATA) {
     mReader->WaitForData(aType);
     return;
   }
 
   if (aReason == MediaDecoderReader::CANCELED) {
     if (aType == MediaData::AUDIO_DATA) {
-      EnsureAudioDecodeTaskQueued();
+      RequestAudioData();
     } else {
-      EnsureVideoDecodeTaskQueued();
+      RequestVideoData();
     }
     return;
   }
 
   if (aReason == MediaDecoderReader::END_OF_STREAM) {
     if (aType == MediaData::AUDIO_DATA) {
       mIsAudioQueueFinished = true;
       mDoneAudioSeeking = true;
@@ -435,17 +407,17 @@ AccurateSeekTask::OnVideoDecoded(MediaDa
     mSeekedVideoData = video;
     mDoneVideoSeeking = true;
   } else if (NS_FAILED(DropVideoUpToSeekTarget(video.get()))) {
     RejectIfExist(__func__);
     return;
   }
 
   if (!mDoneVideoSeeking) {
-    EnsureVideoDecodeTaskQueued();
+    RequestVideoData();
     return;
   }
   MaybeFinishSeek();
 }
 
 void
 AccurateSeekTask::SetCallbacks()
 {
@@ -470,24 +442,24 @@ AccurateSeekTask::SetCallbacks()
       OnNotDecoded(MediaData::VIDEO_DATA,
         aData.as<MediaDecoderReader::NotDecodedReason>());
     }
   });
 
   mAudioWaitCallback = mReader->AudioWaitCallback().Connect(
     OwnerThread(), [this] (WaitCallbackData aData) {
     if (aData.is<MediaData::Type>()) {
-      EnsureAudioDecodeTaskQueued();
+      RequestAudioData();
     }
   });
 
   mVideoWaitCallback = mReader->VideoWaitCallback().Connect(
     OwnerThread(), [this] (WaitCallbackData aData) {
     if (aData.is<MediaData::Type>()) {
-      EnsureVideoDecodeTaskQueued();
+      RequestVideoData();
     }
   });
 }
 
 void
 AccurateSeekTask::CancelCallbacks()
 {
   AssertOwnerThread();
--- a/dom/media/AccurateSeekTask.h
+++ b/dom/media/AccurateSeekTask.h
@@ -28,23 +28,19 @@ public:
 
   RefPtr<SeekTaskPromise> Seek(const media::TimeUnit& aDuration) override;
 
   bool NeedToResetMDSM() const override;
 
 private:
   ~AccurateSeekTask();
 
-  void EnsureVideoDecodeTaskQueued();
-
-  void EnsureAudioDecodeTaskQueued();
+  void RequestVideoData();
 
-  const char* AudioRequestStatus();
-
-  const char* VideoRequestStatus();
+  void RequestAudioData();
 
   nsresult DropAudioUpToSeekTarget(MediaData* aSample);
 
   nsresult DropVideoUpToSeekTarget(MediaData* aSample);
 
   void MaybeFinishSeek();
 
   void OnSeekResolved(media::TimeUnit);