Bug 1243878 - Null check CDMProxy::mKeys in CDMProxy::OnExpirationChange() before use. r=jwwang

All the methods in CDMProxy except CDMProxy::OnExpirationChange() that use
mKeys null check mKeys before using it because it can go away during shutdown
before the IPC message to call the methods have had a chance to run.

We should do the null check in CDMProxy::OnExpirationChange() too.
This commit is contained in:
Chris Pearce 2016-01-29 10:23:45 +13:00
parent 23a07b65e7
commit 01cfbce7e9

View File

@ -580,6 +580,9 @@ CDMProxy::OnExpirationChange(const nsAString& aSessionId,
GMPTimestamp aExpiryTime)
{
MOZ_ASSERT(NS_IsMainThread());
if (mKeys.IsNull()) {
return;
}
RefPtr<dom::MediaKeySession> session(mKeys->GetSession(aSessionId));
if (session) {
session->SetExpiration(static_cast<double>(aExpiryTime));