mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1028146 - Remove dangerous public destructor of MediaChannelStatistics. r=cpearce
This commit is contained in:
parent
8bbe3536e3
commit
5c98e287b8
@ -429,6 +429,7 @@ MediaDecoder::MediaDecoder() :
|
||||
mIgnoreProgressData(false),
|
||||
mInfiniteStream(false),
|
||||
mOwner(nullptr),
|
||||
mPlaybackStatistics(new MediaChannelStatistics()),
|
||||
mPinnedForSeek(false),
|
||||
mShuttingDown(false),
|
||||
mPausedForPlaybackRateNull(false),
|
||||
@ -940,7 +941,7 @@ double MediaDecoder::ComputePlaybackRate(bool* aReliable)
|
||||
*aReliable = true;
|
||||
return length * static_cast<double>(USECS_PER_S) / mDuration;
|
||||
}
|
||||
return mPlaybackStatistics.GetRateAtLastStop(aReliable);
|
||||
return mPlaybackStatistics->GetRateAtLastStop(aReliable);
|
||||
}
|
||||
|
||||
void MediaDecoder::UpdatePlaybackRate()
|
||||
@ -1032,7 +1033,7 @@ void MediaDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
|
||||
return;
|
||||
}
|
||||
if (aOffset >= mDecoderPosition) {
|
||||
mPlaybackStatistics.AddBytes(aBytes);
|
||||
mPlaybackStatistics->AddBytes(aBytes);
|
||||
}
|
||||
mDecoderPosition = aOffset + aBytes;
|
||||
}
|
||||
|
@ -718,14 +718,14 @@ public:
|
||||
// Records activity stopping on the channel. The monitor must be held.
|
||||
virtual void NotifyPlaybackStarted() {
|
||||
GetReentrantMonitor().AssertCurrentThreadIn();
|
||||
mPlaybackStatistics.Start();
|
||||
mPlaybackStatistics->Start();
|
||||
}
|
||||
|
||||
// Used to estimate rates of data passing through the decoder's channel.
|
||||
// Records activity stopping on the channel. The monitor must be held.
|
||||
virtual void NotifyPlaybackStopped() {
|
||||
GetReentrantMonitor().AssertCurrentThreadIn();
|
||||
mPlaybackStatistics.Stop();
|
||||
mPlaybackStatistics->Stop();
|
||||
}
|
||||
|
||||
// The actual playback rate computation. The monitor must be held.
|
||||
@ -1194,7 +1194,7 @@ protected:
|
||||
// Data needed to estimate playback data rate. The timeline used for
|
||||
// this estimate is "decode time" (where the "current time" is the
|
||||
// time of the last decoded video frame).
|
||||
MediaChannelStatistics mPlaybackStatistics;
|
||||
nsRefPtr<MediaChannelStatistics> mPlaybackStatistics;
|
||||
|
||||
// True when our media stream has been pinned. We pin the stream
|
||||
// while seeking.
|
||||
|
@ -38,12 +38,6 @@ namespace mozilla {
|
||||
class MediaDecoder;
|
||||
class MediaChannelStatistics;
|
||||
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<MediaChannelStatistics>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class is useful for estimating rates of data passing through
|
||||
* some channel. The idea is that activity on the channel "starts"
|
||||
@ -119,6 +113,7 @@ public:
|
||||
return static_cast<double>(mAccumulatedBytes)/seconds;
|
||||
}
|
||||
private:
|
||||
~MediaChannelStatistics() {}
|
||||
int64_t mAccumulatedBytes;
|
||||
TimeDuration mAccumulatedTime;
|
||||
TimeStamp mLastStartTime;
|
||||
|
Loading…
Reference in New Issue
Block a user