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
--- 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();