Chromium Code Reviews| Index: content/renderer/media/crypto/proxy_media_keys.cc |
| diff --git a/content/renderer/media/crypto/proxy_media_keys.cc b/content/renderer/media/crypto/proxy_media_keys.cc |
| index 17e918d80ec2338c847244448525903fa3d047a1..8bb00abfb97eedf516d5e2267e72acc150ef38b9 100644 |
| --- a/content/renderer/media/crypto/proxy_media_keys.cc |
| +++ b/content/renderer/media/crypto/proxy_media_keys.cc |
| @@ -22,8 +22,13 @@ scoped_ptr<ProxyMediaKeys> ProxyMediaKeys::Create( |
| const media::SessionMessageCB& session_message_cb, |
| const media::SessionReadyCB& session_ready_cb, |
| const media::SessionClosedCB& session_closed_cb, |
| - const media::SessionErrorCB& session_error_cb) { |
| + const media::SessionErrorCB& session_error_cb, |
| + const media::SessionKeysChangeCB& session_keys_change_cb, |
| + const media::SessionExpirationChangeCB& session_expiration_change_cb) { |
| DCHECK(manager); |
| + |
| + // TODO(jrummell): Add support for SessionKeysChangeCB and |
| + // SessionExpirationChangeCB. |
| scoped_ptr<ProxyMediaKeys> proxy_media_keys( |
| new ProxyMediaKeys(manager, |
| session_message_cb, |
| @@ -48,6 +53,13 @@ ProxyMediaKeys::~ProxyMediaKeys() { |
| session_id_to_promise_map_.clear(); |
| } |
| +void ProxyMediaKeys::SetServerCertificate( |
| + const uint8* certificate_data, |
| + int certificate_data_length, |
| + scoped_ptr<media::SimpleCdmPromise> promise) { |
| + promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented."); |
| +} |
| + |
| void ProxyMediaKeys::CreateSession( |
| const std::string& init_data_type, |
| const uint8* init_data, |
| @@ -107,9 +119,28 @@ void ProxyMediaKeys::UpdateSession( |
| std::vector<uint8>(response, response + response_length)); |
| } |
| -void ProxyMediaKeys::ReleaseSession( |
| +void ProxyMediaKeys::CloseSession(const std::string& web_session_id, |
| + scoped_ptr<media::SimpleCdmPromise> promise) { |
| + // Both CloseSession() and RemoveSession() call ReleaseSession(), so calling |
| + // either one will release the session. Calling both will result in an error |
| + // for the second call. |
| + // TODO(jrummell): Implement Close/Remove properly. |
| + uint32 session_id = LookupSessionId(web_session_id); |
| + if (!session_id) { |
| + promise->reject(INVALID_ACCESS_ERROR, 0, "Session does not exist."); |
| + return; |
| + } |
| + |
| + SavePromise(session_id, promise.PassAs<media::CdmPromise>()); |
| + manager_->ReleaseSession(cdm_id_, session_id); |
| +} |
| + |
| +void ProxyMediaKeys::RemoveSession( |
| const std::string& web_session_id, |
| scoped_ptr<media::SimpleCdmPromise> promise) { |
| + // Both CloseSession() and RemoveSession() call ReleaseSession(), so calling |
|
ddorwin
2014/09/11 23:31:11
Remove is not implemented on Android because persi
jrummell
2014/09/15 18:22:39
Done. I was more concerned about v0.1b calling CKR
|
| + // either one will release the session. Calling both will result in an error |
| + // for the second call. |
| uint32 session_id = LookupSessionId(web_session_id); |
| if (!session_id) { |
| promise->reject(INVALID_ACCESS_ERROR, 0, "Session does not exist."); |
| @@ -120,6 +151,11 @@ void ProxyMediaKeys::ReleaseSession( |
| manager_->ReleaseSession(cdm_id_, session_id); |
| } |
| +void ProxyMediaKeys::GetUsableKeyIds(const std::string& web_session_id, |
| + scoped_ptr<media::KeyIdsPromise> promise) { |
| + promise->reject(NOT_SUPPORTED_ERROR, 0, "Not yet implemented."); |
| +} |
| + |
| void ProxyMediaKeys::OnSessionCreated(uint32 session_id, |
| const std::string& web_session_id) { |
| AssignWebSessionId(session_id, web_session_id); |