Chromium Code Reviews| 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, |
|
yucliu1
2015/11/18 19:28:26
The constructor with arguments isn't available in
halliwell
2015/11/18 19:32:32
Correct, I have been working with local changes to
|
| + ::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. |