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

Unified Diff: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc

Issue 642813012: Reland "Add unprefixed EME tests for LoadSession()" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « content/browser/media/media_source_browsertest.cc ('k') | media/test/data/eme_player_js/player_utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
diff --git a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
index 84a6a3142659406e74136aee267a97720d99d29d..7b6db1b87bd4f424d3463a60f7896fcdb5812bea 100644
--- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
+++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
@@ -700,6 +700,10 @@ void ClearKeyCdm::OnSessionMessage(const std::string& web_session_id,
void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id,
bool has_additional_usable_key) {
+ // Ignore the message when we are waiting to update the loadable session.
+ if (web_session_id == session_id_for_emulated_loadsession_)
+ return;
+
host_->OnSessionUsableKeysChange(web_session_id.data(),
web_session_id.length(),
has_additional_usable_key);
@@ -749,6 +753,9 @@ void ClearKeyCdm::OnSessionUpdated(uint32 promise_id,
// |promise_id| is the LoadSession() promise, so resolve appropriately.
host_->OnResolveNewSessionPromise(
promise_id, kLoadableWebSessionId, strlen(kLoadableWebSessionId));
+ // Generate the UsableKeys event now that the session is "loaded".
+ host_->OnSessionUsableKeysChange(
+ kLoadableWebSessionId, strlen(kLoadableWebSessionId), true);
return;
}
« no previous file with comments | « content/browser/media/media_source_browsertest.cc ('k') | media/test/data/eme_player_js/player_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698