diff options
Diffstat (limited to 'media/mojo')
-rw-r--r-- | media/mojo/interfaces/content_decryption_module.mojom | 3 | ||||
-rw-r--r-- | media/mojo/services/mojo_cdm.cc | 12 | ||||
-rw-r--r-- | media/mojo/services/mojo_cdm.h | 3 | ||||
-rw-r--r-- | media/mojo/services/mojo_cdm_service.cc | 6 | ||||
-rw-r--r-- | media/mojo/services/mojo_cdm_service.h | 3 |
5 files changed, 20 insertions, 7 deletions
diff --git a/media/mojo/interfaces/content_decryption_module.mojom b/media/mojo/interfaces/content_decryption_module.mojom index aa3414df8..aeee15b 100644 --- a/media/mojo/interfaces/content_decryption_module.mojom +++ b/media/mojo/interfaces/content_decryption_module.mojom @@ -117,7 +117,8 @@ interface ContentDecryptionModule { // Session callbacks. See media/base/media_keys.h for details. interface ContentDecryptionModuleClient { - OnSessionMessage(string session_id, CdmMessageType message_type, array<uint8> message); + OnSessionMessage(string session_id, CdmMessageType message_type, + array<uint8> message, string legacy_destination_url); OnSessionClosed(string session_id); diff --git a/media/mojo/services/mojo_cdm.cc b/media/mojo/services/mojo_cdm.cc index efe7bac..69d2046 100644 --- a/media/mojo/services/mojo_cdm.cc +++ b/media/mojo/services/mojo_cdm.cc @@ -122,10 +122,18 @@ CdmContext* MojoCdm::GetCdmContext() { void MojoCdm::OnSessionMessage(const mojo::String& session_id, mojo::CdmMessageType message_type, - mojo::Array<uint8_t> message) { + mojo::Array<uint8_t> message, + const mojo::String& legacy_destination_url) { + GURL verified_gurl = GURL(legacy_destination_url); + if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) { + DLOG(WARNING) << "SessionMessage destination_url is invalid : " + << verified_gurl.possibly_invalid_spec(); + verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url. + } + session_message_cb_.Run(session_id, static_cast<MediaKeys::MessageType>(message_type), - message.storage()); + message.storage(), verified_gurl); } void MojoCdm::OnSessionClosed(const mojo::String& session_id) { diff --git a/media/mojo/services/mojo_cdm.h b/media/mojo/services/mojo_cdm.h index 4fda2ac..4083728 100644 --- a/media/mojo/services/mojo_cdm.h +++ b/media/mojo/services/mojo_cdm.h @@ -59,7 +59,8 @@ class MojoCdm : public MediaKeys, public mojo::ContentDecryptionModuleClient { // mojo::ContentDecryptionModuleClient implementation. void OnSessionMessage(const mojo::String& session_id, mojo::CdmMessageType message_type, - mojo::Array<uint8_t> message) final; + mojo::Array<uint8_t> message, + const mojo::String& legacy_destination_url) final; void OnSessionClosed(const mojo::String& session_id) final; void OnSessionError(const mojo::String& session_id, mojo::CdmException exception, diff --git a/media/mojo/services/mojo_cdm_service.cc b/media/mojo/services/mojo_cdm_service.cc index e53d43e0..17c3919 100644 --- a/media/mojo/services/mojo_cdm_service.cc +++ b/media/mojo/services/mojo_cdm_service.cc @@ -108,10 +108,12 @@ void MojoCdmService::GetCdmContext( void MojoCdmService::OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, - const std::vector<uint8_t>& message) { + const std::vector<uint8_t>& message, + const GURL& legacy_destination_url) { client()->OnSessionMessage(session_id, static_cast<mojo::CdmMessageType>(message_type), - mojo::Array<uint8_t>::From(message)); + mojo::Array<uint8_t>::From(message), + mojo::String::From(legacy_destination_url)); } void MojoCdmService::OnSessionKeysChange(const std::string& session_id, diff --git a/media/mojo/services/mojo_cdm_service.h b/media/mojo/services/mojo_cdm_service.h index bccd8e1..da8f372 100644 --- a/media/mojo/services/mojo_cdm_service.h +++ b/media/mojo/services/mojo_cdm_service.h @@ -53,7 +53,8 @@ class MojoCdmService // Callbacks for firing session events. void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, - const std::vector<uint8_t>& message); + const std::vector<uint8_t>& message, + const GURL& legacy_destination_url); void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info); |