Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/blink/cdm_session_adapter.h" | 5 #include "media/blink/cdm_session_adapter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 CdmContext* CdmSessionAdapter::GetCdmContext() { | 112 CdmContext* CdmSessionAdapter::GetCdmContext() { |
| 113 return media_keys_->GetCdmContext(); | 113 return media_keys_->GetCdmContext(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { | 116 const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { |
| 117 return key_system_uma_prefix_; | 117 return key_system_uma_prefix_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void CdmSessionAdapter::OnSessionMessage(const std::string& web_session_id, | 120 void CdmSessionAdapter::OnSessionMessage(const std::string& web_session_id, |
| 121 MediaKeys::MessageType message_type, | 121 MediaKeys::MessageType message_type, |
| 122 const std::vector<uint8>& message) { | 122 const std::vector<uint8>& message, |
| 123 const GURL& legacy_destination_url) { | |
|
xhwang
2015/01/13 18:45:13
/* legacy_destination_url */ to be clear that the
jrummell
2015/01/13 19:46:31
Done.
| |
| 123 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); | 124 WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); |
| 124 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " | 125 DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " |
| 125 << web_session_id; | 126 << web_session_id; |
| 126 if (session) | 127 if (session) |
| 127 session->OnSessionMessage(message_type, message); | 128 session->OnSessionMessage(message_type, message); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id, | 131 void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id, |
| 131 bool has_additional_usable_key, | 132 bool has_additional_usable_key, |
| 132 CdmKeysInfo keys_info) { | 133 CdmKeysInfo keys_info) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( | 169 WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( |
| 169 const std::string& web_session_id) { | 170 const std::string& web_session_id) { |
| 170 // Since session objects may get garbage collected, it is possible that there | 171 // Since session objects may get garbage collected, it is possible that there |
| 171 // are events coming back from the CDM and the session has been unregistered. | 172 // are events coming back from the CDM and the session has been unregistered. |
| 172 // We can not tell if the CDM is firing events at sessions that never existed. | 173 // We can not tell if the CDM is firing events at sessions that never existed. |
| 173 SessionMap::iterator session = sessions_.find(web_session_id); | 174 SessionMap::iterator session = sessions_.find(web_session_id); |
| 174 return (session != sessions_.end()) ? session->second.get() : NULL; | 175 return (session != sessions_.end()) ? session->second.get() : NULL; |
| 175 } | 176 } |
| 176 | 177 |
| 177 } // namespace media | 178 } // namespace media |
| OLD | NEW |