Bug 1313202 - Make ClearKey resolve MediaKeySession.closed promise before promise returned by MediaKeySession.close(). r=gerald
MozReview-Commit-ID: KWwN6W07Cba
--- a/media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeySessionManager.cpp
@@ -296,18 +296,18 @@ ClearKeySessionManager::CloseSession(uin
mCallback->RejectPromise(aPromiseId, kGMPNotFoundError, nullptr, 0);
return;
}
ClearKeySession* session = itr->second;
assert(session);
ClearInMemorySessionData(session);
+ mCallback->SessionClosed(aSessionId, aSessionIdLength);
mCallback->ResolvePromise(aPromiseId);
- mCallback->SessionClosed(aSessionId, aSessionIdLength);
}
void
ClearKeySessionManager::ClearInMemorySessionData(ClearKeySession* aSession)
{
mSessions.erase(aSession->Id());
delete aSession;
}