Bug 1352924 - Disconnect GMP service in child from parent once all GMPs are shutdown. r=gerald
This ensures that the IPC connection from the content process to the main
process is shut down as soon as possible. Once all the IPC connections are
closed, the main process removes its async shutdown blocker, and Firefox
can shutdown.
MozReview-Commit-ID: 8rqa384ayd9
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -420,16 +420,19 @@ GeckoMediaPluginServiceChild::SetService
void
GeckoMediaPluginServiceChild::RemoveGMPContentParent(GMPContentParent* aGMPContentParent)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
if (mServiceChild) {
mServiceChild->RemoveGMPContentParent(aGMPContentParent);
+ if (mShuttingDownOnGMPThread && !mServiceChild->HaveContentParents()) {
+ mServiceChild = nullptr;
+ }
}
}
GMPServiceChild::GMPServiceChild()
{
}
GMPServiceChild::~GMPServiceChild()