Bug 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 19 Jun 2017 11:01:13 +0800
changeset 596266 a01469efbba090d90cdd6980b0582afec396b389
parent 596265 7ca6fa4677c61c3cef6e3a1f9d9b2c869bc05120
child 596267 df42da71e716a1e23c5ebcb5e38768d2c3c63886
child 596342 7d0b8d3ad64000c1e3238f441e01b6644a06a129
push id64563
push userjwwang@mozilla.com
push dateMon, 19 Jun 2017 03:04:45 +0000
bugs1373595
milestone56.0a1
Bug 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does. MozReview-Commit-ID: IOBY3UKAy0G
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
dom/media/mediasource/SourceBuffer.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -199,17 +199,17 @@ MediaDecoder::ResourceCallback::TimerCal
 void
 MediaDecoder::ResourceCallback::NotifyDataArrived()
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (!mDecoder) {
     return;
   }
 
-  mDecoder->NotifyBytesDownloaded();
+  mDecoder->NotifyDownloadProgressed();
 
   if (mTimerArmed) {
     return;
   }
   // In situations where these notifications come from stochastic network
   // activity, we can save significant computation by throttling the
   // calls to MediaDecoder::NotifyDataArrived() which will update the buffer
   // ranges of the reader.
@@ -1040,17 +1040,17 @@ MediaDecoder::ShouldThrottleDownload()
     return false;
   }
   uint32_t factor =
     std::max(2u, Preferences::GetUint("media.throttle-factor", 2));
   return stats.mDownloadRate > factor * stats.mPlaybackRate;
 }
 
 void
-MediaDecoder::NotifyBytesDownloaded()
+MediaDecoder::NotifyDownloadProgressed()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
   UpdatePlaybackRate();
   GetOwner()->DownloadProgressed();
   mResource->ThrottleReadahead(ShouldThrottleDownload());
 }
 
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -250,17 +250,17 @@ public:
   // Return the duration of the video in seconds.
   virtual double GetDuration();
 
   // Return true if the stream is infinite (see SetInfinite).
   bool IsInfinite() const;
 
   // Called by MediaResource when some data has been received.
   // Call on the main thread only.
-  virtual void NotifyBytesDownloaded();
+  virtual void NotifyDownloadProgressed();
 
   // Called as data arrives on the stream and is read into the cache.  Called
   // on the main thread only.
   void NotifyDataArrived();
 
   // Return true if we are currently seeking in the media resource.
   // Call on the main thread only.
   bool IsSeeking() const;
--- a/dom/media/mediasource/SourceBuffer.cpp
+++ b/dom/media/mediasource/SourceBuffer.cpp
@@ -445,17 +445,17 @@ SourceBuffer::AppendDataCompletedWithSuc
                })
         ->Track(mCompletionPromise);
     }
   }
   if (mActive) {
     // Tell our parent decoder that we have received new data.
     mMediaSource->GetDecoder()->NotifyDataArrived();
     // Send progress event.
-    mMediaSource->GetDecoder()->NotifyBytesDownloaded();
+    mMediaSource->GetDecoder()->NotifyDownloadProgressed();
   }
 
   mCurrentAttributes = aResult.second();
 
   CheckEndTime();
 
   if (!mCompletionPromise.Exists()) {
     StopUpdating();