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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: rename result (+rebase) Created 4 years, 1 month 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
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.h ('k') | media/base/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/content_decryptor_delegate.cc
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index 57e1f8c604b8f88899d850b3771bbb2c5816f100..3cdf6c8b6e1b1cbcacc1c093941b7bb058634418 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -742,6 +742,7 @@ void ContentDecryptorDelegate::OnPromiseResolvedWithSession(uint32_t promise_id,
PP_Var session_id) {
StringVar* session_id_string = StringVar::FromPPVar(session_id);
DCHECK(session_id_string);
+ cdm_session_tracker_.AddSession(session_id_string->value());
cdm_promise_adapter_.ResolvePromise(promise_id, session_id_string->value());
}
@@ -821,13 +822,12 @@ void ContentDecryptorDelegate::OnSessionExpirationChange(
}
void ContentDecryptorDelegate::OnSessionClosed(PP_Var session_id) {
- if (session_closed_cb_.is_null())
- return;
-
StringVar* session_id_string = StringVar::FromPPVar(session_id);
DCHECK(session_id_string);
- session_closed_cb_.Run(session_id_string->value());
+ cdm_session_tracker_.RemoveSession(session_id_string->value());
+ if (!session_closed_cb_.is_null())
+ session_closed_cb_.Run(session_id_string->value());
}
void ContentDecryptorDelegate::DecoderInitializeDone(
@@ -1257,6 +1257,8 @@ void ContentDecryptorDelegate::SatisfyAllPendingCallbacksOnError() {
video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL);
cdm_promise_adapter_.Clear();
+
+ cdm_session_tracker_.CloseRemainingSessions(session_closed_cb_);
}
} // namespace content
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.h ('k') | media/base/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698