void WebrtcGmpVideoDecoder::Close_g() { GMPVideoDecoderProxy* gmp(mGMP); mGMP = nullptr; mHost = nullptr; mInitting = false; if (gmp) { // Do this last, since this could cause us to be destroyed gmp->Close(); } }
void GMPContentParent::CloseIfUnused() { if (mVideoDecoders.IsEmpty() && mVideoEncoders.IsEmpty() && mChromiumCDMs.IsEmpty() && mCloseBlockerCount == 0) { RefPtr<GMPContentParent> toClose; if (mParent) { toClose = mParent->ForgetGMPContentParent(); } else { toClose = this; RefPtr<GeckoMediaPluginServiceChild> gmp( GeckoMediaPluginServiceChild::GetSingleton()); gmp->RemoveGMPContentParent(toClose); } NS_DispatchToCurrentThread(NewRunnableMethod( "gmp::GMPContentParent::Close", toClose, &GMPContentParent::Close)); } }