Bug 1409270. P3 - remove WatchTarget from the base class of HTMLMediaElement::StreamListener. r=gerald
MozReview-Commit-ID: B7fmYlJShEC
This commit is contained in:
@@ -5082,12 +5082,10 @@ HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder)
|
||||
return rv;
|
||||
}
|
||||
|
||||
class HTMLMediaElement::StreamListener : public MediaStreamListener,
|
||||
public WatchTarget
|
||||
class HTMLMediaElement::StreamListener : public MediaStreamListener
|
||||
{
|
||||
public:
|
||||
StreamListener(HTMLMediaElement* aElement, const char* aName) :
|
||||
WatchTarget(aName),
|
||||
mElement(aElement),
|
||||
mHaveCurrentData(false),
|
||||
mFinished(false),
|
||||
@@ -5096,8 +5094,11 @@ public:
|
||||
{}
|
||||
void Forget()
|
||||
{
|
||||
mElement = nullptr;
|
||||
NotifyWatchers();
|
||||
if (mElement) {
|
||||
HTMLMediaElement* element = mElement;
|
||||
mElement = nullptr;
|
||||
element->UpdateReadyStateInternal();
|
||||
}
|
||||
}
|
||||
|
||||
// Main thread
|
||||
@@ -5127,8 +5128,8 @@ public:
|
||||
if (mElement) {
|
||||
RefPtr<HTMLMediaElement> kungFuDeathGrip = mElement;
|
||||
kungFuDeathGrip->FirstFrameLoaded();
|
||||
kungFuDeathGrip->UpdateReadyStateInternal();
|
||||
}
|
||||
NotifyWatchers();
|
||||
DoNotifyOutput();
|
||||
}
|
||||
|
||||
@@ -5251,9 +5252,6 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags)
|
||||
"HTMLMediaElement::mMediaStreamListener");
|
||||
stream->AddListener(mMediaStreamListener);
|
||||
|
||||
mWatchManager.Watch(*mMediaStreamListener,
|
||||
&HTMLMediaElement::UpdateReadyStateInternal);
|
||||
|
||||
stream->AddAudioOutput(this);
|
||||
SetVolumeInternal();
|
||||
|
||||
@@ -5283,9 +5281,6 @@ void HTMLMediaElement::UpdateSrcMediaStreamPlaying(uint32_t aFlags)
|
||||
// If stream is null, then DOMMediaStream::Destroy must have been
|
||||
// called and that will remove all listeners/outputs.
|
||||
|
||||
mWatchManager.Unwatch(*mMediaStreamListener,
|
||||
&HTMLMediaElement::UpdateReadyStateInternal);
|
||||
|
||||
mMediaStreamListener->Forget();
|
||||
mMediaStreamListener = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user