Bug 1341555 - Consolidate use of the MSG's AbstractMainThread, and stop having AbstractMainThread on MediaStreams. r=pehrsons

MozReview-Commit-ID: 5hGDQcfpH6a
This commit is contained in:
Paul Adenot
2017-06-29 11:30:57 -07:00
parent 5be210e90e
commit aadd3c3a24
28 changed files with 159 additions and 217 deletions

View File

@@ -4869,8 +4869,7 @@ public:
mBlocked(false),
mFinished(false),
mMutex(aName),
mPendingNotifyOutput(false),
mAbstractMainThread(aElement->AbstractMainThread())
mPendingNotifyOutput(false)
{}
void Forget()
{
@@ -4938,14 +4937,12 @@ public:
this,
&StreamListener::DoNotifyUnblocked);
}
aGraph->DispatchToMainThreadAfterStreamStateUpdate(mAbstractMainThread,
event.forget());
aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
}
virtual void NotifyHasCurrentData(MediaStreamGraph* aGraph) override
{
MutexAutoLock lock(mMutex);
aGraph->DispatchToMainThreadAfterStreamStateUpdate(
mAbstractMainThread,
NewRunnableMethod(
"dom::HTMLMediaElement::StreamListener::DoNotifyHaveCurrentData",
this,
@@ -4959,7 +4956,6 @@ public:
return;
mPendingNotifyOutput = true;
aGraph->DispatchToMainThreadAfterStreamStateUpdate(
mAbstractMainThread,
NewRunnableMethod("dom::HTMLMediaElement::StreamListener::DoNotifyOutput",
this,
&StreamListener::DoNotifyOutput));
@@ -4975,7 +4971,6 @@ private:
// mMutex protects the fields below; they can be accessed on any thread
Mutex mMutex;
bool mPendingNotifyOutput;
const RefPtr<AbstractThread> mAbstractMainThread;
};
class HTMLMediaElement::MediaStreamTracksAvailableCallback: