Bug 1316215 - Make GMPParent::IsUsed() take into account whether there are pending GetContentParent calls. r=gerald
authorChris Pearce <cpearce@mozilla.com>
Fri, 18 Nov 2016 12:37:14 +1300
changeset 324015 efff1ff587e32ef436efe95ef3153b44ff0ab1a5
parent 324014 4be3169b9d0257f3e0182dd1ad5d60a9a98eef48
child 324016 0390e208038169bbdfa832155bef6359af4775fa
push id30988
push usercbook@mozilla.com
push dateThu, 24 Nov 2016 15:35:58 +0000
treeherdermozilla-central@9aef92f7911d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1316215
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1316215 - Make GMPParent::IsUsed() take into account whether there are pending GetContentParent calls. r=gerald In a similar vein to the previous patch, while we're waiting on a GetContentParent promise to resolve, we don't want the GMPParent to shutdown. So make IsUsed() check whether we're waiting on a GetContentParent promise to resolve, so we don't pull the rug out from under any code waiting to get a content parent to bridge a GMP. MozReview-Commit-ID: 8cTCuXLXMsK
dom/media/gmp/GMPParent.h
--- a/dom/media/gmp/GMPParent.h
+++ b/dom/media/gmp/GMPParent.h
@@ -184,17 +184,18 @@ private:
   bool DeallocPGMPTimerParent(PGMPTimerParent* aActor) override;
 
   mozilla::ipc::IPCResult RecvAsyncShutdownComplete() override;
   mozilla::ipc::IPCResult RecvAsyncShutdownRequired() override;
 
   mozilla::ipc::IPCResult RecvPGMPContentChildDestroyed() override;
   bool IsUsed()
   {
-    return mGMPContentChildCount > 0;
+    return mGMPContentChildCount > 0 ||
+           !mGetContentParentPromises.IsEmpty();
   }
 
   void ResolveGetContentParentPromises();
   void RejectGetContentParentPromises();
 
   static void AbortWaitingForGMPAsyncShutdown(nsITimer* aTimer, void* aClosure);
   nsresult EnsureAsyncShutdownTimeoutSet();