Bug 1109457 - Hook up CDM session close notification to MediaKeySession. r=jwwang
--- a/dom/media/eme/CDMProxy.cpp
+++ b/dom/media/eme/CDMProxy.cpp
@@ -439,17 +439,23 @@ CDMProxy::OnExpirationChange(const nsASt
MOZ_ASSERT(NS_IsMainThread());
NS_WARNING("CDMProxy::OnExpirationChange() not implemented");
}
void
CDMProxy::OnSessionClosed(const nsAString& aSessionId)
{
MOZ_ASSERT(NS_IsMainThread());
- NS_WARNING("CDMProxy::OnSessionClosed() not implemented");
+ if (mKeys.IsNull()) {
+ return;
+ }
+ nsRefPtr<dom::MediaKeySession> session(mKeys->GetSession(aSessionId));
+ if (session) {
+ session->OnClosed();
+ }
}
static void
LogToConsole(const nsAString& aMsg)
{
nsCOMPtr<nsIConsoleService> console(
do_GetService("@mozilla.org/consoleservice;1"));
if (!console) {