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

Unified Diff: chromecast/media/cdm/browser_cdm_cast.cc

Issue 1407253007: [Chromecast] Allow CMA backend to notify of key expiry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
Index: chromecast/media/cdm/browser_cdm_cast.cc
diff --git a/chromecast/media/cdm/browser_cdm_cast.cc b/chromecast/media/cdm/browser_cdm_cast.cc
index 9e7042d3f107cb41157b23387b9bf08a43971ce5..f6a845d7515c6cb51701a2a04036e447175f9d82 100644
--- a/chromecast/media/cdm/browser_cdm_cast.cc
+++ b/chromecast/media/cdm/browser_cdm_cast.cc
@@ -126,17 +126,25 @@ void BrowserCdmCast::OnSessionClosed(const std::string& session_id) {
session_closed_cb_.Run(session_id);
}
-void BrowserCdmCast::OnSessionKeysChange(
- const std::string& session_id,
- const ::media::KeyIdAndKeyPairs& keys) {
- ::media::CdmKeysInfo cdm_keys_info;
+void BrowserCdmCast::OnSessionKeysChange(const std::string& session_id,
+ bool newly_usable_keys,
+ ::media::CdmKeysInfo keys_info) {
+ session_keys_change_cb_.Run(session_id, newly_usable_keys, keys_info.Pass());
+
+ if (newly_usable_keys)
+ player_tracker_impl_->NotifyNewKey();
+}
+
+void BrowserCdmCast::KeyIdAndKeyPairsToInfo(
+ const ::media::KeyIdAndKeyPairs& keys,
+ ::media::CdmKeysInfo* keys_info) {
+ DCHECK(keys_info);
for (const std::pair<std::string, std::string>& key : keys) {
- cdm_keys_info.push_back(new ::media::CdmKeyInformation(
- key.first, ::media::CdmKeyInformation::USABLE, 0));
+ scoped_ptr<::media::CdmKeyInformation> cdm_key_information(
+ new ::media::CdmKeyInformation(key.first,
+ ::media::CdmKeyInformation::USABLE, 0));
+ keys_info->push_back(cdm_key_information.release());
}
- session_keys_change_cb_.Run(session_id, true, cdm_keys_info.Pass());
-
- player_tracker_impl_->NotifyNewKey();
}
// A macro runs current member function on |task_runner_| thread.

Powered by Google App Engine
This is Rietveld 408576698