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

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

Issue 2831963003: EME: Allow temporary sessions to be removed for ClearKey only. (Closed)
Patch Set: rebase Created 3 years, 8 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 | « media/cdm/ppapi/external_clear_key/clear_key_cdm.h ('k') | media/mojo/clients/mojo_cdm_factory.cc » ('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 18e4f87ea8c06a4f1bbcaf57b54729f9f4a15ec4..80097750547ea7a6341a61e412900df493ec874e 100644
--- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
+++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
@@ -330,7 +330,8 @@ ClearKeyCdm::ClearKeyCdm(ClearKeyCdmHost* host,
origin,
base::Bind(&ClearKeyCdm::OnSessionMessage, base::Unretained(this)),
base::Bind(&ClearKeyCdm::OnSessionClosed, base::Unretained(this)),
- base::Bind(&ClearKeyCdm::OnSessionKeysChange,
+ base::Bind(&ClearKeyCdm::OnSessionKeysChange, base::Unretained(this)),
+ base::Bind(&ClearKeyCdm::OnSessionExpirationUpdate,
base::Unretained(this)))),
host_(host),
key_system_(key_system),
@@ -489,19 +490,8 @@ void ClearKeyCdm::RemoveSession(uint32_t promise_id,
std::string web_session_str(session_id, session_id_length);
// RemoveSession only allowed for the loadable session.
- if (web_session_str == std::string(kLoadableSessionId)) {
+ if (web_session_str == std::string(kLoadableSessionId))
web_session_str = session_id_for_emulated_loadsession_;
- } else {
- // TODO(jrummell): This should be a DCHECK once blink does the proper
- // checks.
- std::string message("Not supported for non-persistent sessions.");
- host_->OnRejectPromise(promise_id,
- cdm::kInvalidAccessError,
- 0,
- message.data(),
- message.length());
- return;
- }
std::unique_ptr<media::SimpleCdmPromise> promise(
new media::CdmCallbackPromise<>(
@@ -892,6 +882,15 @@ void ClearKeyCdm::OnSessionClosed(const std::string& session_id) {
host_->OnSessionClosed(new_session_id.data(), new_session_id.length());
}
+void ClearKeyCdm::OnSessionExpirationUpdate(const std::string& session_id,
+ base::Time new_expiry_time) {
+ std::string new_session_id = session_id;
+ if (new_session_id == session_id_for_emulated_loadsession_)
+ new_session_id = std::string(kLoadableSessionId);
+ host_->OnExpirationChange(new_session_id.data(), new_session_id.length(),
+ new_expiry_time.ToDoubleT());
+}
+
void ClearKeyCdm::OnSessionCreated(uint32_t promise_id,
const std::string& session_id) {
// Save the latest session ID for renewal and file IO test messages.
« no previous file with comments | « media/cdm/ppapi/external_clear_key/clear_key_cdm.h ('k') | media/mojo/clients/mojo_cdm_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698