Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 181593004: Encrypted Media: Destroy CDM in ProxyMediaKeys' dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/media/android/browser_media_player_manager.cc
diff --git a/content/browser/media/android/browser_media_player_manager.cc b/content/browser/media/android/browser_media_player_manager.cc
index 5d457e40809ca9bb6d0c95cc32edd44467653a37..e508d4686f360d8f166806927885f7a40346b100 100644
--- a/content/browser/media/android/browser_media_player_manager.cc
+++ b/content/browser/media/android/browser_media_player_manager.cc
@@ -144,8 +144,7 @@ bool BrowserMediaPlayerManager::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(MediaKeysHostMsg_CreateSession, OnCreateSession)
IPC_MESSAGE_HANDLER(MediaKeysHostMsg_UpdateSession, OnUpdateSession)
IPC_MESSAGE_HANDLER(MediaKeysHostMsg_ReleaseSession, OnReleaseSession)
- IPC_MESSAGE_HANDLER(MediaKeysHostMsg_CancelAllPendingSessionCreations,
- OnCancelAllPendingSessionCreations)
+ IPC_MESSAGE_HANDLER(MediaKeysHostMsg_DestroyCdm, OnDestroyCdm)
#if defined(VIDEO_HOLE)
IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_NotifyExternalSurface,
OnNotifyExternalSurface)
@@ -729,11 +728,16 @@ void BrowserMediaPlayerManager::OnReleaseSession(int media_keys_id,
drm_bridge->ReleaseSession(session_id);
}
-void BrowserMediaPlayerManager::OnCancelAllPendingSessionCreations(
- int media_keys_id) {
+void BrowserMediaPlayerManager::OnDestroyCdm(int media_keys_id) {
MediaDrmBridge* drm_bridge = GetDrmBridge(media_keys_id);
if (!drm_bridge) return;
+ CancelAllPendingSessionCreations(media_keys_id);
+ RemoveDrmBridge(media_keys_id);
+}
+
+void BrowserMediaPlayerManager::CancelAllPendingSessionCreations(
+ int media_keys_id) {
BrowserContext* context =
web_contents()->GetRenderProcessHost()->GetBrowserContext();
context->CancelProtectedMediaIdentifierPermissionRequests(media_keys_id);
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.h ('k') | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698