Bug 1390443. P2 - remove unused IsExpectingMoreData(). draft
authorJW Wang <jwwang@mozilla.com>
Wed, 16 Aug 2017 15:37:29 +0800
changeset 648150 498e2844d2d0d1cee087552f5aaf5aac7e34c3bf
parent 648149 6f60fad11b65e75b456e128f8414fe2ea545455f
child 648151 41e1c10f32465ca0abac61bbfd555ee89a8c67a1
push id74645
push userjwwang@mozilla.com
push dateThu, 17 Aug 2017 09:28:47 +0000
bugs1390443
milestone57.0a1
Bug 1390443. P2 - remove unused IsExpectingMoreData(). MozReview-Commit-ID: KTxmjIrD1WB
dom/media/MediaDecoderStateMachine.cpp
dom/media/MediaResource.h
dom/media/hls/HLSResource.h
dom/media/mediasource/MediaSourceResource.h
dom/media/mediasource/SourceBufferResource.h
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -255,24 +255,16 @@ protected:
   };
 
   using Master = MediaDecoderStateMachine;
   explicit StateObject(Master* aPtr) : mMaster(aPtr) { }
   TaskQueue* OwnerThread() const { return mMaster->mTaskQueue; }
   MediaResource* Resource() const { return mMaster->mResource; }
   ReaderProxy* Reader() const { return mMaster->mReader; }
   const MediaInfo& Info() const { return mMaster->Info(); }
-  bool IsExpectingMoreData() const
-  {
-    // We are expecting more data if either the resource states so, or if we
-    // have a waiting promise pending (such as with non-MSE EME).
-    return Resource()->IsExpectingMoreData()
-           || mMaster->IsWaitingAudioData()
-           || mMaster->IsWaitingVideoData();
-  }
   MediaQueue<AudioData>& AudioQueue() const { return mMaster->mAudioQueue; }
   MediaQueue<VideoData>& VideoQueue() const { return mMaster->mVideoQueue; }
 
   template <class S, typename... Args, size_t... Indexes>
   auto
   CallEnterMemberFunction(S* aS,
                           Tuple<Args...>& aTuple,
                           IndexSequence<Indexes...>)
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -209,25 +209,16 @@ public:
   // or -1 if there is no such cached data.
   virtual int64_t GetNextCachedData(int64_t aOffset) = 0;
   // Returns the end of the bytes starting at the given offset which are in
   // cache. Returns aOffset itself if there are zero bytes available there.
   virtual int64_t GetCachedDataEnd(int64_t aOffset) = 0;
   // Returns true if all the data from aOffset to the end of the stream
   // is in cache. If the end of the stream is not known, we return false.
   virtual bool IsDataCachedToEndOfResource(int64_t aOffset) = 0;
-  // Returns true if we are expecting any more data to arrive
-  // sometime in the not-too-distant future, either from the network or from
-  // an appendBuffer call on a MediaSource element.
-  virtual bool IsExpectingMoreData()
-  {
-    // MediaDecoder::mDecoderPosition is roughly the same as Tell() which
-    // returns a position updated by latest Read() or ReadAt().
-    return !IsDataCachedToEndOfResource(Tell()) && !IsSuspended();
-  }
   // Returns true if this stream is suspended by the cache because the
   // cache is full. If true then the decoder should try to start consuming
   // data, otherwise we may not be able to make progress.
   // MediaDecoder::NotifySuspendedStatusChanged is called when this
   // changes.
   // For resources using the media cache, this returns true only when all
   // streams for the same resource are all suspended.
   virtual bool IsSuspendedByCache() = 0;
--- a/dom/media/hls/HLSResource.h
+++ b/dom/media/hls/HLSResource.h
@@ -81,21 +81,16 @@ public:
 
   bool IsTransportSeekable() override { return true; }
 
   bool IsLiveStream() override
   {
     return false;
   }
 
-  bool IsExpectingMoreData() override
-  {
-    return false;
-  }
-
   java::GeckoHLSResourceWrapper::GlobalRef GetResourceWrapper() {
     return mHLSResourceWrapper;
   }
 
   void Detach() { mDecoder = nullptr; }
 
 private:
   friend class HLSResourceCallbacksSupport;
--- a/dom/media/mediasource/MediaSourceResource.h
+++ b/dom/media/mediasource/MediaSourceResource.h
@@ -65,22 +65,16 @@ public:
     return !mEnded;
   }
   void SetEnded(bool aEnded)
   {
     MonitorAutoLock mon(mMonitor);
     mEnded = aEnded;
   }
 
-  bool IsExpectingMoreData() override
-  {
-    MonitorAutoLock mon(mMonitor);
-    return !mEnded;
-  }
-
 private:
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t size = MediaResource::SizeOfExcludingThis(aMallocSizeOf);
     return size;
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
--- a/dom/media/mediasource/SourceBufferResource.h
+++ b/dom/media/mediasource/SourceBufferResource.h
@@ -117,21 +117,16 @@ public:
     return size;
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
-  bool IsExpectingMoreData() override
-  {
-    return false;
-  }
-
   // Used by SourceBuffer.
   void AppendData(MediaByteBuffer* aData);
   void Ended();
   bool IsEnded()
   {
     MOZ_ASSERT(OnTaskQueue());
     return mEnded;
   }