diff options
author | jrummell <jrummell@chromium.org> | 2015-01-09 13:23:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-09 21:24:35 +0000 |
commit | f0e060fa5b90ed9363ccbe9a3cfd135706dfee55 (patch) | |
tree | aae4ccba9c8cd4614fc35d9499413dc2886fa936 /media/blink | |
parent | 8c2882777864cfbe31941bb9c610c4f2f97b3c9f (diff) | |
download | chromium_src-f0e060fa5b90ed9363ccbe9a3cfd135706dfee55.zip chromium_src-f0e060fa5b90ed9363ccbe9a3cfd135706dfee55.tar.gz chromium_src-f0e060fa5b90ed9363ccbe9a3cfd135706dfee55.tar.bz2 |
Pass MessageType in OnSessionMessage() calls
Latest CDMs return the message type, so this passes it through to
blink::. Removes |destinationURL| as it is up to the application
to determine what license server to communicate with, not the CDM.
BUG=442558
TEST=existing EME tests pass
Review URL: https://codereview.chromium.org/837003004
Cr-Commit-Position: refs/heads/master@{#310857}
Diffstat (limited to 'media/blink')
-rw-r--r-- | media/blink/cdm_session_adapter.cc | 6 | ||||
-rw-r--r-- | media/blink/cdm_session_adapter.h | 4 | ||||
-rw-r--r-- | media/blink/webcontentdecryptionmodulesession_impl.cc | 27 | ||||
-rw-r--r-- | media/blink/webcontentdecryptionmodulesession_impl.h | 4 |
4 files changed, 30 insertions, 11 deletions
diff --git a/media/blink/cdm_session_adapter.cc b/media/blink/cdm_session_adapter.cc index d47a1f2..29fc8bb 100644 --- a/media/blink/cdm_session_adapter.cc +++ b/media/blink/cdm_session_adapter.cc @@ -118,13 +118,13 @@ const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { } void CdmSessionAdapter::OnSessionMessage(const std::string& web_session_id, - const std::vector<uint8>& message, - const GURL& destination_url) { + MediaKeys::MessageType message_type, + const std::vector<uint8>& message) { WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " << web_session_id; if (session) - session->OnSessionMessage(message, destination_url); + session->OnSessionMessage(message_type, message); } void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id, diff --git a/media/blink/cdm_session_adapter.h b/media/blink/cdm_session_adapter.h index 896e66c..1f5a3c8 100644 --- a/media/blink/cdm_session_adapter.h +++ b/media/blink/cdm_session_adapter.h @@ -102,8 +102,8 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> { // Callbacks for firing session events. void OnSessionMessage(const std::string& web_session_id, - const std::vector<uint8>& message, - const GURL& destination_url); + MediaKeys::MessageType message_type, + const std::vector<uint8>& message); void OnSessionKeysChange(const std::string& web_session_id, bool has_additional_usable_key, CdmKeysInfo keys_info); diff --git a/media/blink/webcontentdecryptionmodulesession_impl.cc b/media/blink/webcontentdecryptionmodulesession_impl.cc index 4d97699..348ae44 100644 --- a/media/blink/webcontentdecryptionmodulesession_impl.cc +++ b/media/blink/webcontentdecryptionmodulesession_impl.cc @@ -29,6 +29,25 @@ const char kPersistentLicenseSessionType[] = "persistent-license"; const char kPersistentReleaseMessageSessionType[] = "persistent-release-message"; +static blink::WebContentDecryptionModuleSession::Client::MessageType +convertMessageType(MediaKeys::MessageType message_type) { + switch (message_type) { + case media::MediaKeys::LICENSE_REQUEST: + return blink::WebContentDecryptionModuleSession::Client::MessageType:: + LicenseRequest; + case media::MediaKeys::LICENSE_RENEWAL: + return blink::WebContentDecryptionModuleSession::Client::MessageType:: + LicenseRenewal; + case media::MediaKeys::LICENSE_RELEASE: + return blink::WebContentDecryptionModuleSession::Client::MessageType:: + LicenseRelease; + } + + NOTREACHED(); + return blink::WebContentDecryptionModuleSession::Client::MessageType:: + LicenseRequest; +} + WebContentDecryptionModuleSessionImpl::WebContentDecryptionModuleSessionImpl( const scoped_refptr<CdmSessionAdapter>& adapter) : adapter_(adapter), is_closed_(false), weak_ptr_factory_(this) { @@ -165,11 +184,11 @@ void WebContentDecryptionModuleSessionImpl::release( } void WebContentDecryptionModuleSessionImpl::OnSessionMessage( - const std::vector<uint8>& message, - const GURL& destination_url) { + MediaKeys::MessageType message_type, + const std::vector<uint8>& message) { DCHECK(client_) << "Client not set before message event"; - client_->message(message.empty() ? NULL : &message[0], message.size(), - destination_url); + client_->message(convertMessageType(message_type), + message.empty() ? NULL : &message[0], message.size()); } void WebContentDecryptionModuleSessionImpl::OnSessionKeysChange( diff --git a/media/blink/webcontentdecryptionmodulesession_impl.h b/media/blink/webcontentdecryptionmodulesession_impl.h index 423619a..c0892ec 100644 --- a/media/blink/webcontentdecryptionmodulesession_impl.h +++ b/media/blink/webcontentdecryptionmodulesession_impl.h @@ -55,8 +55,8 @@ class WebContentDecryptionModuleSessionImpl virtual void release(blink::WebContentDecryptionModuleResult result); // Callbacks. - void OnSessionMessage(const std::vector<uint8>& message, - const GURL& destination_url); + void OnSessionMessage(MediaKeys::MessageType message_type, + const std::vector<uint8>& message); void OnSessionKeysChange(bool has_additional_usable_key); void OnSessionExpirationUpdate(const base::Time& new_expiry_time); void OnSessionClosed(); |