Chromium Code Reviews| Index: content/renderer/media/android/proxy_media_keys.cc |
| diff --git a/content/renderer/media/android/proxy_media_keys.cc b/content/renderer/media/android/proxy_media_keys.cc |
| index ef93a2552fb99835f62b7a266d36078e3c759a99..0631578619f96fb74039289229986eadd1e351bc 100644 |
| --- a/content/renderer/media/android/proxy_media_keys.cc |
| +++ b/content/renderer/media/android/proxy_media_keys.cc |
| @@ -32,6 +32,10 @@ ProxyMediaKeys::ProxyMediaKeys( |
| } |
| ProxyMediaKeys::~ProxyMediaKeys() { |
| + for (base::hash_set<uint32>::iterator i = requested_session_id_.begin(); |
| + i != requested_session_id_.end(); ++i) { |
| + manager_->CancelSession(media_keys_id_, *i); |
| + } |
| } |
| void ProxyMediaKeys::InitializeCDM(const std::string& key_system, |
| @@ -49,6 +53,7 @@ bool ProxyMediaKeys::CreateSession(uint32 session_id, |
| const std::string& type, |
| const uint8* init_data, |
| int init_data_length) { |
| + requested_session_id_.insert(session_id); |
| manager_->CreateSession( |
| media_keys_id_, |
| session_id, |
| @@ -67,6 +72,7 @@ void ProxyMediaKeys::UpdateSession(uint32 session_id, |
| } |
| void ProxyMediaKeys::ReleaseSession(uint32 session_id) { |
| + requested_session_id_.erase(session_id); |
|
ddorwin
2013/12/20 23:59:52
You probably don't need this here. See last commen
Kibeom Kim (inactive)
2013/12/30 12:33:05
Done.
|
| manager_->ReleaseSession(media_keys_id_, session_id); |
| } |
| @@ -86,9 +92,14 @@ void ProxyMediaKeys::OnSessionReady(uint32 session_id) { |
| } |
| void ProxyMediaKeys::OnSessionClosed(uint32 session_id) { |
| + requested_session_id_.erase(session_id); |
|
ddorwin
2013/12/20 23:59:52
I can't find documentation, but I assume this is a
Kibeom Kim (inactive)
2013/12/30 12:33:05
(I just assumed the spec is equal to std::set<>::e
|
| session_closed_cb_.Run(session_id); |
| } |
| +void ProxyMediaKeys::OnSessionApproved(uint32 session_id, bool success) { |
|
ddorwin
2013/12/20 23:59:52
Can we just use OnSessionCreated for success and h
xhwang
2013/12/21 00:40:48
Can we have a CancelAllPendingSessionCreations(med
ddorwin
2013/12/21 00:44:56
Good point. This class is always tied to media_key
Kibeom Kim (inactive)
2013/12/21 01:50:43
So, looks like it's just a matter of which class w
|
| + requested_session_id_.erase(session_id); |
| +} |
| + |
| void ProxyMediaKeys::OnSessionError(uint32 session_id, |
| media::MediaKeys::KeyError error_code, |
| int system_code) { |