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

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

Issue 2655413003: Fix expiry time conversion in ContentDecryptorDelegate (Closed)
Patch Set: Fix expiry time conversion in ContentDecryptorDelegate Created 3 years, 11 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/cdm_adapter_unittest.cc ('k') | media/test/data/eme_player_js/clearkey_player.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 54efa56f07d1e6f9fa0b34c086b85c0f4cfbb217..7adacf0a1d57882c153f77cdf236eec4c634b3bd 100644
--- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
+++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc
@@ -420,10 +420,23 @@ void ClearKeyCdm::UpdateSession(uint32_t promise_id,
web_session_str, std::vector<uint8_t>(response, response + response_size),
std::move(promise));
- if (key_system_ == kExternalClearKeyRenewalKeySystem && !renewal_timer_set_) {
- ScheduleNextRenewal();
- renewal_timer_set_ = true;
+ // TODO(xhwang): Only schedule renewal and update expiration change when the
+ // promise is resolved.
+
+ cdm::Time expiration = 0.0; // Never expires.
+
+ if (key_system_ == kExternalClearKeyRenewalKeySystem) {
+ // For renewal key system, set a non-zero expiration that is approximately
+ // 100 years after 01 January 1970 UTC.
+ expiration = 3153600000.0; // 100 * 365 * 24 * 60 * 60;
+
+ if (!renewal_timer_set_) {
+ ScheduleNextRenewal();
+ renewal_timer_set_ = true;
+ }
}
+
+ host_->OnExpirationChange(session_id, session_id_length, expiration);
}
void ClearKeyCdm::CloseSession(uint32_t promise_id,
« no previous file with comments | « media/cdm/cdm_adapter_unittest.cc ('k') | media/test/data/eme_player_js/clearkey_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698