Bug 1373595. P2 - rename NotifyBytesDownloaded to NotifyDownloadProgressed to better describe what it actually does.
MozReview-Commit-ID: IOBY3UKAy0G
--- 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();