Bug 1265315. Part 2 - rename mReaderWrapper to mReader for less verbose coding. r=kaku.
authorJW Wang <jwwang@mozilla.com>
Tue, 19 Apr 2016 16:14:46 +0800
changeset 331711 0fcee6752011b2dbcab1c9622074ce4b13bfae21
parent 331710 1ba90ff2774850a64bfaf5aceeca683bb09ac044
child 331712 e3a467fdf81a3e8c6a9a2eee60d0d12b5821c26f
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaku
bugs1265315
milestone48.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 1265315. Part 2 - rename mReaderWrapper to mReader for less verbose coding. r=kaku. MozReview-Commit-ID: B9chDJU3ei6
dom/media/SeekTask.cpp
dom/media/SeekTask.h
--- a/dom/media/SeekTask.cpp
+++ b/dom/media/SeekTask.cpp
@@ -33,39 +33,39 @@ extern LazyLogModule gMediaSampleLog;
 // when __VA_ARGS__ expands to nothing. This is a workaround for it.
 #define DECODER_WARN_HELPER(a, b) NS_WARNING b
 #define DECODER_WARN(x, ...) \
   DECODER_WARN_HELPER(0, (nsPrintfCString("Decoder=%p " x, mDecoderID, ##__VA_ARGS__).get()))
 
 /*static*/ already_AddRefed<SeekTask>
 SeekTask::CreateSeekTask(const void* aDecoderID,
                          AbstractThread* aThread,
-                         MediaDecoderReaderWrapper* aReaderWrapper,
+                         MediaDecoderReaderWrapper* aReader,
                          SeekJob&& aSeekJob,
                          const MediaInfo& aInfo,
                          const media::TimeUnit& aDuration,
                          int64_t aCurrentMediaTime)
 {
   RefPtr<SeekTask> task(new SeekTask(aDecoderID, aThread,
-                                     aReaderWrapper, Move(aSeekJob), aInfo,
+                                     aReader, Move(aSeekJob), aInfo,
                                      aDuration, aCurrentMediaTime));
 
   return task.forget();
 }
 
 SeekTask::SeekTask(const void* aDecoderID,
                    AbstractThread* aThread,
-                   MediaDecoderReaderWrapper* aReaderWrapper,
+                   MediaDecoderReaderWrapper* aReader,
                    SeekJob&& aSeekJob,
                    const MediaInfo& aInfo,
                    const media::TimeUnit& aDuration,
                    int64_t aCurrentMediaTime)
   : mDecoderID(aDecoderID)
   , mOwnerThread(aThread)
-  , mReaderWrapper(aReaderWrapper)
+  , mReader(aReader)
   , mSeekJob(Move(aSeekJob))
   , mCurrentTimeBeforeSeek(aCurrentMediaTime)
   , mAudioRate(aInfo.mAudio.mRate)
   , mHasAudio(aInfo.HasAudio())
   , mHasVideo(aInfo.HasVideo())
   , mDropAudioUntilNextDiscontinuity(false)
   , mDropVideoUntilNextDiscontinuity(false)
   , mIsDiscarded(false)
@@ -181,17 +181,17 @@ SeekTask::Exists()
 }
 
 RefPtr<SeekTask::SeekTaskPromise>
 SeekTask::Seek(const media::TimeUnit& aDuration)
 {
   AssertOwnerThread();
 
   // Do the seek.
-  mSeekRequest.Begin(mReaderWrapper->Seek(mSeekJob.mTarget, aDuration)
+  mSeekRequest.Begin(mReader->Seek(mSeekJob.mTarget, aDuration)
     ->Then(OwnerThread(), __func__, this,
            &SeekTask::OnSeekResolved, &SeekTask::OnSeekRejected));
 
   return mSeekTaskPromise.Ensure(__func__);
 }
 
 bool
 SeekTask::IsVideoDecoding() const
@@ -272,37 +272,37 @@ SeekTask::VideoRequestStatus()
 }
 
 void
 SeekTask::RequestAudioData()
 {
   AssertOwnerThread();
 
   SAMPLE_LOG("Queueing audio task - queued=%i, decoder-queued=%o",
-             !!mSeekedAudioData, mReaderWrapper->SizeOfAudioQueueInFrames());
+             !!mSeekedAudioData, mReader->SizeOfAudioQueueInFrames());
 
-  mAudioDataRequest.Begin(mReaderWrapper->RequestAudioData()
+  mAudioDataRequest.Begin(mReader->RequestAudioData()
     ->Then(OwnerThread(), __func__, this,
            &SeekTask::OnAudioDecoded, &SeekTask::OnAudioNotDecoded));
 }
 
 void
 SeekTask::RequestVideoData()
 {
   AssertOwnerThread();
   //These two variables are not used in the SEEKING state.
   const bool skipToNextKeyFrame = false;
   const media::TimeUnit currentTime = media::TimeUnit::FromMicroseconds(0);
 
   SAMPLE_LOG("Queueing video task - queued=%i, decoder-queued=%o, skip=%i, time=%lld",
-               !!mSeekedVideoData, mReaderWrapper->SizeOfVideoQueueInFrames(), skipToNextKeyFrame,
+               !!mSeekedVideoData, mReader->SizeOfVideoQueueInFrames(), skipToNextKeyFrame,
                currentTime.ToMicroseconds());
 
   mVideoDataRequest.Begin(
-    mReaderWrapper->RequestVideoData(skipToNextKeyFrame, currentTime)
+    mReader->RequestVideoData(skipToNextKeyFrame, currentTime)
     ->Then(OwnerThread(), __func__, this,
            &SeekTask::OnVideoDecoded, &SeekTask::OnVideoNotDecoded));
 }
 
 nsresult
 SeekTask::DropAudioUpToSeekTarget(MediaData* aSample)
 {
   AssertOwnerThread();
@@ -559,20 +559,20 @@ SeekTask::OnAudioNotDecoded(MediaDecoder
     // If this is a decode error, delegate to the generic error path.
     RejectIfExist(__func__);
     return;
   }
 
   // If the decoder is waiting for data, we tell it to call us back when the
   // data arrives.
   if (aReason == MediaDecoderReader::WAITING_FOR_DATA) {
-    MOZ_ASSERT(mReaderWrapper->IsWaitForDataSupported(),
+    MOZ_ASSERT(mReader->IsWaitForDataSupported(),
                "Readers that send WAITING_FOR_DATA need to implement WaitForData");
     RefPtr<SeekTask> self = this;
-    mAudioWaitRequest.Begin(mReaderWrapper->WaitForData(MediaData::AUDIO_DATA)
+    mAudioWaitRequest.Begin(mReader->WaitForData(MediaData::AUDIO_DATA)
       ->Then(OwnerThread(), __func__,
              [self] (MediaData::Type aType) -> void {
                self->mAudioWaitRequest.Complete();
                self->EnsureAudioDecodeTaskQueued();
              },
              [self] (WaitForDataRejectValue aRejection) -> void {
                self->mAudioWaitRequest.Complete();
              }));
@@ -663,20 +663,20 @@ SeekTask::OnVideoNotDecoded(MediaDecoder
     // If this is a decode error, delegate to the generic error path.
     RejectIfExist(__func__);
     return;
   }
 
   // If the decoder is waiting for data, we tell it to call us back when the
   // data arrives.
   if (aReason == MediaDecoderReader::WAITING_FOR_DATA) {
-    MOZ_ASSERT(mReaderWrapper->IsWaitForDataSupported(),
+    MOZ_ASSERT(mReader->IsWaitForDataSupported(),
                "Readers that send WAITING_FOR_DATA need to implement WaitForData");
     RefPtr<SeekTask> self = this;
-    mVideoWaitRequest.Begin(mReaderWrapper->WaitForData(MediaData::VIDEO_DATA)
+    mVideoWaitRequest.Begin(mReader->WaitForData(MediaData::VIDEO_DATA)
       ->Then(OwnerThread(), __func__,
              [self] (MediaData::Type aType) -> void {
                self->mVideoWaitRequest.Complete();
                self->EnsureVideoDecodeTaskQueued();
              },
              [self] (WaitForDataRejectValue aRejection) -> void {
                self->mVideoWaitRequest.Complete();
              }));
--- a/dom/media/SeekTask.h
+++ b/dom/media/SeekTask.h
@@ -43,17 +43,17 @@ public:
   static const bool IsExclusive = true;
 
   using SeekTaskPromise =
     MozPromise<SeekTaskResolveValue, SeekTaskRejectValue, IsExclusive>;
 
   static already_AddRefed<SeekTask>
   CreateSeekTask(const void* aDecoderID,
                  AbstractThread* aThread,
-                 MediaDecoderReaderWrapper* aReaderWrapper,
+                 MediaDecoderReaderWrapper* aReader,
                  SeekJob&& aSeekJob,
                  const MediaInfo& aInfo,
                  const media::TimeUnit& aDuration,
                  int64_t aCurrentMediaTime);
 
   virtual void Discard();
 
   virtual RefPtr<SeekTaskPromise> Seek(const media::TimeUnit& aDuration);
@@ -62,17 +62,17 @@ public:
 
   SeekJob& GetSeekJob();
 
   bool Exists();
 
 protected:
   SeekTask(const void* aDecoderID,
            AbstractThread* aThread,
-           MediaDecoderReaderWrapper* aReaderWrapper,
+           MediaDecoderReaderWrapper* aReader,
            SeekJob&& aSeekJob,
            const MediaInfo& aInfo,
            const media::TimeUnit& aDuration,
            int64_t aCurrentMediaTime);
 
   virtual ~SeekTask();
 
   void Resolve(const char* aCallSite);
@@ -127,17 +127,17 @@ protected:
 
   virtual void OnVideoNotDecoded(MediaDecoderReader::NotDecodedReason aReason);
 
   /*
    * Data shared with MDSM.
    */
   const void* mDecoderID; // For logging.
   const RefPtr<AbstractThread> mOwnerThread;
-  const RefPtr<MediaDecoderReaderWrapper> mReaderWrapper;
+  const RefPtr<MediaDecoderReaderWrapper> mReader;
 
   /*
    * Internal state.
    */
   SeekJob mSeekJob;
   MozPromiseHolder<SeekTaskPromise> mSeekTaskPromise;
   int64_t mCurrentTimeBeforeSeek;
   const uint32_t mAudioRate;  // Audio sample rate.