Bug 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does. r=gerald
authorJW Wang <jwwang@mozilla.com>
Mon, 19 Jun 2017 11:01:13 +0800
changeset 364603 ea7d7376cc0806f6f2139c476b87e63fea4eb0df
parent 364602 0a2aef1e3d4d98922fbb9635a761a1ca64f5efdc
child 364604 302e0f95efed3ca9e693ca67439071eb24b67f16
push id32049
push usercbook@mozilla.com
push dateMon, 19 Jun 2017 11:36:23 +0000
treeherdermozilla-central@26d62a1ac0e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1373595
milestone56.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 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does. r=gerald 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();