Bug 1741118 - Don't release GmpPlugin MediaEvents, which hold on to the call thread, on the call thread. r=ng

Since bug 1727262 these are fine to release off-target.

Differential Revision: https://phabricator.services.mozilla.com/D132222
This commit is contained in:
Andreas Pehrson 2021-11-30 17:37:41 +00:00
parent a3bf3e72b1
commit b989c39bda

View File

@ -26,13 +26,8 @@ class GmpPluginNotifier : public GmpPluginNotifierInterface {
new MediaEventForwarder<uint64_t>(mOwningThread)) {}
~GmpPluginNotifier() {
mOwningThread->Dispatch(NS_NewRunnableFunction(
"~GmpPluginNotifier",
[createdEvent = std::move(mCreatedGmpPluginEvent),
releasedEvent = std::move(mReleasedGmpPluginEvent)]() mutable {
createdEvent->DisconnectAll();
releasedEvent->DisconnectAll();
}));
mCreatedGmpPluginEvent->DisconnectAll();
mReleasedGmpPluginEvent->DisconnectAll();
}
MediaEventSource<uint64_t>& CreatedGmpPluginEvent() override {
@ -47,8 +42,8 @@ class GmpPluginNotifier : public GmpPluginNotifierInterface {
protected:
const nsCOMPtr<nsISerialEventTarget> mOwningThread;
RefPtr<MediaEventForwarder<uint64_t> > mCreatedGmpPluginEvent;
RefPtr<MediaEventForwarder<uint64_t> > mReleasedGmpPluginEvent;
RefPtr<MediaEventForwarder<uint64_t>> mCreatedGmpPluginEvent;
RefPtr<MediaEventForwarder<uint64_t>> mReleasedGmpPluginEvent;
};
class WebrtcVideoDecoderFactory : public GmpPluginNotifier,