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

Unified Diff: content/renderer/media/crypto/ppapi_decryptor.cc

Issue 166273009: PpapiDecryptor: Call NewKeyCB on OnSessionReady(). (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/renderer/media/crypto/ppapi_decryptor.cc
diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc
index 350bfa199f71c0fd0230991cc94372b2fe425234..23ad31ec9655a3e5223fe6824b9b0badb5d68d5c 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.cc
+++ b/content/renderer/media/crypto/ppapi_decryptor.cc
@@ -137,12 +137,6 @@ void PpapiDecryptor::UpdateSession(uint32 session_id,
ReportFailureToCallPlugin(session_id);
return;
}
-
- if (!new_audio_key_cb_.is_null())
- new_audio_key_cb_.Run();
-
- if (!new_video_key_cb_.is_null())
- new_video_key_cb_.Run();
}
void PpapiDecryptor::ReleaseSession(uint32 session_id) {
@@ -352,6 +346,17 @@ void PpapiDecryptor::OnSessionMessage(uint32 session_id,
void PpapiDecryptor::OnSessionReady(uint32 session_id) {
DCHECK(render_loop_proxy_->BelongsToCurrentThread());
+
+ // Based on the spec, we need to resume playback when a session is updated, or
ddorwin 2014/02/19 00:38:13 "updated" is a bit ambiguous. It's really when upd
xhwang 2014/02/19 00:46:42 Done.
+ // when a session is loaded. In both cases, the CDM fires OnSessionReady()
ddorwin 2014/02/19 00:38:13 same/similar: successfully loaded
xhwang 2014/02/19 00:46:42 Done.
+ // event. So we choose to call the NewKeyCBs here.
+ // TODO(xhwang): Rename OnSessionReady callback to OnSessionUpdated.
ddorwin 2014/02/19 00:38:13 SessionUpdated does not seem to cover the loaded c
xhwang 2014/02/19 00:46:42 Done.
+ if (!new_audio_key_cb_.is_null())
+ new_audio_key_cb_.Run();
+
+ if (!new_video_key_cb_.is_null())
+ new_video_key_cb_.Run();
+
session_ready_cb_.Run(session_id);
}
« no previous file with comments | « no previous file | media/cdm/ppapi/external_clear_key/clear_key_cdm.h » ('j') | media/cdm/ppapi/external_clear_key/clear_key_cdm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698