Bug 1352924 - Disconnect GMP service in child from parent once all GMPs are shutdown. r=gerald draft
authorChris Pearce <cpearce@mozilla.com>
Mon, 03 Apr 2017 11:10:04 +1200 (2017-04-02)
changeset 554931 b9cbbb9f4c22016284a8d49cddaea0d96666acf9
parent 554930 674f3c4ddcb5bb93dd775a861b425d25510871e9
child 622481 a733d984387f1d4dfb77253d9695cf36bd6c0767
push id52098
push userbmo:cpearce@mozilla.com
push dateMon, 03 Apr 2017 10:40:05 +0000 (2017-04-03)
reviewersgerald
bugs1352924
milestone55.0a1
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
dom/media/gmp/GMPServiceChild.cpp
--- 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()