diff options
author | xhwang <xhwang@chromium.org> | 2015-01-22 12:01:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-22 20:03:01 +0000 |
commit | a3fe14e663ee6a2b545a0c06ec0df6bf6551115c (patch) | |
tree | a73416d60798cc9e9ead529303e8cca5922b1288 | |
parent | 962d0614b2a8508090fb509d295af7437f8796ea (diff) | |
download | chromium_src-a3fe14e663ee6a2b545a0c06ec0df6bf6551115c.zip chromium_src-a3fe14e663ee6a2b545a0c06ec0df6bf6551115c.tar.gz chromium_src-a3fe14e663ee6a2b545a0c06ec0df6bf6551115c.tar.bz2 |
media: Rename WebSessionId to SessionId.
Web session ID was introduced when we also have integer session IDs. Now we
have removed integer session IDs and we don't need the "web" prefix any more.
TEST=Renaming only.
Review URL: https://codereview.chromium.org/858313002
Cr-Commit-Position: refs/heads/master@{#312661}
40 files changed, 648 insertions, 699 deletions
diff --git a/content/browser/media/cdm/browser_cdm_manager.cc b/content/browser/media/cdm/browser_cdm_manager.cc index cb6d935..940867e 100644 --- a/content/browser/media/cdm/browser_cdm_manager.cc +++ b/content/browser/media/cdm/browser_cdm_manager.cc @@ -211,7 +211,7 @@ void BrowserCdmManager::ResolvePromiseWithSession( int cdm_id, uint32_t promise_id, const std::string& session_id) { - if (session_id.length() > media::limits::kMaxWebSessionIdLength) { + if (session_id.length() > media::limits::kMaxSessionIdLength) { RejectPromise(render_frame_id, cdm_id, promise_id, MediaKeys::INVALID_ACCESS_ERROR, 0, "Session ID is too long."); diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc index 75928db..ed13dc0 100644 --- a/content/renderer/media/crypto/ppapi_decryptor.cc +++ b/content/renderer/media/crypto/ppapi_decryptor.cc @@ -125,7 +125,7 @@ void PpapiDecryptor::CreateSessionAndGenerateRequest( void PpapiDecryptor::LoadSession( SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<media::NewSessionCdmPromise> promise) { DVLOG(2) << __FUNCTION__; DCHECK(render_loop_proxy_->BelongsToCurrentThread()); @@ -134,11 +134,11 @@ void PpapiDecryptor::LoadSession( promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist."); return; } - CdmDelegate()->LoadSession(session_type, web_session_id, promise.Pass()); + CdmDelegate()->LoadSession(session_type, session_id, promise.Pass()); } void PpapiDecryptor::UpdateSession( - const std::string& web_session_id, + const std::string& session_id, const uint8* response, int response_length, scoped_ptr<media::SimpleCdmPromise> promise) { @@ -148,11 +148,11 @@ void PpapiDecryptor::UpdateSession( promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist."); return; } - CdmDelegate()->UpdateSession(web_session_id, response, response_length, + CdmDelegate()->UpdateSession(session_id, response, response_length, promise.Pass()); } -void PpapiDecryptor::CloseSession(const std::string& web_session_id, +void PpapiDecryptor::CloseSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); @@ -161,11 +161,11 @@ void PpapiDecryptor::CloseSession(const std::string& web_session_id, return; } - CdmDelegate()->CloseSession(web_session_id, promise.Pass()); + CdmDelegate()->CloseSession(session_id, promise.Pass()); } void PpapiDecryptor::RemoveSession( - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); @@ -174,7 +174,7 @@ void PpapiDecryptor::RemoveSession( return; } - CdmDelegate()->RemoveSession(web_session_id, promise.Pass()); + CdmDelegate()->RemoveSession(session_id, promise.Pass()); } media::CdmContext* PpapiDecryptor::GetCdmContext() { @@ -386,16 +386,16 @@ void PpapiDecryptor::OnDecoderInitialized(StreamType stream_type, } } -void PpapiDecryptor::OnSessionMessage(const std::string& web_session_id, +void PpapiDecryptor::OnSessionMessage(const std::string& session_id, MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); - session_message_cb_.Run(web_session_id, message_type, message, + session_message_cb_.Run(session_id, message_type, message, legacy_destination_url); } -void PpapiDecryptor::OnSessionKeysChange(const std::string& web_session_id, +void PpapiDecryptor::OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, media::CdmKeysInfo keys_info) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); @@ -405,29 +405,29 @@ void PpapiDecryptor::OnSessionKeysChange(const std::string& web_session_id, if (has_additional_usable_key) AttemptToResumePlayback(); - session_keys_change_cb_.Run(web_session_id, has_additional_usable_key, + session_keys_change_cb_.Run(session_id, has_additional_usable_key, keys_info.Pass()); } void PpapiDecryptor::OnSessionExpirationUpdate( - const std::string& web_session_id, + const std::string& session_id, const base::Time& new_expiry_time) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); - session_expiration_update_cb_.Run(web_session_id, new_expiry_time); + session_expiration_update_cb_.Run(session_id, new_expiry_time); } -void PpapiDecryptor::OnSessionClosed(const std::string& web_session_id) { +void PpapiDecryptor::OnSessionClosed(const std::string& session_id) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); - session_closed_cb_.Run(web_session_id); + session_closed_cb_.Run(session_id); } -void PpapiDecryptor::OnSessionError(const std::string& web_session_id, +void PpapiDecryptor::OnSessionError(const std::string& session_id, MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_description) { DCHECK(render_loop_proxy_->BelongsToCurrentThread()); - session_error_cb_.Run( - web_session_id, exception_code, system_code, error_description); + session_error_cb_.Run(session_id, exception_code, system_code, + error_description); } void PpapiDecryptor::AttemptToResumePlayback() { diff --git a/content/renderer/media/crypto/ppapi_decryptor.h b/content/renderer/media/crypto/ppapi_decryptor.h index 7c1e2ea..f12fc2f 100644 --- a/content/renderer/media/crypto/ppapi_decryptor.h +++ b/content/renderer/media/crypto/ppapi_decryptor.h @@ -58,15 +58,15 @@ class PpapiDecryptor : public media::MediaKeys, int init_data_length, scoped_ptr<media::NewSessionCdmPromise> promise) override; void LoadSession(SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<media::NewSessionCdmPromise> promise) override; - void UpdateSession(const std::string& web_session_id, + void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<media::SimpleCdmPromise> promise) override; - void CloseSession(const std::string& web_session_id, + void CloseSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) override; - void RemoveSession(const std::string& web_session_id, + void RemoveSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) override; CdmContext* GetCdmContext() override; @@ -106,17 +106,17 @@ class PpapiDecryptor : public media::MediaKeys, void OnDecoderInitialized(StreamType stream_type, bool success); // Callbacks for |plugin_cdm_delegate_| to fire session events. - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url); - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, media::CdmKeysInfo keys_info); - void OnSessionExpirationUpdate(const std::string& web_session_id, + void OnSessionExpirationUpdate(const std::string& session_id, const base::Time& new_expiry_time); - void OnSessionClosed(const std::string& web_session_id); - void OnSessionError(const std::string& web_session_id, + void OnSessionClosed(const std::string& session_id); + void OnSessionError(const std::string& session_id, MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_description); diff --git a/content/renderer/media/crypto/proxy_media_keys.h b/content/renderer/media/crypto/proxy_media_keys.h index 0367940..bbd17e5 100644 --- a/content/renderer/media/crypto/proxy_media_keys.h +++ b/content/renderer/media/crypto/proxy_media_keys.h @@ -49,15 +49,15 @@ class ProxyMediaKeys : public media::MediaKeys, public media::CdmContext { int init_data_length, scoped_ptr<media::NewSessionCdmPromise> promise) override; void LoadSession(SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<media::NewSessionCdmPromise> promise) override; - void UpdateSession(const std::string& web_session_id, + void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<media::SimpleCdmPromise> promise) override; - void CloseSession(const std::string& web_session_id, + void CloseSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) override; - void RemoveSession(const std::string& web_session_id, + void RemoveSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise) override; media::CdmContext* GetCdmContext() override; diff --git a/content/renderer/media/crypto/renderer_cdm_manager.cc b/content/renderer/media/crypto/renderer_cdm_manager.cc index 85d004b..6ade4bb 100644 --- a/content/renderer/media/crypto/renderer_cdm_manager.cc +++ b/content/renderer/media/crypto/renderer_cdm_manager.cc @@ -172,7 +172,7 @@ void RendererCdmManager::OnPromiseResolvedWithSession( int cdm_id, uint32_t promise_id, const std::string& session_id) { - if (session_id.length() > media::limits::kMaxWebSessionIdLength) { + if (session_id.length() > media::limits::kMaxSessionIdLength) { NOTREACHED(); OnPromiseRejected(cdm_id, promise_id, MediaKeys::INVALID_ACCESS_ERROR, 0, "Session ID is too long"); diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc index cf0c3b2..da9fc0b 100644 --- a/content/renderer/pepper/content_decryptor_delegate.cc +++ b/content/renderer/pepper/content_decryptor_delegate.cc @@ -418,16 +418,16 @@ void ContentDecryptorDelegate::CreateSessionAndGenerateRequest( void ContentDecryptorDelegate::LoadSession( media::MediaKeys::SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise) { uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); plugin_decryption_interface_->LoadSession( pp_instance_, promise_id, MediaSessionTypeToPpSessionType(session_type), - StringVar::StringToPPVar(web_session_id)); + StringVar::StringToPPVar(session_id)); } void ContentDecryptorDelegate::UpdateSession( - const std::string& web_session_id, + const std::string& session_id, const uint8* response, int response_length, scoped_ptr<SimpleCdmPromise> promise) { @@ -436,16 +436,14 @@ void ContentDecryptorDelegate::UpdateSession( PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar( response_length, response); plugin_decryption_interface_->UpdateSession( - pp_instance_, - promise_id, - StringVar::StringToPPVar(web_session_id), + pp_instance_, promise_id, StringVar::StringToPPVar(session_id), response_array); } void ContentDecryptorDelegate::CloseSession( - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) { - if (web_session_id.length() > media::limits::kMaxWebSessionIdLength) { + if (session_id.length() > media::limits::kMaxSessionIdLength) { promise->reject( media::MediaKeys::INVALID_ACCESS_ERROR, 0, "Incorrect session."); return; @@ -453,13 +451,13 @@ void ContentDecryptorDelegate::CloseSession( uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); plugin_decryption_interface_->CloseSession( - pp_instance_, promise_id, StringVar::StringToPPVar(web_session_id)); + pp_instance_, promise_id, StringVar::StringToPPVar(session_id)); } void ContentDecryptorDelegate::RemoveSession( - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) { - if (web_session_id.length() > media::limits::kMaxWebSessionIdLength) { + if (session_id.length() > media::limits::kMaxSessionIdLength) { promise->reject( media::MediaKeys::INVALID_ACCESS_ERROR, 0, "Incorrect session."); return; @@ -467,7 +465,7 @@ void ContentDecryptorDelegate::RemoveSession( uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass()); plugin_decryption_interface_->RemoveSession( - pp_instance_, promise_id, StringVar::StringToPPVar(web_session_id)); + pp_instance_, promise_id, StringVar::StringToPPVar(session_id)); } // TODO(xhwang): Remove duplication of code in Decrypt(), @@ -717,13 +715,11 @@ void ContentDecryptorDelegate::OnPromiseResolved(uint32 promise_id) { cdm_promise_adapter_.ResolvePromise(promise_id); } -void ContentDecryptorDelegate::OnPromiseResolvedWithSession( - uint32 promise_id, - PP_Var web_session_id) { - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); - cdm_promise_adapter_.ResolvePromise(promise_id, - web_session_id_string->value()); +void ContentDecryptorDelegate::OnPromiseResolvedWithSession(uint32 promise_id, + PP_Var session_id) { + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); + cdm_promise_adapter_.ResolvePromise(promise_id, session_id_string->value()); } void ContentDecryptorDelegate::OnPromiseRejected( @@ -740,15 +736,15 @@ void ContentDecryptorDelegate::OnPromiseRejected( error_description_string->value()); } -void ContentDecryptorDelegate::OnSessionMessage(PP_Var web_session_id, +void ContentDecryptorDelegate::OnSessionMessage(PP_Var session_id, PP_CdmMessageType message_type, PP_Var message, PP_Var legacy_destination_url) { if (session_message_cb_.is_null()) return; - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); ArrayBufferVar* message_array_buffer = ArrayBufferVar::FromPPVar(message); std::vector<uint8> message_vector; @@ -771,21 +767,21 @@ void ContentDecryptorDelegate::OnSessionMessage(PP_Var web_session_id, verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url. } - session_message_cb_.Run(web_session_id_string->value(), + session_message_cb_.Run(session_id_string->value(), PpCdmMessageTypeToMediaMessageType(message_type), message_vector, verified_gurl); } void ContentDecryptorDelegate::OnSessionKeysChange( - PP_Var web_session_id, + PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { if (session_keys_change_cb_.is_null()) return; - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); media::CdmKeysInfo keys_info; keys_info.reserve(key_count); @@ -799,36 +795,36 @@ void ContentDecryptorDelegate::OnSessionKeysChange( keys_info.push_back(key_info.release()); } - session_keys_change_cb_.Run(web_session_id_string->value(), + session_keys_change_cb_.Run(session_id_string->value(), PP_ToBool(has_additional_usable_key), keys_info.Pass()); } void ContentDecryptorDelegate::OnSessionExpirationChange( - PP_Var web_session_id, + PP_Var session_id, PP_Time new_expiry_time) { if (session_expiration_update_cb_.is_null()) return; - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); - session_expiration_update_cb_.Run(web_session_id_string->value(), + session_expiration_update_cb_.Run(session_id_string->value(), ppapi::PPTimeToTime(new_expiry_time)); } -void ContentDecryptorDelegate::OnSessionClosed(PP_Var web_session_id) { +void ContentDecryptorDelegate::OnSessionClosed(PP_Var session_id) { if (session_closed_cb_.is_null()) return; - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); - session_closed_cb_.Run(web_session_id_string->value()); + session_closed_cb_.Run(session_id_string->value()); } void ContentDecryptorDelegate::OnSessionError( - PP_Var web_session_id, + PP_Var session_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description) { @@ -837,16 +833,15 @@ void ContentDecryptorDelegate::OnSessionError( if (session_error_cb_.is_null()) return; - StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); - DCHECK(web_session_id_string); + StringVar* session_id_string = StringVar::FromPPVar(session_id); + DCHECK(session_id_string); StringVar* error_description_string = StringVar::FromPPVar(error_description); DCHECK(error_description_string); - session_error_cb_.Run(web_session_id_string->value(), + session_error_cb_.Run(session_id_string->value(), PpExceptionTypeToMediaException(exception_code), - system_code, - error_description_string->value()); + system_code, error_description_string->value()); } void ContentDecryptorDelegate::DecoderInitializeDone( diff --git a/content/renderer/pepper/content_decryptor_delegate.h b/content/renderer/pepper/content_decryptor_delegate.h index 235bde1..f00274e 100644 --- a/content/renderer/pepper/content_decryptor_delegate.h +++ b/content/renderer/pepper/content_decryptor_delegate.h @@ -68,15 +68,15 @@ class ContentDecryptorDelegate { int init_data_length, scoped_ptr<media::NewSessionCdmPromise> promise); void LoadSession(media::MediaKeys::SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<media::NewSessionCdmPromise> promise); - void UpdateSession(const std::string& web_session_id, + void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<media::SimpleCdmPromise> promise); - void CloseSession(const std::string& web_session_id, + void CloseSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise); - void RemoveSession(const std::string& web_session_id, + void RemoveSession(const std::string& session_id, scoped_ptr<media::SimpleCdmPromise> promise); bool Decrypt(media::Decryptor::StreamType stream_type, const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, @@ -102,23 +102,22 @@ class ContentDecryptorDelegate { // PPB_ContentDecryptor_Private dispatching methods. void OnPromiseResolved(uint32 promise_id); - void OnPromiseResolvedWithSession(uint32 promise_id, PP_Var web_session_id); + void OnPromiseResolvedWithSession(uint32 promise_id, PP_Var session_id); void OnPromiseRejected(uint32 promise_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description); - void OnSessionMessage(PP_Var web_session_id, + void OnSessionMessage(PP_Var session_id, PP_CdmMessageType message_type, PP_Var message, PP_Var legacy_destination_url); - void OnSessionKeysChange(PP_Var web_session_id, + void OnSessionKeysChange(PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]); - void OnSessionExpirationChange(PP_Var web_session_id, - PP_Time new_expiry_time); - void OnSessionClosed(PP_Var web_session_id); - void OnSessionError(PP_Var web_session_id, + void OnSessionExpirationChange(PP_Var session_id, PP_Time new_expiry_time); + void OnSessionClosed(PP_Var session_id); + void OnSessionError(PP_Var session_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description); diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index cb53661..bb52461 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -2394,9 +2394,9 @@ void PepperPluginInstanceImpl::PromiseResolved(PP_Instance instance, void PepperPluginInstanceImpl::PromiseResolvedWithSession( PP_Instance instance, uint32 promise_id, - PP_Var web_session_id_var) { + PP_Var session_id_var) { content_decryptor_delegate_->OnPromiseResolvedWithSession(promise_id, - web_session_id_var); + session_id_var); } void PepperPluginInstanceImpl::PromiseRejected( @@ -2410,45 +2410,44 @@ void PepperPluginInstanceImpl::PromiseRejected( } void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmMessageType message_type, PP_Var message_var, PP_Var legacy_destination_url) { content_decryptor_delegate_->OnSessionMessage( - web_session_id_var, message_type, message_var, legacy_destination_url); + session_id_var, message_type, message_var, legacy_destination_url); } void PepperPluginInstanceImpl::SessionKeysChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { - content_decryptor_delegate_->OnSessionKeysChange(web_session_id_var, - has_additional_usable_key, - key_count, key_information); + content_decryptor_delegate_->OnSessionKeysChange( + session_id_var, has_additional_usable_key, key_count, key_information); } void PepperPluginInstanceImpl::SessionExpirationChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Time new_expiry_time) { - content_decryptor_delegate_->OnSessionExpirationChange(web_session_id_var, + content_decryptor_delegate_->OnSessionExpirationChange(session_id_var, new_expiry_time); } void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, - PP_Var web_session_id_var) { - content_decryptor_delegate_->OnSessionClosed(web_session_id_var); + PP_Var session_id_var) { + content_decryptor_delegate_->OnSessionClosed(session_id_var); } void PepperPluginInstanceImpl::SessionError(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) { content_decryptor_delegate_->OnSessionError( - web_session_id_var, exception_code, system_code, error_description_var); + session_id_var, exception_code, system_code, error_description_var); } void PepperPluginInstanceImpl::DeliverBlock( diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h index fc599aa..1f21842 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.h +++ b/content/renderer/pepper/pepper_plugin_instance_impl.h @@ -472,29 +472,29 @@ class CONTENT_EXPORT PepperPluginInstanceImpl void PromiseResolved(PP_Instance instance, uint32 promise_id) override; void PromiseResolvedWithSession(PP_Instance instance, uint32 promise_id, - PP_Var web_session_id_var) override; + PP_Var session_id_var) override; void PromiseRejected(PP_Instance instance, uint32 promise_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) override; void SessionMessage(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmMessageType message_type, PP_Var message_var, PP_Var legacy_destination_url) override; void SessionKeysChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) override; void SessionExpirationChange(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Time new_expiry_time) override; - void SessionClosed(PP_Instance instance, PP_Var web_session_id_var) override; + void SessionClosed(PP_Instance instance, PP_Var session_id_var) override; void SessionError(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) override; diff --git a/media/base/limits.h b/media/base/limits.h index 6ab1953..69a5b63 100644 --- a/media/base/limits.h +++ b/media/base/limits.h @@ -48,7 +48,7 @@ enum { // lengths are somewhat arbitrary as the EME spec doesn't specify any limits. kMinCertificateLength = 128, kMaxCertificateLength = 16 * 1024, - kMaxWebSessionIdLength = 512, + kMaxSessionIdLength = 512, kMinKeyIdLength = 1, kMaxKeyIdLength = 512, kMaxKeyIds = 128, diff --git a/media/base/media_keys.h b/media/base/media_keys.h index 6ddeb2a..fbb95a6 100644 --- a/media/base/media_keys.h +++ b/media/base/media_keys.h @@ -108,26 +108,26 @@ class MEDIA_EXPORT MediaKeys{ int init_data_length, scoped_ptr<NewSessionCdmPromise> promise) = 0; - // Loads a session with the |web_session_id| provided. + // Loads a session with the |session_id| provided. // Note: UpdateSession(), CloseSession() and RemoveSession() should only be // called after the |promise| is resolved. virtual void LoadSession(SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise) = 0; - // Updates a session specified by |web_session_id| with |response|. - virtual void UpdateSession(const std::string& web_session_id, + // Updates a session specified by |session_id| with |response|. + virtual void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<SimpleCdmPromise> promise) = 0; - // Closes the session specified by |web_session_id|. - virtual void CloseSession(const std::string& web_session_id, + // Closes the session specified by |session_id|. + virtual void CloseSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) = 0; // Removes stored session data associated with the session specified by - // |web_session_id|. - virtual void RemoveSession(const std::string& web_session_id, + // |session_id|. + virtual void RemoveSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) = 0; // Returns the CdmContext associated with |this|, which must NOT be null. @@ -144,24 +144,24 @@ class MEDIA_EXPORT MediaKeys{ // Key event callbacks. See the spec for details: // https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#event-summary -typedef base::Callback<void(const std::string& web_session_id, +typedef base::Callback<void(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url)> SessionMessageCB; -typedef base::Callback<void(const std::string& web_session_id)> SessionClosedCB; +typedef base::Callback<void(const std::string& session_id)> SessionClosedCB; -typedef base::Callback<void(const std::string& web_session_id, +typedef base::Callback<void(const std::string& session_id, MediaKeys::Exception exception, uint32 system_code, const std::string& error_message)> SessionErrorCB; -typedef base::Callback<void(const std::string& web_session_id, +typedef base::Callback<void(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info)> SessionKeysChangeCB; -typedef base::Callback<void(const std::string& web_session_id, +typedef base::Callback<void(const std::string& session_id, const base::Time& new_expiry_time)> SessionExpirationUpdateCB; diff --git a/media/blink/cdm_session_adapter.cc b/media/blink/cdm_session_adapter.cc index c2a1424..9fe248c 100644 --- a/media/blink/cdm_session_adapter.cc +++ b/media/blink/cdm_session_adapter.cc @@ -56,19 +56,19 @@ WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::CreateSession() { } bool CdmSessionAdapter::RegisterSession( - const std::string& web_session_id, + const std::string& session_id, base::WeakPtr<WebContentDecryptionModuleSessionImpl> session) { // If this session ID is already registered, don't register it again. - if (ContainsKey(sessions_, web_session_id)) + if (ContainsKey(sessions_, session_id)) return false; - sessions_[web_session_id] = session; + sessions_[session_id] = session; return true; } -void CdmSessionAdapter::UnregisterSession(const std::string& web_session_id) { - DCHECK(ContainsKey(sessions_, web_session_id)); - sessions_.erase(web_session_id); +void CdmSessionAdapter::UnregisterSession(const std::string& session_id) { + DCHECK(ContainsKey(sessions_, session_id)); + sessions_.erase(session_id); } void CdmSessionAdapter::InitializeNewSession( @@ -83,30 +83,27 @@ void CdmSessionAdapter::InitializeNewSession( } void CdmSessionAdapter::LoadSession(MediaKeys::SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise) { - media_keys_->LoadSession(session_type, web_session_id, promise.Pass()); + media_keys_->LoadSession(session_type, session_id, promise.Pass()); } -void CdmSessionAdapter::UpdateSession( - const std::string& web_session_id, - const uint8* response, - int response_length, - scoped_ptr<SimpleCdmPromise> promise) { - media_keys_->UpdateSession( - web_session_id, response, response_length, promise.Pass()); +void CdmSessionAdapter::UpdateSession(const std::string& session_id, + const uint8* response, + int response_length, + scoped_ptr<SimpleCdmPromise> promise) { + media_keys_->UpdateSession(session_id, response, response_length, + promise.Pass()); } -void CdmSessionAdapter::CloseSession( - const std::string& web_session_id, - scoped_ptr<SimpleCdmPromise> promise) { - media_keys_->CloseSession(web_session_id, promise.Pass()); +void CdmSessionAdapter::CloseSession(const std::string& session_id, + scoped_ptr<SimpleCdmPromise> promise) { + media_keys_->CloseSession(session_id, promise.Pass()); } -void CdmSessionAdapter::RemoveSession( - const std::string& web_session_id, - scoped_ptr<SimpleCdmPromise> promise) { - media_keys_->RemoveSession(web_session_id, promise.Pass()); +void CdmSessionAdapter::RemoveSession(const std::string& session_id, + scoped_ptr<SimpleCdmPromise> promise) { + media_keys_->RemoveSession(session_id, promise.Pass()); } CdmContext* CdmSessionAdapter::GetCdmContext() { @@ -118,61 +115,60 @@ const std::string& CdmSessionAdapter::GetKeySystemUMAPrefix() const { } void CdmSessionAdapter::OnSessionMessage( - const std::string& web_session_id, + const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& /* legacy_destination_url */) { - WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); + WebContentDecryptionModuleSessionImpl* session = GetSession(session_id); DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " - << web_session_id; + << session_id; if (session) session->OnSessionMessage(message_type, message); } -void CdmSessionAdapter::OnSessionKeysChange(const std::string& web_session_id, +void CdmSessionAdapter::OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) { // TODO(jrummell): Pass |keys_info| on. - WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); + WebContentDecryptionModuleSessionImpl* session = GetSession(session_id); DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " - << web_session_id; + << session_id; if (session) session->OnSessionKeysChange(has_additional_usable_key, keys_info.Pass()); } void CdmSessionAdapter::OnSessionExpirationUpdate( - const std::string& web_session_id, + const std::string& session_id, const base::Time& new_expiry_time) { - WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); + WebContentDecryptionModuleSessionImpl* session = GetSession(session_id); DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " - << web_session_id; + << session_id; if (session) session->OnSessionExpirationUpdate(new_expiry_time); } -void CdmSessionAdapter::OnSessionClosed(const std::string& web_session_id) { - WebContentDecryptionModuleSessionImpl* session = GetSession(web_session_id); +void CdmSessionAdapter::OnSessionClosed(const std::string& session_id) { + WebContentDecryptionModuleSessionImpl* session = GetSession(session_id); DLOG_IF(WARNING, !session) << __FUNCTION__ << " for unknown session " - << web_session_id; + << session_id; if (session) session->OnSessionClosed(); } -void CdmSessionAdapter::OnSessionError( - const std::string& web_session_id, - MediaKeys::Exception exception_code, - uint32 system_code, - const std::string& error_message) { +void CdmSessionAdapter::OnSessionError(const std::string& session_id, + MediaKeys::Exception exception_code, + uint32 system_code, + const std::string& error_message) { // Error events not used by unprefixed EME. // TODO(jrummell): Remove when prefixed EME removed. } WebContentDecryptionModuleSessionImpl* CdmSessionAdapter::GetSession( - const std::string& web_session_id) { + const std::string& session_id) { // Since session objects may get garbage collected, it is possible that there // are events coming back from the CDM and the session has been unregistered. // We can not tell if the CDM is firing events at sessions that never existed. - SessionMap::iterator session = sessions_.find(web_session_id); + SessionMap::iterator session = sessions_.find(session_id); return (session != sessions_.end()) ? session->second.get() : NULL; } diff --git a/media/blink/cdm_session_adapter.h b/media/blink/cdm_session_adapter.h index 768f1c4..d1b9b9a 100644 --- a/media/blink/cdm_session_adapter.h +++ b/media/blink/cdm_session_adapter.h @@ -23,7 +23,7 @@ class CdmFactory; class WebContentDecryptionModuleSessionImpl; // Owns the CDM instance and makes calls from session objects to the CDM. -// Forwards the web session ID-based callbacks of the MediaKeys interface to the +// Forwards the session ID-based callbacks of the MediaKeys interface to the // appropriate session object. Callers should hold references to this class // as long as they need the CDM instance. class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> { @@ -48,13 +48,13 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> { // Adds a session to the internal map. Called once the session is successfully // initialized. Returns true if the session was registered, false if there is - // already an existing session with the same |web_session_id|. + // already an existing session with the same |session_id|. bool RegisterSession( - const std::string& web_session_id, + const std::string& session_id, base::WeakPtr<WebContentDecryptionModuleSessionImpl> session); // Removes a session from the internal map. - void UnregisterSession(const std::string& web_session_id); + void UnregisterSession(const std::string& session_id); // Initializes a session with the |init_data_type|, |init_data| and // |session_type| provided. @@ -64,24 +64,24 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> { MediaKeys::SessionType session_type, scoped_ptr<NewSessionCdmPromise> promise); - // Loads the session specified by |web_session_id|. + // Loads the session specified by |session_id|. void LoadSession(MediaKeys::SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise); - // Updates the session specified by |web_session_id| with |response|. - void UpdateSession(const std::string& web_session_id, + // Updates the session specified by |session_id| with |response|. + void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<SimpleCdmPromise> promise); - // Closes the session specified by |web_session_id|. - void CloseSession(const std::string& web_session_id, + // Closes the session specified by |session_id|. + void CloseSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise); // Removes stored session data associated with the session specified by - // |web_session_id|. - void RemoveSession(const std::string& web_session_id, + // |session_id|. + void RemoveSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise); // Returns the CdmContext associated with |media_keys_|. @@ -101,24 +101,24 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> { ~CdmSessionAdapter(); // Callbacks for firing session events. - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url); - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info); - void OnSessionExpirationUpdate(const std::string& web_session_id, + void OnSessionExpirationUpdate(const std::string& session_id, const base::Time& new_expiry_time); - void OnSessionClosed(const std::string& web_session_id); - void OnSessionError(const std::string& web_session_id, + void OnSessionClosed(const std::string& session_id); + void OnSessionError(const std::string& session_id, MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_message); // Helper function of the callbacks. WebContentDecryptionModuleSessionImpl* GetSession( - const std::string& web_session_id); + const std::string& session_id); scoped_ptr<MediaKeys> media_keys_; diff --git a/media/blink/new_session_cdm_result_promise.cc b/media/blink/new_session_cdm_result_promise.cc index 6ac5247..0a07614 100644 --- a/media/blink/new_session_cdm_result_promise.cc +++ b/media/blink/new_session_cdm_result_promise.cc @@ -22,11 +22,11 @@ NewSessionCdmResultPromise::NewSessionCdmResultPromise( NewSessionCdmResultPromise::~NewSessionCdmResultPromise() { } -void NewSessionCdmResultPromise::resolve(const std::string& web_session_id) { +void NewSessionCdmResultPromise::resolve(const std::string& session_id) { MarkPromiseSettled(); ReportCdmResultUMA(uma_name_, SUCCESS); blink::WebContentDecryptionModuleResult::SessionStatus status = - new_session_created_cb_.Run(web_session_id); + new_session_created_cb_.Run(session_id); web_cdm_result_.completeWithSession(status); } diff --git a/media/blink/new_session_cdm_result_promise.h b/media/blink/new_session_cdm_result_promise.h index 7ed6ec1..c4b657d 100644 --- a/media/blink/new_session_cdm_result_promise.h +++ b/media/blink/new_session_cdm_result_promise.h @@ -16,7 +16,7 @@ namespace media { typedef base::Callback<blink::WebContentDecryptionModuleResult::SessionStatus( - const std::string& web_session_id)> SessionInitializedCB; + const std::string& session_id)> SessionInitializedCB; // Special class for resolving a new session promise. Resolving a new session // promise returns the session ID (as a string), but the blink promise needs @@ -32,7 +32,7 @@ class MEDIA_EXPORT NewSessionCdmResultPromise ~NewSessionCdmResultPromise() override; // CdmPromiseTemplate<T> implementation. - void resolve(const std::string& web_session_id) override; + void resolve(const std::string& session_id) override; void reject(MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_message) override; diff --git a/media/blink/webcontentdecryptionmodulesession_impl.cc b/media/blink/webcontentdecryptionmodulesession_impl.cc index 05aecdf..2cc1e19 100644 --- a/media/blink/webcontentdecryptionmodulesession_impl.cc +++ b/media/blink/webcontentdecryptionmodulesession_impl.cc @@ -77,8 +77,8 @@ WebContentDecryptionModuleSessionImpl::WebContentDecryptionModuleSessionImpl( WebContentDecryptionModuleSessionImpl:: ~WebContentDecryptionModuleSessionImpl() { - if (!web_session_id_.empty()) - adapter_->UnregisterSession(web_session_id_); + if (!session_id_.empty()) + adapter_->UnregisterSession(session_id_); } void WebContentDecryptionModuleSessionImpl::setClientInterface(Client* client) { @@ -86,7 +86,7 @@ void WebContentDecryptionModuleSessionImpl::setClientInterface(Client* client) { } blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const { - return blink::WebString::fromUTF8(web_session_id_); + return blink::WebString::fromUTF8(session_id_); } void WebContentDecryptionModuleSessionImpl::initializeNewSession( @@ -114,7 +114,7 @@ void WebContentDecryptionModuleSessionImpl::initializeNewSession( size_t init_data_length, const blink::WebString& session_type, blink::WebContentDecryptionModuleResult result) { - DCHECK(web_session_id_.empty()); + DCHECK(session_id_.empty()); // TODO(ddorwin): Guard against this in supported types check and remove this. // Chromium only supports ASCII MIME types. @@ -158,7 +158,7 @@ void WebContentDecryptionModuleSessionImpl::load( const blink::WebString& session_id, blink::WebContentDecryptionModuleResult result) { DCHECK(!session_id.isEmpty()); - DCHECK(web_session_id_.empty()); + DCHECK(session_id_.empty()); // TODO(jrummell): Now that there are 2 types of persistent sessions, the // session type should be passed from blink. Type should also be passed in the @@ -177,8 +177,8 @@ void WebContentDecryptionModuleSessionImpl::update( size_t response_length, blink::WebContentDecryptionModuleResult result) { DCHECK(response); - DCHECK(!web_session_id_.empty()); - adapter_->UpdateSession(web_session_id_, response, + DCHECK(!session_id_.empty()); + adapter_->UpdateSession(session_id_, response, base::saturated_cast<int>(response_length), scoped_ptr<SimpleCdmPromise>( new CdmResultPromise<>(result, std::string()))); @@ -186,16 +186,16 @@ void WebContentDecryptionModuleSessionImpl::update( void WebContentDecryptionModuleSessionImpl::close( blink::WebContentDecryptionModuleResult result) { - DCHECK(!web_session_id_.empty()); - adapter_->CloseSession(web_session_id_, + DCHECK(!session_id_.empty()); + adapter_->CloseSession(session_id_, scoped_ptr<SimpleCdmPromise>( new CdmResultPromise<>(result, std::string()))); } void WebContentDecryptionModuleSessionImpl::remove( blink::WebContentDecryptionModuleResult result) { - DCHECK(!web_session_id_.empty()); - adapter_->RemoveSession(web_session_id_, + DCHECK(!session_id_.empty()); + adapter_->RemoveSession(session_id_, scoped_ptr<SimpleCdmPromise>( new CdmResultPromise<>(result, std::string()))); } @@ -245,15 +245,14 @@ void WebContentDecryptionModuleSessionImpl::OnSessionClosed() { blink::WebContentDecryptionModuleResult::SessionStatus WebContentDecryptionModuleSessionImpl::OnSessionInitialized( - const std::string& web_session_id) { + const std::string& session_id) { // CDM will return NULL if the session to be loaded can't be found. - if (web_session_id.empty()) + if (session_id.empty()) return blink::WebContentDecryptionModuleResult::SessionNotFound; - DCHECK(web_session_id_.empty()) << "Session ID may not be changed once set."; - web_session_id_ = web_session_id; - return adapter_->RegisterSession(web_session_id_, - weak_ptr_factory_.GetWeakPtr()) + DCHECK(session_id_.empty()) << "Session ID may not be changed once set."; + session_id_ = session_id; + return adapter_->RegisterSession(session_id_, weak_ptr_factory_.GetWeakPtr()) ? blink::WebContentDecryptionModuleResult::NewSession : blink::WebContentDecryptionModuleResult::SessionAlreadyExists; } diff --git a/media/blink/webcontentdecryptionmodulesession_impl.h b/media/blink/webcontentdecryptionmodulesession_impl.h index 76cafd5..8097292 100644 --- a/media/blink/webcontentdecryptionmodulesession_impl.h +++ b/media/blink/webcontentdecryptionmodulesession_impl.h @@ -66,17 +66,17 @@ class WebContentDecryptionModuleSessionImpl private: // Called when a new session is created. blink::WebContentDecryptionModuleResult::SessionStatus OnSessionInitialized( - const std::string& web_session_id); + const std::string& session_id); scoped_refptr<CdmSessionAdapter> adapter_; // Non-owned pointer. Client* client_; - // Web session ID is the app visible ID for this session generated by the CDM. + // Session ID is the app visible ID for this session generated by the CDM. // This value is not set until the CDM resolves the initializeNewSession() // promise. - std::string web_session_id_; + std::string session_id_; // Don't pass more than 1 close() event to blink:: // TODO(jrummell): Remove this once blink tests handle close() promise and diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc index 7b94bd1..1c9171c 100644 --- a/media/cdm/aes_decryptor.cc +++ b/media/cdm/aes_decryptor.cc @@ -39,11 +39,11 @@ class AesDecryptor::SessionIdDecryptionKeyMap { // Replaces value if |session_id| is already present, or adds it if not. // This |decryption_key| becomes the latest until another insertion or // |session_id| is erased. - void Insert(const std::string& web_session_id, + void Insert(const std::string& session_id, scoped_ptr<DecryptionKey> decryption_key); // Deletes the entry for |session_id| if present. - void Erase(const std::string& web_session_id); + void Erase(const std::string& session_id); // Returns whether the list is empty bool Empty() const { return key_list_.empty(); } @@ -54,13 +54,13 @@ class AesDecryptor::SessionIdDecryptionKeyMap { return key_list_.begin()->second; } - bool Contains(const std::string& web_session_id) { - return Find(web_session_id) != key_list_.end(); + bool Contains(const std::string& session_id) { + return Find(session_id) != key_list_.end(); } private: - // Searches the list for an element with |web_session_id|. - KeyList::iterator Find(const std::string& web_session_id); + // Searches the list for an element with |session_id|. + KeyList::iterator Find(const std::string& session_id); // Deletes the entry pointed to by |position|. void Erase(KeyList::iterator position); @@ -71,28 +71,27 @@ class AesDecryptor::SessionIdDecryptionKeyMap { }; void AesDecryptor::SessionIdDecryptionKeyMap::Insert( - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<DecryptionKey> decryption_key) { - KeyList::iterator it = Find(web_session_id); + KeyList::iterator it = Find(session_id); if (it != key_list_.end()) Erase(it); DecryptionKey* raw_ptr = decryption_key.release(); - key_list_.push_front(std::make_pair(web_session_id, raw_ptr)); + key_list_.push_front(std::make_pair(session_id, raw_ptr)); } void AesDecryptor::SessionIdDecryptionKeyMap::Erase( - const std::string& web_session_id) { - KeyList::iterator it = Find(web_session_id); + const std::string& session_id) { + KeyList::iterator it = Find(session_id); if (it == key_list_.end()) return; Erase(it); } AesDecryptor::SessionIdDecryptionKeyMap::KeyList::iterator -AesDecryptor::SessionIdDecryptionKeyMap::Find( - const std::string& web_session_id) { +AesDecryptor::SessionIdDecryptionKeyMap::Find(const std::string& session_id) { for (KeyList::iterator it = key_list_.begin(); it != key_list_.end(); ++it) { - if (it->first == web_session_id) + if (it->first == session_id) return it; } return key_list_.end(); @@ -105,7 +104,7 @@ void AesDecryptor::SessionIdDecryptionKeyMap::Erase( key_list_.erase(position); } -uint32 AesDecryptor::next_web_session_id_ = 1; +uint32 AesDecryptor::next_session_id_ = 1; enum ClearBytesBufferSel { kSrcContainsClearBytes, @@ -252,8 +251,8 @@ void AesDecryptor::CreateSessionAndGenerateRequest( const uint8* init_data, int init_data_length, scoped_ptr<NewSessionCdmPromise> promise) { - std::string web_session_id(base::UintToString(next_web_session_id_++)); - valid_sessions_.insert(web_session_id); + std::string session_id(base::UintToString(next_session_id_++)); + valid_sessions_.insert(session_id); // For now, the AesDecryptor does not care about |init_data_type| or // |session_type|; just resolve the promise and then fire a message event @@ -263,22 +262,22 @@ void AesDecryptor::CreateSessionAndGenerateRequest( if (init_data && init_data_length) CreateLicenseRequest(init_data, init_data_length, session_type, &message); - promise->resolve(web_session_id); + promise->resolve(session_id); // No URL needed for license requests. - session_message_cb_.Run(web_session_id, LICENSE_REQUEST, message, + session_message_cb_.Run(session_id, LICENSE_REQUEST, message, GURL::EmptyGURL()); } void AesDecryptor::LoadSession(SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise) { // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems // that do not support loadSession. See http://crbug.com/342481 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); } -void AesDecryptor::UpdateSession(const std::string& web_session_id, +void AesDecryptor::UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<SimpleCdmPromise> promise) { @@ -286,7 +285,7 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id, CHECK_GT(response_length, 0); // TODO(jrummell): Convert back to a DCHECK once prefixed EME is removed. - if (valid_sessions_.find(web_session_id) == valid_sessions_.end()) { + if (valid_sessions_.find(session_id) == valid_sessions_.end()) { promise->reject(INVALID_ACCESS_ERROR, 0, "Session does not exist."); return; } @@ -316,7 +315,7 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id, promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid key length."); return; } - if (!AddDecryptionKey(web_session_id, it->first, it->second)) { + if (!AddDecryptionKey(session_id, it->first, it->second)) { promise->reject(INVALID_ACCESS_ERROR, 0, "Unable to add key."); return; } @@ -339,7 +338,7 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id, { base::AutoLock auto_lock(key_map_lock_); for (const auto& item : key_map_) { - if (item.second->Contains(web_session_id)) { + if (item.second->Contains(session_id)) { scoped_ptr<CdmKeyInformation> key_info(new CdmKeyInformation); key_info->key_id.assign(item.first.begin(), item.first.end()); key_info->status = CdmKeyInformation::USABLE; @@ -351,24 +350,24 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id, // Assume that at least 1 new key has been successfully added and thus // sending true for |has_additional_usable_key|. http://crbug.com/448219. - session_keys_change_cb_.Run(web_session_id, true, keys_info.Pass()); + session_keys_change_cb_.Run(session_id, true, keys_info.Pass()); } -void AesDecryptor::CloseSession(const std::string& web_session_id, +void AesDecryptor::CloseSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) { // Validate that this is a reference to an active session and then forget it. - std::set<std::string>::iterator it = valid_sessions_.find(web_session_id); + std::set<std::string>::iterator it = valid_sessions_.find(session_id); DCHECK(it != valid_sessions_.end()); valid_sessions_.erase(it); // Close the session. - DeleteKeysForSession(web_session_id); + DeleteKeysForSession(session_id); promise->resolve(); - session_closed_cb_.Run(web_session_id); + session_closed_cb_.Run(session_id); } -void AesDecryptor::RemoveSession(const std::string& web_session_id, +void AesDecryptor::RemoveSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) { // AesDecryptor doesn't keep any persistent data, so this should be // NOT_REACHED(). @@ -379,8 +378,8 @@ void AesDecryptor::RemoveSession(const std::string& web_session_id, // session, if it exists. // TODO(jrummell): Remove the close() call when prefixed EME is removed. // http://crbug.com/249976. - if (valid_sessions_.find(web_session_id) != valid_sessions_.end()) { - CloseSession(web_session_id, promise.Pass()); + if (valid_sessions_.find(session_id) != valid_sessions_.end()) { + CloseSession(session_id, promise.Pass()); return; } @@ -486,7 +485,7 @@ void AesDecryptor::DeinitializeDecoder(StreamType stream_type) { NOTREACHED() << "AesDecryptor does not support audio/video decoding"; } -bool AesDecryptor::AddDecryptionKey(const std::string& web_session_id, +bool AesDecryptor::AddDecryptionKey(const std::string& session_id, const std::string& key_id, const std::string& key_string) { scoped_ptr<DecryptionKey> decryption_key(new DecryptionKey(key_string)); @@ -498,14 +497,14 @@ bool AesDecryptor::AddDecryptionKey(const std::string& web_session_id, base::AutoLock auto_lock(key_map_lock_); KeyIdToSessionKeysMap::iterator key_id_entry = key_map_.find(key_id); if (key_id_entry != key_map_.end()) { - key_id_entry->second->Insert(web_session_id, decryption_key.Pass()); + key_id_entry->second->Insert(session_id, decryption_key.Pass()); return true; } // |key_id| not found, so need to create new entry. scoped_ptr<SessionIdDecryptionKeyMap> inner_map( new SessionIdDecryptionKeyMap()); - inner_map->Insert(web_session_id, decryption_key.Pass()); + inner_map->Insert(session_id, decryption_key.Pass()); key_map_.add(key_id, inner_map.Pass()); return true; } @@ -521,15 +520,15 @@ AesDecryptor::DecryptionKey* AesDecryptor::GetKey( return key_id_found->second->LatestDecryptionKey(); } -void AesDecryptor::DeleteKeysForSession(const std::string& web_session_id) { +void AesDecryptor::DeleteKeysForSession(const std::string& session_id) { base::AutoLock auto_lock(key_map_lock_); - // Remove all keys associated with |web_session_id|. Since the data is + // Remove all keys associated with |session_id|. Since the data is // optimized for access in GetKey(), we need to look at each entry in // |key_map_|. KeyIdToSessionKeysMap::iterator it = key_map_.begin(); while (it != key_map_.end()) { - it->second->Erase(web_session_id); + it->second->Erase(session_id); if (it->second->Empty()) { // Need to get rid of the entry for this key_id. This will mess up the // iterator, so we need to increment it first. diff --git a/media/cdm/aes_decryptor.h b/media/cdm/aes_decryptor.h index e7d2a05..99b83db 100644 --- a/media/cdm/aes_decryptor.h +++ b/media/cdm/aes_decryptor.h @@ -46,15 +46,15 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, int init_data_length, scoped_ptr<NewSessionCdmPromise> promise) override; void LoadSession(SessionType session_type, - const std::string& web_session_id, + const std::string& session_id, scoped_ptr<NewSessionCdmPromise> promise) override; - void UpdateSession(const std::string& web_session_id, + void UpdateSession(const std::string& session_id, const uint8* response, int response_length, scoped_ptr<SimpleCdmPromise> promise) override; - void CloseSession(const std::string& web_session_id, + void CloseSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) override; - void RemoveSession(const std::string& web_session_id, + void RemoveSession(const std::string& session_id, scoped_ptr<SimpleCdmPromise> promise) override; CdmContext* GetCdmContext() override; @@ -118,7 +118,7 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, // Creates a DecryptionKey using |key_string| and associates it with |key_id|. // Returns true if successful. - bool AddDecryptionKey(const std::string& web_session_id, + bool AddDecryptionKey(const std::string& session_id, const std::string& key_id, const std::string& key_string); @@ -126,8 +126,8 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, // the key. Returns NULL if no key is associated with |key_id|. DecryptionKey* GetKey(const std::string& key_id) const; - // Deletes all keys associated with |web_session_id|. - void DeleteKeysForSession(const std::string& web_session_id); + // Deletes all keys associated with |session_id|. + void DeleteKeysForSession(const std::string& session_id); // Callbacks for firing session events. SessionMessageCB session_message_cb_; @@ -143,9 +143,9 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, // Keeps track of current valid sessions. std::set<std::string> valid_sessions_; - // Make web session ID unique per renderer by making it static. Web session + // Make session ID unique per renderer by making it static. Session // IDs seen by the app will be "1", "2", etc. - static uint32 next_web_session_id_; + static uint32 next_session_id_; NewKeyCB new_audio_key_cb_; NewKeyCB new_video_key_cb_; diff --git a/media/cdm/aes_decryptor_unittest.cc b/media/cdm/aes_decryptor_unittest.cc index a630b02..3825ae1 100644 --- a/media/cdm/aes_decryptor_unittest.cc +++ b/media/cdm/aes_decryptor_unittest.cc @@ -238,10 +238,10 @@ class AesDecryptorTest : public testing::Test { protected: void OnResolveWithSession(PromiseResult expected_result, - const std::string& web_session_id) { + const std::string& session_id) { EXPECT_EQ(expected_result, RESOLVED) << "Unexpectedly resolved."; - EXPECT_GT(web_session_id.length(), 0ul); - web_session_id_ = web_session_id; + EXPECT_GT(session_id.length(), 0ul); + session_id_ = session_id; } void OnResolve(PromiseResult expected_result) { @@ -289,7 +289,7 @@ class AesDecryptorTest : public testing::Test { CreateSessionPromise(RESOLVED)); // This expects the promise to be called synchronously, which is the case // for AesDecryptor. - return web_session_id_; + return session_id_; } // Closes the session specified by |session_id|. @@ -308,14 +308,14 @@ class AesDecryptorTest : public testing::Test { } MOCK_METHOD2(OnSessionKeysChangeCalled, - void(const std::string& web_session_id, + void(const std::string& session_id, bool has_additional_usable_key)); - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) { keys_info_.swap(keys_info); - OnSessionKeysChangeCalled(web_session_id, has_additional_usable_key); + OnSessionKeysChangeCalled(session_id, has_additional_usable_key); } // Updates the session specified by |session_id| with |key|. |result| @@ -405,15 +405,15 @@ class AesDecryptorTest : public testing::Test { } MOCK_METHOD4(OnSessionMessage, - void(const std::string& web_session_id, + void(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url)); - MOCK_METHOD1(OnSessionClosed, void(const std::string& web_session_id)); + MOCK_METHOD1(OnSessionClosed, void(const std::string& session_id)); AesDecryptor decryptor_; AesDecryptor::DecryptCB decrypt_cb_; - std::string web_session_id_; + std::string session_id_; CdmKeysInfo keys_info_; // Constants for testing. diff --git a/media/cdm/ppapi/cdm_wrapper.h b/media/cdm/ppapi/cdm_wrapper.h index 08c6a77..56bb82e 100644 --- a/media/cdm/ppapi/cdm_wrapper.h +++ b/media/cdm/ppapi/cdm_wrapper.h @@ -53,19 +53,19 @@ class CdmWrapper { uint32_t init_data_size) = 0; virtual void LoadSession(uint32_t promise_id, cdm::SessionType session_type, - const char* web_session_id, - uint32_t web_session_id_size) = 0; + const char* session_id, + uint32_t session_id_size) = 0; virtual void UpdateSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size, + const char* session_id, + uint32_t session_id_size, const uint8_t* response, uint32_t response_size) = 0; virtual void CloseSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) = 0; + const char* session_id, + uint32_t session_id_size) = 0; virtual void RemoveSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) = 0; + const char* session_id, + uint32_t session_id_size) = 0; virtual void TimerExpired(void* context) = 0; virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, cdm::DecryptedBlock* decrypted_buffer) = 0; @@ -141,34 +141,30 @@ class CdmWrapperImpl : public CdmWrapper { virtual void LoadSession(uint32_t promise_id, cdm::SessionType session_type, - const char* web_session_id, - uint32_t web_session_id_size) override { - cdm_->LoadSession(promise_id, session_type, web_session_id, - web_session_id_size); + const char* session_id, + uint32_t session_id_size) override { + cdm_->LoadSession(promise_id, session_type, session_id, session_id_size); } virtual void UpdateSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size, + const char* session_id, + uint32_t session_id_size, const uint8_t* response, uint32_t response_size) override { - cdm_->UpdateSession(promise_id, - web_session_id, - web_session_id_size, - response, + cdm_->UpdateSession(promise_id, session_id, session_id_size, response, response_size); } virtual void CloseSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) override { - cdm_->CloseSession(promise_id, web_session_id, web_session_id_size); + const char* session_id, + uint32_t session_id_size) override { + cdm_->CloseSession(promise_id, session_id, session_id_size); } virtual void RemoveSession(uint32_t promise_id, - const char* web_session_id, - uint32_t web_session_id_size) override { - cdm_->RemoveSession(promise_id, web_session_id, web_session_id_size); + const char* session_id, + uint32_t session_id_size) override { + cdm_->RemoveSession(promise_id, session_id, session_id_size); } virtual void TimerExpired(void* context) override { @@ -252,9 +248,9 @@ template <> void CdmWrapperImpl<cdm::ContentDecryptionModule_6>::LoadSession( uint32_t promise_id, cdm::SessionType session_type, - const char* web_session_id, - uint32_t web_session_id_size) { - cdm_->LoadSession(promise_id, web_session_id, web_session_id_size); + const char* session_id, + uint32_t session_id_size) { + cdm_->LoadSession(promise_id, session_id, session_id_size); } template <> diff --git a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc index 8bca449..277b028 100644 --- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc +++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc @@ -77,7 +77,7 @@ const char kExternalClearKeyCrashKeySystem[] = // Constants for the enumalted session that can be loaded by LoadSession(). // These constants need to be in sync with // chrome/test/data/media/encrypted_media_utils.js -const char kLoadableWebSessionId[] = "LoadableSession"; +const char kLoadableSessionId[] = "LoadableSession"; const char kLoadableSessionContentType[] = "video/webm"; const uint8 kLoadableSessionKeyId[] = "0123456789012345"; const uint8 kLoadableSessionKey[] = @@ -300,18 +300,18 @@ void ClearKeyCdm::CreateSessionAndGenerateRequest(uint32 promise_id, StartFileIOTest(); } -// Loads a emulated stored session. Currently only |kLoadableWebSessionId| +// Loads a emulated stored session. Currently only |kLoadableSessionId| // (containing a |kLoadableSessionKey| for |kLoadableSessionKeyId|) is // supported. void ClearKeyCdm::LoadSession(uint32 promise_id, cdm::SessionType session_type, - const char* web_session_id, - uint32_t web_session_id_length) { + const char* session_id, + uint32_t session_id_length) { DVLOG(1) << __FUNCTION__; DCHECK_EQ(session_type, cdm::kPersistentLicense); - if (std::string(kLoadableWebSessionId) != - std::string(web_session_id, web_session_id_length)) { + if (std::string(kLoadableSessionId) != + std::string(session_id, session_id_length)) { // TODO(jrummell): This should be resolved with undefined, not rejected. std::string message("Incorrect session id specified for LoadSession()."); host_->OnRejectPromise(promise_id, @@ -339,15 +339,15 @@ void ClearKeyCdm::LoadSession(uint32 promise_id, } void ClearKeyCdm::UpdateSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length, + const char* session_id, + uint32_t session_id_length, const uint8* response, uint32 response_size) { DVLOG(1) << __FUNCTION__; - std::string web_session_str(web_session_id, web_session_id_length); + std::string web_session_str(session_id, session_id_length); // If updating the loadable session, use the actual session id generated. - if (web_session_str == std::string(kLoadableWebSessionId)) + if (web_session_str == std::string(kLoadableSessionId)) web_session_str = session_id_for_emulated_loadsession_; scoped_ptr<media::SimpleCdmPromise> promise(new media::CdmCallbackPromise<>( @@ -365,13 +365,13 @@ void ClearKeyCdm::UpdateSession(uint32 promise_id, } void ClearKeyCdm::CloseSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length) { + const char* session_id, + uint32_t session_id_length) { DVLOG(1) << __FUNCTION__; - std::string web_session_str(web_session_id, web_session_id_length); + std::string web_session_str(session_id, session_id_length); // If closing the loadable session, use the actual session id generated. - if (web_session_str == std::string(kLoadableWebSessionId)) + if (web_session_str == std::string(kLoadableSessionId)) web_session_str = session_id_for_emulated_loadsession_; scoped_ptr<media::SimpleCdmPromise> promise(new media::CdmCallbackPromise<>( @@ -383,13 +383,13 @@ void ClearKeyCdm::CloseSession(uint32 promise_id, } void ClearKeyCdm::RemoveSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length) { + const char* session_id, + uint32_t session_id_length) { DVLOG(1) << __FUNCTION__; - std::string web_session_str(web_session_id, web_session_id_length); + std::string web_session_str(session_id, session_id_length); // RemoveSession only allowed for the loadable session. - if (web_session_str == std::string(kLoadableWebSessionId)) { + if (web_session_str == std::string(kLoadableSessionId)) { web_session_str = session_id_for_emulated_loadsession_; } else { // TODO(jrummell): This should be a DCHECK once blink does the proper @@ -698,33 +698,33 @@ void ClearKeyCdm::LoadLoadableSession() { promise.Pass()); } -void ClearKeyCdm::OnSessionMessage(const std::string& web_session_id, +void ClearKeyCdm::OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) { DVLOG(1) << "OnSessionMessage: " << message.size(); // Ignore the message when we are waiting to update the loadable session. - if (web_session_id == session_id_for_emulated_loadsession_) + if (session_id == session_id_for_emulated_loadsession_) return; // OnSessionMessage() only called during CreateSession(), so no promise // involved (OnSessionCreated() called to resolve the CreateSession() // promise). - host_->OnSessionMessage(web_session_id.data(), web_session_id.length(), + host_->OnSessionMessage(session_id.data(), session_id.length(), cdm::kLicenseRequest, reinterpret_cast<const char*>(message.data()), message.size(), legacy_destination_url.spec().data(), legacy_destination_url.spec().size()); } -void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id, +void ClearKeyCdm::OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) { DVLOG(1) << "OnSessionKeysChange: " << keys_info.size(); - std::string session_id = web_session_id; - if (web_session_id == session_id_for_emulated_loadsession_) { + std::string new_session_id = session_id; + if (new_session_id == session_id_for_emulated_loadsession_) { // Save |keys_info| if the loadable session is still being created. This // event will then be forwarded on in OnLoadSessionUpdated(). if (promise_id_for_emulated_loadsession_ != 0) { @@ -735,41 +735,41 @@ void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id, // Loadable session has already been created, so pass this event on, // using the session_id callers expect to see. - session_id = std::string(kLoadableWebSessionId); + new_session_id = std::string(kLoadableSessionId); } std::vector<cdm::KeyInformation> keys_vector; ConvertCdmKeysInfo(keys_info.get(), &keys_vector); - host_->OnSessionKeysChange(session_id.data(), session_id.length(), + host_->OnSessionKeysChange(new_session_id.data(), new_session_id.length(), has_additional_usable_key, vector_as_array(&keys_vector), keys_vector.size()); } -void ClearKeyCdm::OnSessionClosed(const std::string& web_session_id) { - std::string session_id = web_session_id; - if (web_session_id == session_id_for_emulated_loadsession_) - session_id = std::string(kLoadableWebSessionId); - host_->OnSessionClosed(session_id.data(), session_id.length()); +void ClearKeyCdm::OnSessionClosed(const std::string& session_id) { + std::string new_session_id = session_id; + if (new_session_id == session_id_for_emulated_loadsession_) + new_session_id = std::string(kLoadableSessionId); + host_->OnSessionClosed(new_session_id.data(), new_session_id.length()); } void ClearKeyCdm::OnSessionCreated(uint32 promise_id, - const std::string& web_session_id) { + const std::string& session_id) { // Save the latest session ID for renewal and file IO test messages. - last_session_id_ = web_session_id; + last_session_id_ = session_id; - host_->OnResolveNewSessionPromise( - promise_id, web_session_id.data(), web_session_id.length()); + host_->OnResolveNewSessionPromise(promise_id, session_id.data(), + session_id.length()); } void ClearKeyCdm::OnSessionLoaded(uint32 promise_id, - const std::string& web_session_id) { + const std::string& session_id) { // Save the latest session ID for renewal and file IO test messages. - last_session_id_ = web_session_id; + last_session_id_ = session_id; - // |decryptor_| created some session as |web_session_id|, but going forward - // we need to map that to |kLoadableWebSessionId|, as that is what callers + // |decryptor_| created some session as |session_id|, but going forward + // we need to map that to |kLoadableSessionId|, as that is what callers // expect. - session_id_for_emulated_loadsession_ = web_session_id; + session_id_for_emulated_loadsession_ = session_id; // Delay LoadLoadableSession() to test the case where Decrypt*() calls are // made before the session is fully loaded. @@ -790,8 +790,8 @@ void ClearKeyCdm::OnLoadSessionUpdated() { // |promise_id_for_emulated_loadsession_| is the LoadSession() promise, // so resolve appropriately. host_->OnResolveNewSessionPromise(promise_id_for_emulated_loadsession_, - kLoadableWebSessionId, - strlen(kLoadableWebSessionId)); + kLoadableSessionId, + strlen(kLoadableSessionId)); promise_id_for_emulated_loadsession_ = 0; // Generate the KeysChange event now that the session is "loaded" if one @@ -807,9 +807,8 @@ void ClearKeyCdm::OnLoadSessionUpdated() { DCHECK(!keys_vector.empty()); ConvertCdmKeysInfo(keys_info.get(), &keys_vector); host_->OnSessionKeysChange( - kLoadableWebSessionId, strlen(kLoadableWebSessionId), - !keys_vector.empty(), vector_as_array(&keys_vector), - keys_vector.size()); + kLoadableSessionId, strlen(kLoadableSessionId), !keys_vector.empty(), + vector_as_array(&keys_vector), keys_vector.size()); } } diff --git a/media/cdm/ppapi/external_clear_key/clear_key_cdm.h b/media/cdm/ppapi/external_clear_key/clear_key_cdm.h index 7110f7f..0dc00b2 100644 --- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.h +++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.h @@ -43,19 +43,19 @@ class ClearKeyCdm : public ClearKeyCdmInterface { uint32 init_data_size) override; virtual void LoadSession(uint32 promise_id, cdm::SessionType session_type, - const char* web_session_id, - uint32_t web_session_id_length) override; + const char* session_id, + uint32_t session_id_length) override; virtual void UpdateSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length, + const char* session_id, + uint32_t session_id_length, const uint8* response, uint32 response_size) override; virtual void CloseSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length) override; + const char* session_id, + uint32_t session_id_length) override; virtual void RemoveSession(uint32 promise_id, - const char* web_session_id, - uint32_t web_session_id_length) override; + const char* session_id, + uint32_t session_id_length) override; virtual void SetServerCertificate( uint32 promise_id, const uint8_t* server_certificate_data, @@ -90,19 +90,19 @@ class ClearKeyCdm : public ClearKeyCdmInterface { void OnLoadSessionUpdated(); // ContentDecryptionModule callbacks. - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url); - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info); - void OnSessionClosed(const std::string& web_session_id); + void OnSessionClosed(const std::string& session_id); // Handle the success/failure of a promise. These methods are responsible for // calling |host_| to resolve or reject the promise. - void OnSessionCreated(uint32 promise_id, const std::string& web_session_id); - void OnSessionLoaded(uint32 promise_id, const std::string& web_session_id); + void OnSessionCreated(uint32 promise_id, const std::string& session_id); + void OnSessionLoaded(uint32 promise_id, const std::string& session_id); void OnPromiseResolved(uint32 promise_id); void OnPromiseFailed(uint32 promise_id, MediaKeys::Exception exception_code, @@ -144,7 +144,7 @@ class ClearKeyCdm : public ClearKeyCdmInterface { void OnFileIOTestComplete(bool success); // Keep track of the last session created. - void SetSessionId(const std::string& web_session_id); + void SetSessionId(const std::string& session_id); AesDecryptor decryptor_; @@ -159,7 +159,7 @@ class ClearKeyCdm : public ClearKeyCdmInterface { // UpdateSession() will be called to create a session with known keys. // |session_id_for_emulated_loadsession_| is used to keep track of the // session_id allocated by aes_decryptor, as the session_id will be returned - // as |kLoadableWebSessionId|. Future requests for this simulated session + // as |kLoadableSessionId|. Future requests for this simulated session // need to use |session_id_for_emulated_loadsession_| for all calls // to aes_decryptor. // |promise_id_for_emulated_loadsession_| is used to keep track of the diff --git a/media/cdm/proxy_decryptor.cc b/media/cdm/proxy_decryptor.cc index 434988b..dc05e8b 100644 --- a/media/cdm/proxy_decryptor.cc +++ b/media/cdm/proxy_decryptor.cc @@ -127,17 +127,16 @@ void ProxyDecryptor::AddKey(const uint8* key, int key_length, const uint8* init_data, int init_data_length, - const std::string& web_session_id) { + const std::string& session_id) { DVLOG(1) << "AddKey()"; // In the prefixed API, the session parameter provided to addKey() is // optional, so use the single existing session if it exists. - // TODO(jrummell): remove when the prefixed API is removed. - std::string session_id(web_session_id); - if (session_id.empty()) { + std::string new_session_id(session_id); + if (new_session_id.empty()) { if (active_sessions_.size() == 1) { base::hash_map<std::string, bool>::iterator it = active_sessions_.begin(); - session_id = it->first; + new_session_id = it->first; } else { OnSessionError(std::string(), MediaKeys::NOT_SUPPORTED_ERROR, @@ -149,11 +148,9 @@ void ProxyDecryptor::AddKey(const uint8* key, scoped_ptr<SimpleCdmPromise> promise(new CdmCallbackPromise<>( base::Bind(&ProxyDecryptor::GenerateKeyAdded, - weak_ptr_factory_.GetWeakPtr(), - web_session_id), + weak_ptr_factory_.GetWeakPtr(), session_id), base::Bind(&ProxyDecryptor::OnSessionError, - weak_ptr_factory_.GetWeakPtr(), - web_session_id))); + weak_ptr_factory_.GetWeakPtr(), session_id))); // EME WD spec only supports a single array passed to the CDM. For // Clear Key using v0.1b, both arrays are used (|init_data| is key_id). @@ -171,27 +168,24 @@ void ProxyDecryptor::AddKey(const uint8* key, std::string jwk = GenerateJWKSet(key, key_length, init_data, init_data_length); DCHECK(!jwk.empty()); - media_keys_->UpdateSession(session_id, + media_keys_->UpdateSession(new_session_id, reinterpret_cast<const uint8*>(jwk.data()), - jwk.size(), - promise.Pass()); + jwk.size(), promise.Pass()); return; } - media_keys_->UpdateSession(session_id, key, key_length, promise.Pass()); + media_keys_->UpdateSession(new_session_id, key, key_length, promise.Pass()); } -void ProxyDecryptor::CancelKeyRequest(const std::string& web_session_id) { +void ProxyDecryptor::CancelKeyRequest(const std::string& session_id) { DVLOG(1) << "CancelKeyRequest()"; scoped_ptr<SimpleCdmPromise> promise(new CdmCallbackPromise<>( base::Bind(&ProxyDecryptor::OnSessionClosed, - weak_ptr_factory_.GetWeakPtr(), - web_session_id), + weak_ptr_factory_.GetWeakPtr(), session_id), base::Bind(&ProxyDecryptor::OnSessionError, - weak_ptr_factory_.GetWeakPtr(), - web_session_id))); - media_keys_->RemoveSession(web_session_id, promise.Pass()); + weak_ptr_factory_.GetWeakPtr(), session_id))); + media_keys_->RemoveSession(session_id, promise.Pass()); } scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys( @@ -209,7 +203,7 @@ scoped_ptr<MediaKeys> ProxyDecryptor::CreateMediaKeys( base::Bind(&ProxyDecryptor::OnSessionExpirationUpdate, weak_this)); } -void ProxyDecryptor::OnSessionMessage(const std::string& web_session_id, +void ProxyDecryptor::OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) { @@ -220,34 +214,34 @@ void ProxyDecryptor::OnSessionMessage(const std::string& web_session_id, if (is_clear_key_) { std::vector<uint8> key; if (ExtractFirstKeyIdFromLicenseRequest(message, &key)) { - key_message_cb_.Run(web_session_id, key, legacy_destination_url); + key_message_cb_.Run(session_id, key, legacy_destination_url); return; } } - key_message_cb_.Run(web_session_id, message, legacy_destination_url); + key_message_cb_.Run(session_id, message, legacy_destination_url); } -void ProxyDecryptor::OnSessionKeysChange(const std::string& web_session_id, +void ProxyDecryptor::OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) { // EME v0.1b doesn't support this event. } void ProxyDecryptor::OnSessionExpirationUpdate( - const std::string& web_session_id, + const std::string& session_id, const base::Time& new_expiry_time) { // EME v0.1b doesn't support this event. } -void ProxyDecryptor::GenerateKeyAdded(const std::string& web_session_id) { +void ProxyDecryptor::GenerateKeyAdded(const std::string& session_id) { // EME WD doesn't support this event, but it is needed for EME v0.1b. - key_added_cb_.Run(web_session_id); + key_added_cb_.Run(session_id); } -void ProxyDecryptor::OnSessionClosed(const std::string& web_session_id) { +void ProxyDecryptor::OnSessionClosed(const std::string& session_id) { base::hash_map<std::string, bool>::iterator it = - active_sessions_.find(web_session_id); + active_sessions_.find(session_id); // Latest EME spec separates closing a session ("allows an application to // indicate that it no longer needs the session") and actually closing the @@ -262,14 +256,14 @@ void ProxyDecryptor::OnSessionClosed(const std::string& web_session_id) { return; if (it->second) { - OnSessionError(web_session_id, MediaKeys::NOT_SUPPORTED_ERROR, + OnSessionError(session_id, MediaKeys::NOT_SUPPORTED_ERROR, kSessionClosedSystemCode, "Do not close persistent sessions."); } active_sessions_.erase(it); } -void ProxyDecryptor::OnSessionError(const std::string& web_session_id, +void ProxyDecryptor::OnSessionError(const std::string& session_id, MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_message) { @@ -290,19 +284,19 @@ void ProxyDecryptor::OnSessionError(const std::string& web_session_id, error_code = MediaKeys::kUnknownError; break; } - key_error_cb_.Run(web_session_id, error_code, system_code); + key_error_cb_.Run(session_id, error_code, system_code); } void ProxyDecryptor::SetSessionId(SessionCreationType session_type, - const std::string& web_session_id) { + const std::string& session_id) { // Loaded sessions are considered persistent. bool is_persistent = session_type == PersistentSession || session_type == LoadSession; - active_sessions_.insert(std::make_pair(web_session_id, is_persistent)); + active_sessions_.insert(std::make_pair(session_id, is_persistent)); // For LoadSession(), generate the KeyAdded event. if (session_type == LoadSession) - GenerateKeyAdded(web_session_id); + GenerateKeyAdded(session_id); } } // namespace media diff --git a/media/cdm/proxy_decryptor.h b/media/cdm/proxy_decryptor.h index cad5700..2c760ea 100644 --- a/media/cdm/proxy_decryptor.h +++ b/media/cdm/proxy_decryptor.h @@ -32,7 +32,7 @@ class CdmFactory; class MEDIA_EXPORT ProxyDecryptor { public: // These are similar to the callbacks in media_keys.h, but pass back the - // web session ID rather than the internal session ID. + // session ID rather than the internal session ID. typedef base::Callback<void(const std::string& session_id)> KeyAddedCB; typedef base::Callback<void(const std::string& session_id, MediaKeys::KeyError error_code, @@ -71,18 +71,18 @@ class MEDIA_EXPORT ProxyDecryptor { const GURL& security_origin); // Callbacks for firing session events. - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url); - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info); - void OnSessionExpirationUpdate(const std::string& web_session_id, + void OnSessionExpirationUpdate(const std::string& session_id, const base::Time& new_expiry_time); - void GenerateKeyAdded(const std::string& web_session_id); - void OnSessionClosed(const std::string& web_session_id); - void OnSessionError(const std::string& web_session_id, + void GenerateKeyAdded(const std::string& session_id); + void OnSessionClosed(const std::string& session_id); + void OnSessionError(const std::string& session_id, MediaKeys::Exception exception_code, uint32 system_code, const std::string& error_message); @@ -95,7 +95,7 @@ class MEDIA_EXPORT ProxyDecryptor { // Called when a session is actually created or loaded. void SetSessionId(SessionCreationType session_type, - const std::string& web_session_id); + const std::string& session_id); // The real MediaKeys that manages key operations for the ProxyDecryptor. scoped_ptr<MediaKeys> media_keys_; diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc index 1f616a5..c4782c6 100644 --- a/media/test/pipeline_integration_test.cc +++ b/media/test/pipeline_integration_test.cc @@ -146,19 +146,19 @@ class FakeEncryptedMedia { public: virtual ~AppBase() {} - virtual void OnSessionMessage(const std::string& web_session_id, + virtual void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) = 0; - virtual void OnSessionClosed(const std::string& web_session_id) = 0; + virtual void OnSessionClosed(const std::string& session_id) = 0; - virtual void OnSessionKeysChange(const std::string& web_session_id, + virtual void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) = 0; // Errors are not expected unless overridden. - virtual void OnSessionError(const std::string& web_session_id, + virtual void OnSessionError(const std::string& session_id, const std::string& error_name, uint32 system_code, const std::string& error_message) { @@ -183,31 +183,30 @@ class FakeEncryptedMedia { CdmContext* GetCdmContext() { return &cdm_context_; } // Callbacks for firing session events. Delegate to |app_|. - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) { - app_->OnSessionMessage(web_session_id, message_type, message, + app_->OnSessionMessage(session_id, message_type, message, legacy_destination_url); } - void OnSessionClosed(const std::string& web_session_id) { - app_->OnSessionClosed(web_session_id); + void OnSessionClosed(const std::string& session_id) { + app_->OnSessionClosed(session_id); } - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) { - app_->OnSessionKeysChange(web_session_id, has_additional_usable_key, + app_->OnSessionKeysChange(session_id, has_additional_usable_key, keys_info.Pass()); } - void OnSessionError(const std::string& web_session_id, + void OnSessionError(const std::string& session_id, const std::string& error_name, uint32 system_code, const std::string& error_message) { - app_->OnSessionError( - web_session_id, error_name, system_code, error_message); + app_->OnSessionError(session_id, error_name, system_code, error_message); } void OnEncryptedMediaInitData(const std::string& init_data_type, @@ -243,10 +242,10 @@ class KeyProvidingApp : public FakeEncryptedMedia::AppBase { KeyProvidingApp() {} void OnResolveWithSession(PromiseResult expected, - const std::string& web_session_id) { + const std::string& session_id) { EXPECT_EQ(expected, RESOLVED); - EXPECT_GT(web_session_id.length(), 0ul); - current_session_id_ = web_session_id; + EXPECT_GT(session_id.length(), 0ul); + current_session_id_ = session_id; } void OnResolve(PromiseResult expected) { @@ -281,23 +280,23 @@ class KeyProvidingApp : public FakeEncryptedMedia::AppBase { return promise.Pass(); } - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) override { - EXPECT_FALSE(web_session_id.empty()); + EXPECT_FALSE(session_id.empty()); EXPECT_FALSE(message.empty()); - EXPECT_EQ(current_session_id_, web_session_id); + EXPECT_EQ(current_session_id_, session_id); } - void OnSessionClosed(const std::string& web_session_id) override { - EXPECT_EQ(current_session_id_, web_session_id); + void OnSessionClosed(const std::string& session_id) override { + EXPECT_EQ(current_session_id_, session_id); } - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) override { - EXPECT_EQ(current_session_id_, web_session_id); + EXPECT_EQ(current_session_id_, session_id); EXPECT_EQ(has_additional_usable_key, true); } @@ -408,24 +407,24 @@ class RotatingKeyProvidingApp : public KeyProvidingApp { // Ignores needkey and does not perform a license request class NoResponseApp : public FakeEncryptedMedia::AppBase { public: - void OnSessionMessage(const std::string& web_session_id, + void OnSessionMessage(const std::string& session_id, MediaKeys::MessageType message_type, const std::vector<uint8>& message, const GURL& legacy_destination_url) override { - EXPECT_FALSE(web_session_id.empty()); + EXPECT_FALSE(session_id.empty()); EXPECT_FALSE(message.empty()); FAIL() << "Unexpected Message"; } - void OnSessionClosed(const std::string& web_session_id) override { - EXPECT_FALSE(web_session_id.empty()); + void OnSessionClosed(const std::string& session_id) override { + EXPECT_FALSE(session_id.empty()); FAIL() << "Unexpected Closed"; } - void OnSessionKeysChange(const std::string& web_session_id, + void OnSessionKeysChange(const std::string& session_id, bool has_additional_usable_key, CdmKeysInfo keys_info) override { - EXPECT_FALSE(web_session_id.empty()); + EXPECT_FALSE(session_id.empty()); EXPECT_EQ(has_additional_usable_key, true); } diff --git a/ppapi/api/private/ppb_content_decryptor_private.idl b/ppapi/api/private/ppb_content_decryptor_private.idl index 10f998a..dcb9220 100644 --- a/ppapi/api/private/ppb_content_decryptor_private.idl +++ b/ppapi/api/private/ppb_content_decryptor_private.idl @@ -37,13 +37,13 @@ interface PPB_ContentDecryptor_Private { * * @param[in] promise_id Identifies the promise that the CDM resolved. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute. */ void PromiseResolvedWithSession( [in] PP_Instance instance, [in] uint32_t promise_id, - [in] PP_Var web_session_id); + [in] PP_Var session_id); /** @@ -80,7 +80,7 @@ interface PPB_ContentDecryptor_Private { * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls * required to prepare for decryption. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of a session for * which this message is intended. * @@ -96,7 +96,7 @@ interface PPB_ContentDecryptor_Private { */ void SessionMessage( [in] PP_Instance instance, - [in] PP_Var web_session_id, + [in] PP_Var session_id, [in] PP_CdmMessageType message_type, [in] PP_Var message, [in] PP_Var legacy_destination_url); @@ -104,7 +104,7 @@ interface PPB_ContentDecryptor_Private { /** * The keys for a session have changed. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of the session that has * a change in keys. * @@ -119,7 +119,7 @@ interface PPB_ContentDecryptor_Private { */ void SessionKeysChange( [in] PP_Instance instance, - [in] PP_Var web_session_id, + [in] PP_Var session_id, [in] PP_Bool has_additional_usable_key, [in] uint32_t key_count, [in, size_as=key_count] PP_KeyInformation[] key_information); @@ -127,7 +127,7 @@ interface PPB_ContentDecryptor_Private { /** * The expiration time for a session has changed. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of the session that has * a new expiration time. * @@ -137,7 +137,7 @@ interface PPB_ContentDecryptor_Private { */ void SessionExpirationChange( [in] PP_Instance instance, - [in] PP_Var web_session_id, + [in] PP_Var session_id, [in] PP_Time new_expiry_time); /** @@ -146,19 +146,19 @@ interface PPB_ContentDecryptor_Private { * <code>PPP_ContentDecryptor_Private</code> interface, or due to other * factors as determined by the CDM. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of * the session that is now closed. */ void SessionClosed( [in] PP_Instance instance, - [in] PP_Var web_session_id); + [in] PP_Var session_id); /** * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, * or within the plugin implementing the interface. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of * the session that caused the error. * @@ -172,7 +172,7 @@ interface PPB_ContentDecryptor_Private { */ void SessionError( [in] PP_Instance instance, - [in] PP_Var web_session_id, + [in] PP_Var session_id, [in] PP_CdmExceptionCode exception_code, [in] uint32_t system_code, [in] PP_Var error_description); diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl index 77ab49c..8f28960 100644 --- a/ppapi/api/private/ppp_content_decryptor_private.idl +++ b/ppapi/api/private/ppp_content_decryptor_private.idl @@ -51,7 +51,7 @@ interface PPP_ContentDecryptor_Private { * <code>init_data</code>. <code>init_data</code> is a data buffer * containing data for use in generating the request. * - * Note: <code>CreateSessionAndGenerateRequest()</code> must create a web + * Note: <code>CreateSessionAndGenerateRequest()</code> must create a * session ID and provide it to the browser via <code>SessionCreated()</code> * on the <code>PPB_ContentDecryptor_Private</code> interface. * @@ -76,10 +76,10 @@ interface PPP_ContentDecryptor_Private { [in] PP_Var init_data); /** - * Loads a session whose web session ID is <code>web_session_id</code>. + * Loads a session whose session ID is <code>session_id</code>. * * Note: After the session is successfully loaded, the CDM must call - * <code>SessionCreated()</code> with <code>web_session_id</code> on the + * <code>SessionCreated()</code> with <code>session_id</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * * @param[in] promise_id A reference for the promise that gets resolved or @@ -88,15 +88,15 @@ interface PPP_ContentDecryptor_Private { * @param[in] session_type A <code>PP_SessionType</code> that indicates the * type of session to be loaded. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to load. */ void LoadSession( [in] PP_Instance instance, [in] uint32_t promise_id, [in] PP_SessionType session_type, - [in] PP_Var web_session_id); + [in] PP_Var session_id); /** * Provides a license or other message to the decryptor. @@ -113,8 +113,8 @@ interface PPP_ContentDecryptor_Private { * @param[in] promise_id A reference for the promise that gets resolved or * rejected depending upon the success or failure of updating the session. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be updated. * * @param[in] response A <code>PP_Var</code> of type @@ -124,7 +124,7 @@ interface PPP_ContentDecryptor_Private { void UpdateSession( [in] PP_Instance instance, [in] uint32_t promise_id, - [in] PP_Var web_session_id, + [in] PP_Var session_id, [in] PP_Var response); /** @@ -133,15 +133,15 @@ interface PPP_ContentDecryptor_Private { * @param[in] promise_id A reference for the promise that gets resolved or * rejected depending upon the success or failure of closing the session. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be closed. * */ void CloseSession( [in] PP_Instance instance, [in] uint32_t promise_id, - [in] PP_Var web_session_id); + [in] PP_Var session_id); /** * Remove stored data associated with this session. @@ -150,15 +150,15 @@ interface PPP_ContentDecryptor_Private { * rejected depending upon the success or failure of removing the session * data. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be removed. * */ void RemoveSession( [in] PP_Instance instance, [in] uint32_t promise_id, - [in] PP_Var web_session_id); + [in] PP_Var session_id); /** * Decrypts the block and returns the unencrypted block via diff --git a/ppapi/c/private/ppb_content_decryptor_private.h b/ppapi/c/private/ppb_content_decryptor_private.h index da33117..61cae0d 100644 --- a/ppapi/c/private/ppb_content_decryptor_private.h +++ b/ppapi/c/private/ppb_content_decryptor_private.h @@ -55,12 +55,12 @@ struct PPB_ContentDecryptor_Private_0_13 { * * @param[in] promise_id Identifies the promise that the CDM resolved. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute. */ void (*PromiseResolvedWithSession)(PP_Instance instance, uint32_t promise_id, - struct PP_Var web_session_id); + struct PP_Var session_id); /** * A promise has been rejected by the CDM due to an error. * @@ -93,7 +93,7 @@ struct PPB_ContentDecryptor_Private_0_13 { * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls * required to prepare for decryption. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of a session for * which this message is intended. * @@ -108,14 +108,14 @@ struct PPB_ContentDecryptor_Private_0_13 { * message. */ void (*SessionMessage)(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_CdmMessageType message_type, struct PP_Var message, struct PP_Var legacy_destination_url); /** * The keys for a session have changed. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of the session that has * a change in keys. * @@ -129,14 +129,14 @@ struct PPB_ContentDecryptor_Private_0_13 { * that are the session's key IDs and their status. */ void (*SessionKeysChange)(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]); /** * The expiration time for a session has changed. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the ID of the session that has * a new expiration time. * @@ -145,7 +145,7 @@ struct PPB_ContentDecryptor_Private_0_13 { * since the Epoch (00:00:00 UTC, January 1, 1970). */ void (*SessionExpirationChange)(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_Time new_expiry_time); /** * The session has been closed as the result of a call to the @@ -153,16 +153,16 @@ struct PPB_ContentDecryptor_Private_0_13 { * <code>PPP_ContentDecryptor_Private</code> interface, or due to other * factors as determined by the CDM. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of * the session that is now closed. */ - void (*SessionClosed)(PP_Instance instance, struct PP_Var web_session_id); + void (*SessionClosed)(PP_Instance instance, struct PP_Var session_id); /** * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, * or within the plugin implementing the interface. * - * @param[in] web_session_id A <code>PP_Var</code> of type + * @param[in] session_id A <code>PP_Var</code> of type * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of * the session that caused the error. * @@ -175,7 +175,7 @@ struct PPB_ContentDecryptor_Private_0_13 { * <code>PP_VARTYPE_STRING</code> containing the error description. */ void (*SessionError)(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description); diff --git a/ppapi/c/private/ppp_content_decryptor_private.h b/ppapi/c/private/ppp_content_decryptor_private.h index 4945ab2..9bc5a83 100644 --- a/ppapi/c/private/ppp_content_decryptor_private.h +++ b/ppapi/c/private/ppp_content_decryptor_private.h @@ -69,7 +69,7 @@ struct PPP_ContentDecryptor_Private_0_13 { * <code>init_data</code>. <code>init_data</code> is a data buffer * containing data for use in generating the request. * - * Note: <code>CreateSessionAndGenerateRequest()</code> must create a web + * Note: <code>CreateSessionAndGenerateRequest()</code> must create a * session ID and provide it to the browser via <code>SessionCreated()</code> * on the <code>PPB_ContentDecryptor_Private</code> interface. * @@ -92,10 +92,10 @@ struct PPP_ContentDecryptor_Private_0_13 { struct PP_Var init_data_type, struct PP_Var init_data); /** - * Loads a session whose web session ID is <code>web_session_id</code>. + * Loads a session whose session ID is <code>session_id</code>. * * Note: After the session is successfully loaded, the CDM must call - * <code>SessionCreated()</code> with <code>web_session_id</code> on the + * <code>SessionCreated()</code> with <code>session_id</code> on the * <code>PPB_ContentDecryptor_Private</code> interface. * * @param[in] promise_id A reference for the promise that gets resolved or @@ -104,14 +104,14 @@ struct PPP_ContentDecryptor_Private_0_13 { * @param[in] session_type A <code>PP_SessionType</code> that indicates the * type of session to be loaded. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to load. */ void (*LoadSession)(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, - struct PP_Var web_session_id); + struct PP_Var session_id); /** * Provides a license or other message to the decryptor. * @@ -127,8 +127,8 @@ struct PPP_ContentDecryptor_Private_0_13 { * @param[in] promise_id A reference for the promise that gets resolved or * rejected depending upon the success or failure of updating the session. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be updated. * * @param[in] response A <code>PP_Var</code> of type @@ -137,7 +137,7 @@ struct PPP_ContentDecryptor_Private_0_13 { */ void (*UpdateSession)(PP_Instance instance, uint32_t promise_id, - struct PP_Var web_session_id, + struct PP_Var session_id, struct PP_Var response); /** * Close the specified session and related resources. @@ -145,14 +145,14 @@ struct PPP_ContentDecryptor_Private_0_13 { * @param[in] promise_id A reference for the promise that gets resolved or * rejected depending upon the success or failure of closing the session. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be closed. * */ void (*CloseSession)(PP_Instance instance, uint32_t promise_id, - struct PP_Var web_session_id); + struct PP_Var session_id); /** * Remove stored data associated with this session. * @@ -160,14 +160,14 @@ struct PPP_ContentDecryptor_Private_0_13 { * rejected depending upon the success or failure of removing the session * data. * - * @param[in] web_session_id A <code>PP_Var</code> of type - * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session + * @param[in] session_id A <code>PP_Var</code> of type + * <code>PP_VARTYPE_STRING</code> containing the session ID of the session * to be removed. * */ void (*RemoveSession)(PP_Instance instance, uint32_t promise_id, - struct PP_Var web_session_id); + struct PP_Var session_id); /** * Decrypts the block and returns the unencrypted block via * <code>DeliverBlock()</code> on the diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc index 68fc61e..76dc2f3 100644 --- a/ppapi/cpp/private/content_decryptor_private.cc +++ b/ppapi/cpp/private/content_decryptor_private.cc @@ -84,31 +84,31 @@ void CreateSessionAndGenerateRequest(PP_Instance instance, void LoadSession(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, - PP_Var web_session_id_arg) { + PP_Var session_id_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var web_session_id_var(web_session_id_arg); - if (!web_session_id_var.is_string()) + pp::Var session_id_var(session_id_arg); + if (!session_id_var.is_string()) return; static_cast<ContentDecryptor_Private*>(object) - ->LoadSession(promise_id, session_type, web_session_id_var.AsString()); + ->LoadSession(promise_id, session_type, session_id_var.AsString()); } void UpdateSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id_arg, + PP_Var session_id_arg, PP_Var response_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var web_session_id_var(web_session_id_arg); - if (!web_session_id_var.is_string()) + pp::Var session_id_var(session_id_arg); + if (!session_id_var.is_string()) return; pp::Var response_var(response_arg); @@ -117,39 +117,39 @@ void UpdateSession(PP_Instance instance, pp::VarArrayBuffer response(response_var); static_cast<ContentDecryptor_Private*>(object) - ->UpdateSession(promise_id, web_session_id_var.AsString(), response); + ->UpdateSession(promise_id, session_id_var.AsString(), response); } void CloseSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id_arg) { + PP_Var session_id_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var web_session_id_var(web_session_id_arg); - if (!web_session_id_var.is_string()) + pp::Var session_id_var(session_id_arg); + if (!session_id_var.is_string()) return; static_cast<ContentDecryptor_Private*>(object) - ->CloseSession(promise_id, web_session_id_var.AsString()); + ->CloseSession(promise_id, session_id_var.AsString()); } void RemoveSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id_arg) { + PP_Var session_id_arg) { void* object = Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); if (!object) return; - pp::Var web_session_id_var(web_session_id_arg); - if (!web_session_id_var.is_string()) + pp::Var session_id_var(session_id_arg); + if (!session_id_var.is_string()) return; static_cast<ContentDecryptor_Private*>(object) - ->RemoveSession(promise_id, web_session_id_var.AsString()); + ->RemoveSession(promise_id, session_id_var.AsString()); } void Decrypt(PP_Instance instance, @@ -282,13 +282,12 @@ void ContentDecryptor_Private::PromiseResolved(uint32_t promise_id) { void ContentDecryptor_Private::PromiseResolvedWithSession( uint32_t promise_id, - const std::string& web_session_id) { + const std::string& session_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->PromiseResolvedWithSession( - associated_instance_.pp_instance(), - promise_id, - web_session_id_var.pp_var()); + associated_instance_.pp_instance(), promise_id, + session_id_var.pp_var()); } } @@ -309,67 +308,62 @@ void ContentDecryptor_Private::PromiseRejected( } void ContentDecryptor_Private::SessionMessage( - const std::string& web_session_id, + const std::string& session_id, PP_CdmMessageType message_type, pp::VarArrayBuffer message, const std::string& legacy_destination_url) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); pp::Var legacy_destination_url_var(legacy_destination_url); get_interface<PPB_ContentDecryptor_Private>()->SessionMessage( - associated_instance_.pp_instance(), web_session_id_var.pp_var(), + associated_instance_.pp_instance(), session_id_var.pp_var(), message_type, message.pp_var(), legacy_destination_url_var.pp_var()); } } void ContentDecryptor_Private::SessionKeysChange( - const std::string& web_session_id, + const std::string& session_id, bool has_additional_usable_key, const std::vector<PP_KeyInformation>& key_information) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->SessionKeysChange( - associated_instance_.pp_instance(), web_session_id_var.pp_var(), + associated_instance_.pp_instance(), session_id_var.pp_var(), PP_FromBool(has_additional_usable_key), key_information.size(), key_information.empty() ? NULL : &key_information[0]); } } void ContentDecryptor_Private::SessionExpirationChange( - const std::string& web_session_id, + const std::string& session_id, PP_Time new_expiry_time) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->SessionExpirationChange( - associated_instance_.pp_instance(), - web_session_id_var.pp_var(), + associated_instance_.pp_instance(), session_id_var.pp_var(), new_expiry_time); } } -void ContentDecryptor_Private::SessionClosed( - const std::string& web_session_id) { +void ContentDecryptor_Private::SessionClosed(const std::string& session_id) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); get_interface<PPB_ContentDecryptor_Private>()->SessionClosed( - associated_instance_.pp_instance(), web_session_id_var.pp_var()); + associated_instance_.pp_instance(), session_id_var.pp_var()); } } void ContentDecryptor_Private::SessionError( - const std::string& web_session_id, + const std::string& session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, const std::string& error_description) { if (has_interface<PPB_ContentDecryptor_Private>()) { - pp::Var web_session_id_var(web_session_id); + pp::Var session_id_var(session_id); pp::Var error_description_var(error_description); get_interface<PPB_ContentDecryptor_Private>()->SessionError( - associated_instance_.pp_instance(), - web_session_id_var.pp_var(), - exception_code, - system_code, - error_description_var.pp_var()); + associated_instance_.pp_instance(), session_id_var.pp_var(), + exception_code, system_code, error_description_var.pp_var()); } } diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h index 589c3a7..97afeae 100644 --- a/ppapi/cpp/private/content_decryptor_private.h +++ b/ppapi/cpp/private/content_decryptor_private.h @@ -44,14 +44,14 @@ class ContentDecryptor_Private { pp::VarArrayBuffer init_data) = 0; virtual void LoadSession(uint32_t promise_id, PP_SessionType session_type, - const std::string& web_session_id) = 0; + const std::string& session_id) = 0; virtual void UpdateSession(uint32_t promise_id, - const std::string& web_session_id, + const std::string& session_id, pp::VarArrayBuffer response) = 0; virtual void CloseSession(uint32_t promise_id, - const std::string& web_session_id) = 0; + const std::string& session_id) = 0; virtual void RemoveSession(uint32_t promise_id, - const std::string& web_session_id) = 0; + const std::string& session_id) = 0; virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, const PP_EncryptedBlockInfo& encrypted_block_info) = 0; virtual void InitializeAudioDecoder( @@ -74,22 +74,22 @@ class ContentDecryptor_Private { // to the browser. void PromiseResolved(uint32_t promise_id); void PromiseResolvedWithSession(uint32_t promise_id, - const std::string& web_session_id); + const std::string& session_id); void PromiseRejected(uint32_t promise_id, PP_CdmExceptionCode exception_code, uint32_t system_code, const std::string& error_description); - void SessionMessage(const std::string& web_session_id, + void SessionMessage(const std::string& session_id, PP_CdmMessageType message_type, pp::VarArrayBuffer message, const std::string& legacy_destination_url); - void SessionKeysChange(const std::string& web_session_id, + void SessionKeysChange(const std::string& session_id, bool has_additional_usable_key, const std::vector<PP_KeyInformation>& key_information); - void SessionExpirationChange(const std::string& web_session_id, + void SessionExpirationChange(const std::string& session_id, PP_Time new_expiry_time); - void SessionClosed(const std::string& web_session_id); - void SessionError(const std::string& web_session_id, + void SessionClosed(const std::string& session_id); + void SessionError(const std::string& session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, const std::string& error_description); diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index e740514..3405169 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -2889,9 +2889,9 @@ static void Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolved(PP_Instance i iface->PromiseResolved(instance, promise_id); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolvedWithSession(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolvedWithSession(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->PromiseResolvedWithSession(instance, promise_id, *web_session_id); + iface->PromiseResolvedWithSession(instance, promise_id, *session_id); } static void Pnacl_M41_PPB_ContentDecryptor_Private_PromiseRejected(PP_Instance instance, uint32_t promise_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var* error_description) { @@ -2899,29 +2899,29 @@ static void Pnacl_M41_PPB_ContentDecryptor_Private_PromiseRejected(PP_Instance i iface->PromiseRejected(instance, promise_id, exception_code, system_code, *error_description); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionMessage(PP_Instance instance, struct PP_Var* web_session_id, PP_CdmMessageType message_type, struct PP_Var* message, struct PP_Var* legacy_destination_url) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionMessage(PP_Instance instance, struct PP_Var* session_id, PP_CdmMessageType message_type, struct PP_Var* message, struct PP_Var* legacy_destination_url) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->SessionMessage(instance, *web_session_id, message_type, *message, *legacy_destination_url); + iface->SessionMessage(instance, *session_id, message_type, *message, *legacy_destination_url); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionKeysChange(PP_Instance instance, struct PP_Var* web_session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionKeysChange(PP_Instance instance, struct PP_Var* session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->SessionKeysChange(instance, *web_session_id, has_additional_usable_key, key_count, key_information); + iface->SessionKeysChange(instance, *session_id, has_additional_usable_key, key_count, key_information); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionExpirationChange(PP_Instance instance, struct PP_Var* web_session_id, PP_Time new_expiry_time) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionExpirationChange(PP_Instance instance, struct PP_Var* session_id, PP_Time new_expiry_time) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->SessionExpirationChange(instance, *web_session_id, new_expiry_time); + iface->SessionExpirationChange(instance, *session_id, new_expiry_time); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionClosed(PP_Instance instance, struct PP_Var* web_session_id) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionClosed(PP_Instance instance, struct PP_Var* session_id) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->SessionClosed(instance, *web_session_id); + iface->SessionClosed(instance, *session_id); } -static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionError(PP_Instance instance, struct PP_Var* web_session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var* error_description) { +static void Pnacl_M41_PPB_ContentDecryptor_Private_SessionError(PP_Instance instance, struct PP_Var* session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var* error_description) { const struct PPB_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_13.real_iface; - iface->SessionError(instance, *web_session_id, exception_code, system_code, *error_description); + iface->SessionError(instance, *session_id, exception_code, system_code, *error_description); } static void Pnacl_M41_PPB_ContentDecryptor_Private_DeliverBlock(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info) { @@ -4525,32 +4525,32 @@ static void Pnacl_M41_PPP_ContentDecryptor_Private_CreateSessionAndGenerateReque temp_fp(instance, promise_id, session_type, &init_data_type, &init_data); } -static void Pnacl_M41_PPP_ContentDecryptor_Private_LoadSession(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var web_session_id) { +static void Pnacl_M41_PPP_ContentDecryptor_Private_LoadSession(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var session_id) { const struct PPP_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_13.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var* web_session_id) = - ((void (*)(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var* web_session_id))iface->LoadSession); - temp_fp(instance, promise_id, session_type, &web_session_id); + void (*temp_fp)(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var* session_id) = + ((void (*)(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, struct PP_Var* session_id))iface->LoadSession); + temp_fp(instance, promise_id, session_type, &session_id); } -static void Pnacl_M41_PPP_ContentDecryptor_Private_UpdateSession(PP_Instance instance, uint32_t promise_id, struct PP_Var web_session_id, struct PP_Var response) { +static void Pnacl_M41_PPP_ContentDecryptor_Private_UpdateSession(PP_Instance instance, uint32_t promise_id, struct PP_Var session_id, struct PP_Var response) { const struct PPP_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_13.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id, struct PP_Var* response) = - ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id, struct PP_Var* response))iface->UpdateSession); - temp_fp(instance, promise_id, &web_session_id, &response); + void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id, struct PP_Var* response) = + ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id, struct PP_Var* response))iface->UpdateSession); + temp_fp(instance, promise_id, &session_id, &response); } -static void Pnacl_M41_PPP_ContentDecryptor_Private_CloseSession(PP_Instance instance, uint32_t promise_id, struct PP_Var web_session_id) { +static void Pnacl_M41_PPP_ContentDecryptor_Private_CloseSession(PP_Instance instance, uint32_t promise_id, struct PP_Var session_id) { const struct PPP_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_13.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id) = - ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id))iface->CloseSession); - temp_fp(instance, promise_id, &web_session_id); + void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id) = + ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id))iface->CloseSession); + temp_fp(instance, promise_id, &session_id); } -static void Pnacl_M41_PPP_ContentDecryptor_Private_RemoveSession(PP_Instance instance, uint32_t promise_id, struct PP_Var web_session_id) { +static void Pnacl_M41_PPP_ContentDecryptor_Private_RemoveSession(PP_Instance instance, uint32_t promise_id, struct PP_Var session_id) { const struct PPP_ContentDecryptor_Private_0_13 *iface = Pnacl_WrapperInfo_PPP_ContentDecryptor_Private_0_13.real_iface; - void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id) = - ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* web_session_id))iface->RemoveSession); - temp_fp(instance, promise_id, &web_session_id); + void (*temp_fp)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id) = + ((void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var* session_id))iface->RemoveSession); + temp_fp(instance, promise_id, &session_id); } static void Pnacl_M41_PPP_ContentDecryptor_Private_Decrypt(PP_Instance instance, PP_Resource encrypted_block, const struct PP_EncryptedBlockInfo* encrypted_block_info) { @@ -5403,13 +5403,13 @@ static const struct PPP_Selection_Dev_0_3 Pnacl_Wrappers_PPP_Selection_Dev_0_3 = static const struct PPB_ContentDecryptor_Private_0_13 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_13 = { .PromiseResolved = (void (*)(PP_Instance instance, uint32_t promise_id))&Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolved, - .PromiseResolvedWithSession = (void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var web_session_id))&Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolvedWithSession, + .PromiseResolvedWithSession = (void (*)(PP_Instance instance, uint32_t promise_id, struct PP_Var session_id))&Pnacl_M41_PPB_ContentDecryptor_Private_PromiseResolvedWithSession, .PromiseRejected = (void (*)(PP_Instance instance, uint32_t promise_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description))&Pnacl_M41_PPB_ContentDecryptor_Private_PromiseRejected, - .SessionMessage = (void (*)(PP_Instance instance, struct PP_Var web_session_id, PP_CdmMessageType message_type, struct PP_Var message, struct PP_Var legacy_destination_url))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionMessage, - .SessionKeysChange = (void (*)(PP_Instance instance, struct PP_Var web_session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionKeysChange, - .SessionExpirationChange = (void (*)(PP_Instance instance, struct PP_Var web_session_id, PP_Time new_expiry_time))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionExpirationChange, - .SessionClosed = (void (*)(PP_Instance instance, struct PP_Var web_session_id))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionClosed, - .SessionError = (void (*)(PP_Instance instance, struct PP_Var web_session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionError, + .SessionMessage = (void (*)(PP_Instance instance, struct PP_Var session_id, PP_CdmMessageType message_type, struct PP_Var message, struct PP_Var legacy_destination_url))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionMessage, + .SessionKeysChange = (void (*)(PP_Instance instance, struct PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionKeysChange, + .SessionExpirationChange = (void (*)(PP_Instance instance, struct PP_Var session_id, PP_Time new_expiry_time))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionExpirationChange, + .SessionClosed = (void (*)(PP_Instance instance, struct PP_Var session_id))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionClosed, + .SessionError = (void (*)(PP_Instance instance, struct PP_Var session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description))&Pnacl_M41_PPB_ContentDecryptor_Private_SessionError, .DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M41_PPB_ContentDecryptor_Private_DeliverBlock, .DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M41_PPB_ContentDecryptor_Private_DecoderInitializeDone, .DecoderDeinitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id))&Pnacl_M41_PPB_ContentDecryptor_Private_DecoderDeinitializeDone, diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 7921f59..d23a077 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -785,20 +785,20 @@ IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_LoadSession, PP_Instance /* instance */, uint32_t /* promise_id */, PP_SessionType /* session_type */, - ppapi::proxy::SerializedVar /* web_session_id, String */) + ppapi::proxy::SerializedVar /* session_id, String */) IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_UpdateSession, PP_Instance /* instance */, uint32_t /* promise_id */, - ppapi::proxy::SerializedVar /* web_session_id, String */, + ppapi::proxy::SerializedVar /* session_id, String */, ppapi::proxy::SerializedVar /* response, ArrayBuffer */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_CloseSession, PP_Instance /* instance */, uint32_t /* promise_id */, - std::string /* web_session_id */) + std::string /* session_id */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_RemoveSession, PP_Instance /* instance */, uint32_t /* promise_id */, - std::string /* web_session_id */) + std::string /* session_id */) IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt, PP_Instance /* instance */, ppapi::proxy::PPPDecryptor_Buffer /* buffer */, @@ -1118,7 +1118,7 @@ IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_PromiseResolved, IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_PromiseResolvedWithSession, PP_Instance /* instance */, uint32_t /* promise_id */, - ppapi::proxy::SerializedVar /* web_session_id, String */) + ppapi::proxy::SerializedVar /* session_id, String */) IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_PromiseRejected, PP_Instance /* instance */, uint32_t /* promise_id */, @@ -1127,25 +1127,25 @@ IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_PromiseRejected, ppapi::proxy::SerializedVar /* error_description, String */) IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_SessionMessage, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* web_session_id, String */, + ppapi::proxy::SerializedVar /* session_id, String */, PP_CdmMessageType /* message_type */, ppapi::proxy::SerializedVar /* message, ArrayBuffer */, ppapi::proxy::SerializedVar /* destination_url, String */) IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_SessionKeysChange, PP_Instance /* instance */, - std::string /* web_session_id */, + std::string /* session_id */, PP_Bool /* has_additional_usable_key */, std::vector<PP_KeyInformation> /* key_information */) IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_SessionExpirationChange, PP_Instance /* instance */, - std::string /* web_session_id */, + std::string /* session_id */, PP_Time /* new_expiry_time */) IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_SessionClosed, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* web_session_id, String */) + ppapi::proxy::SerializedVar /* session_id, String */) IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_SessionError, PP_Instance /* instance */, - ppapi::proxy::SerializedVar /* web_session_id, String */, + ppapi::proxy::SerializedVar /* session_id, String */, PP_CdmExceptionCode /* exception_code */, int32_t /* system_code */, ppapi::proxy::SerializedVar /* error_description, String */) diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 31cdb04..f8b8ac9 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -575,12 +575,10 @@ void PPB_Instance_Proxy::PromiseResolved(PP_Instance instance, void PPB_Instance_Proxy::PromiseResolvedWithSession(PP_Instance instance, uint32 promise_id, - PP_Var web_session_id_var) { + PP_Var session_id_var) { dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseResolvedWithSession( - API_ID_PPB_INSTANCE, - instance, - promise_id, - SerializedVarSendInput(dispatcher(), web_session_id_var))); + API_ID_PPB_INSTANCE, instance, promise_id, + SerializedVarSendInput(dispatcher(), session_id_var))); } void PPB_Instance_Proxy::PromiseRejected(PP_Instance instance, @@ -598,26 +596,26 @@ void PPB_Instance_Proxy::PromiseRejected(PP_Instance instance, } void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmMessageType message_type, PP_Var message_var, PP_Var legacy_destination_url_var) { dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( API_ID_PPB_INSTANCE, instance, - SerializedVarSendInput(dispatcher(), web_session_id_var), message_type, + SerializedVarSendInput(dispatcher(), session_id_var), message_type, SerializedVarSendInput(dispatcher(), message_var), SerializedVarSendInput(dispatcher(), legacy_destination_url_var))); } void PPB_Instance_Proxy::SessionKeysChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { - StringVar* session_id = StringVar::FromPPVar(web_session_id_var); + StringVar* session_id = StringVar::FromPPVar(session_id_var); if (!session_id || - session_id->value().length() > media::limits::kMaxWebSessionIdLength) { + session_id->value().length() > media::limits::kMaxSessionIdLength) { NOTREACHED(); return; } @@ -635,11 +633,11 @@ void PPB_Instance_Proxy::SessionKeysChange( } void PPB_Instance_Proxy::SessionExpirationChange(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Time new_expiry_time) { - StringVar* session_id = StringVar::FromPPVar(web_session_id_var); + StringVar* session_id = StringVar::FromPPVar(session_id_var); if (!session_id || - session_id->value().length() > media::limits::kMaxWebSessionIdLength) { + session_id->value().length() > media::limits::kMaxSessionIdLength) { NOTREACHED(); return; } @@ -649,23 +647,20 @@ void PPB_Instance_Proxy::SessionExpirationChange(PP_Instance instance, } void PPB_Instance_Proxy::SessionClosed(PP_Instance instance, - PP_Var web_session_id_var) { + PP_Var session_id_var) { dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionClosed( - API_ID_PPB_INSTANCE, - instance, - SerializedVarSendInput(dispatcher(), web_session_id_var))); + API_ID_PPB_INSTANCE, instance, + SerializedVarSendInput(dispatcher(), session_id_var))); } void PPB_Instance_Proxy::SessionError(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) { dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionError( - API_ID_PPB_INSTANCE, - instance, - SerializedVarSendInput(dispatcher(), web_session_id_var), - exception_code, + API_ID_PPB_INSTANCE, instance, + SerializedVarSendInput(dispatcher(), session_id_var), exception_code, system_code, SerializedVarSendInput(dispatcher(), error_description_var))); } @@ -1244,13 +1239,13 @@ void PPB_Instance_Proxy::OnHostMsgPromiseResolved(PP_Instance instance, void PPB_Instance_Proxy::OnHostMsgPromiseResolvedWithSession( PP_Instance instance, uint32_t promise_id, - SerializedVarReceiveInput web_session_id) { + SerializedVarReceiveInput session_id) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->PromiseResolvedWithSession( - instance, promise_id, web_session_id.Get(dispatcher())); + enter.functions()->PromiseResolvedWithSession(instance, promise_id, + session_id.Get(dispatcher())); } } @@ -1274,7 +1269,7 @@ void PPB_Instance_Proxy::OnHostMsgPromiseRejected( void PPB_Instance_Proxy::OnHostMsgSessionMessage( PP_Instance instance, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, PP_CdmMessageType message_type, SerializedVarReceiveInput message, SerializedVarReceiveInput legacy_destination_url) { @@ -1282,15 +1277,15 @@ void PPB_Instance_Proxy::OnHostMsgSessionMessage( return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->SessionMessage( - instance, web_session_id.Get(dispatcher()), message_type, - message.Get(dispatcher()), legacy_destination_url.Get(dispatcher())); + enter.functions()->SessionMessage(instance, session_id.Get(dispatcher()), + message_type, message.Get(dispatcher()), + legacy_destination_url.Get(dispatcher())); } } void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( PP_Instance instance, - const std::string& web_session_id, + const std::string& session_id, PP_Bool has_additional_usable_key, const std::vector<PP_KeyInformation>& key_information) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) @@ -1303,44 +1298,43 @@ void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), - StringVar::StringToPPVar(web_session_id)); + ScopedPPVar session_id_var(ScopedPPVar::PassRef(), + StringVar::StringToPPVar(session_id)); enter.functions()->SessionKeysChange( - instance, web_session_id_var.get(), has_additional_usable_key, + instance, session_id_var.get(), has_additional_usable_key, key_information.size(), vector_as_array(&key_information)); } } void PPB_Instance_Proxy::OnHostMsgSessionExpirationChange( PP_Instance instance, - const std::string& web_session_id, + const std::string& session_id, PP_Time new_expiry_time) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), - StringVar::StringToPPVar(web_session_id)); - enter.functions()->SessionExpirationChange( - instance, web_session_id_var.get(), new_expiry_time); + ScopedPPVar session_id_var(ScopedPPVar::PassRef(), + StringVar::StringToPPVar(session_id)); + enter.functions()->SessionExpirationChange(instance, session_id_var.get(), + new_expiry_time); } } void PPB_Instance_Proxy::OnHostMsgSessionClosed( PP_Instance instance, - SerializedVarReceiveInput web_session_id) { + SerializedVarReceiveInput session_id) { if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->SessionClosed(instance, - web_session_id.Get(dispatcher())); + enter.functions()->SessionClosed(instance, session_id.Get(dispatcher())); } } void PPB_Instance_Proxy::OnHostMsgSessionError( PP_Instance instance, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, SerializedVarReceiveInput error_description) { @@ -1348,10 +1342,8 @@ void PPB_Instance_Proxy::OnHostMsgSessionError( return; EnterInstanceNoLock enter(instance); if (enter.succeeded()) { - enter.functions()->SessionError(instance, - web_session_id.Get(dispatcher()), - exception_code, - system_code, + enter.functions()->SessionError(instance, session_id.Get(dispatcher()), + exception_code, system_code, error_description.Get(dispatcher())); } } diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h index 6b38116..6cf3d06 100644 --- a/ppapi/proxy/ppb_instance_proxy.h +++ b/ppapi/proxy/ppb_instance_proxy.h @@ -124,29 +124,29 @@ class PPB_Instance_Proxy : public InterfaceProxy, void PromiseResolved(PP_Instance instance, uint32 promise_id) override; void PromiseResolvedWithSession(PP_Instance instance, uint32 promise_id, - PP_Var web_session_id_var) override; + PP_Var session_id_var) override; void PromiseRejected(PP_Instance instance, uint32 promise_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) override; void SessionMessage(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmMessageType message_type, PP_Var message_var, PP_Var legacy_destination_url_var) override; void SessionKeysChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) override; void SessionExpirationChange(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Time new_expiry_time) override; - void SessionClosed(PP_Instance instance, PP_Var web_session_id_var) override; + void SessionClosed(PP_Instance instance, PP_Var session_id_var) override; void SessionError(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) override; @@ -254,7 +254,7 @@ class PPB_Instance_Proxy : public InterfaceProxy, virtual void OnHostMsgPromiseResolvedWithSession( PP_Instance instance, uint32_t promise_id, - SerializedVarReceiveInput web_session_id); + SerializedVarReceiveInput session_id); virtual void OnHostMsgPromiseRejected( PP_Instance instance, uint32_t promise_id, @@ -263,24 +263,24 @@ class PPB_Instance_Proxy : public InterfaceProxy, SerializedVarReceiveInput error_description); virtual void OnHostMsgSessionMessage( PP_Instance instance, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, PP_CdmMessageType message_type, SerializedVarReceiveInput message, SerializedVarReceiveInput legacy_destination_url); virtual void OnHostMsgSessionKeysChange( PP_Instance instance, - const std::string& web_session_id, + const std::string& session_id, PP_Bool has_additional_usable_key, const std::vector<PP_KeyInformation>& key_information); virtual void OnHostMsgSessionExpirationChange( PP_Instance instance, - const std::string& web_session_id, + const std::string& session_id, PP_Time new_expiry_time); virtual void OnHostMsgSessionClosed(PP_Instance instance, - SerializedVarReceiveInput web_session_id); + SerializedVarReceiveInput session_id); virtual void OnHostMsgSessionError( PP_Instance instance, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, SerializedVarReceiveInput error_description); diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 0ec1d10..91ea370 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -181,7 +181,7 @@ void CreateSessionAndGenerateRequest(PP_Instance instance, void LoadSession(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, - PP_Var web_session_id) { + PP_Var session_id) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); @@ -190,12 +190,12 @@ void LoadSession(PP_Instance instance, dispatcher->Send(new PpapiMsg_PPPContentDecryptor_LoadSession( API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, promise_id, session_type, - SerializedVarSendInput(dispatcher, web_session_id))); + SerializedVarSendInput(dispatcher, session_id))); } void UpdateSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id, + PP_Var session_id, PP_Var response) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { @@ -204,57 +204,53 @@ void UpdateSession(PP_Instance instance, } dispatcher->Send(new PpapiMsg_PPPContentDecryptor_UpdateSession( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - promise_id, - SerializedVarSendInput(dispatcher, web_session_id), + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, promise_id, + SerializedVarSendInput(dispatcher, session_id), SerializedVarSendInput(dispatcher, response))); } void CloseSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id) { + PP_Var session_id) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - StringVar* session_id = StringVar::FromPPVar(web_session_id); - if (!session_id || - session_id->value().length() > media::limits::kMaxWebSessionIdLength) { + StringVar* session_id_string = StringVar::FromPPVar(session_id); + if (!session_id_string || + session_id_string->value().length() > + media::limits::kMaxSessionIdLength) { NOTREACHED(); return; } dispatcher->Send(new PpapiMsg_PPPContentDecryptor_CloseSession( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - promise_id, - session_id->value())); + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, promise_id, + session_id_string->value())); } void RemoveSession(PP_Instance instance, uint32_t promise_id, - PP_Var web_session_id) { + PP_Var session_id) { HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); if (!dispatcher) { NOTREACHED(); return; } - StringVar* session_id = StringVar::FromPPVar(web_session_id); - if (!session_id || - session_id->value().length() > media::limits::kMaxWebSessionIdLength) { + StringVar* session_id_string = StringVar::FromPPVar(session_id); + if (!session_id_string || + session_id_string->value().length() > + media::limits::kMaxSessionIdLength) { NOTREACHED(); return; } dispatcher->Send(new PpapiMsg_PPPContentDecryptor_RemoveSession( - API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, - instance, - promise_id, - session_id->value())); + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, instance, promise_id, + session_id_string->value())); } void Decrypt(PP_Instance instance, @@ -576,54 +572,47 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgLoadSession( PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, - SerializedVarReceiveInput web_session_id) { + SerializedVarReceiveInput session_id) { if (ppp_decryptor_impl_) { - CallWhileUnlocked( - ppp_decryptor_impl_->LoadSession, instance, promise_id, session_type, - ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); + CallWhileUnlocked(ppp_decryptor_impl_->LoadSession, instance, promise_id, + session_type, + ExtractReceivedVarAndAddRef(dispatcher(), &session_id)); } } void PPP_ContentDecryptor_Private_Proxy::OnMsgUpdateSession( PP_Instance instance, uint32_t promise_id, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, SerializedVarReceiveInput response) { if (ppp_decryptor_impl_) { - CallWhileUnlocked( - ppp_decryptor_impl_->UpdateSession, - instance, - promise_id, - ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id), - ExtractReceivedVarAndAddRef(dispatcher(), &response)); + CallWhileUnlocked(ppp_decryptor_impl_->UpdateSession, instance, promise_id, + ExtractReceivedVarAndAddRef(dispatcher(), &session_id), + ExtractReceivedVarAndAddRef(dispatcher(), &response)); } } void PPP_ContentDecryptor_Private_Proxy::OnMsgCloseSession( PP_Instance instance, uint32_t promise_id, - const std::string& web_session_id) { + const std::string& session_id) { if (ppp_decryptor_impl_) { - ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), - StringVar::StringToPPVar(web_session_id)); - CallWhileUnlocked(ppp_decryptor_impl_->CloseSession, - instance, - promise_id, - web_session_id_var.get()); + ScopedPPVar session_id_var(ScopedPPVar::PassRef(), + StringVar::StringToPPVar(session_id)); + CallWhileUnlocked(ppp_decryptor_impl_->CloseSession, instance, promise_id, + session_id_var.get()); } } void PPP_ContentDecryptor_Private_Proxy::OnMsgRemoveSession( PP_Instance instance, uint32_t promise_id, - const std::string& web_session_id) { + const std::string& session_id) { if (ppp_decryptor_impl_) { - ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), - StringVar::StringToPPVar(web_session_id)); - CallWhileUnlocked(ppp_decryptor_impl_->RemoveSession, - instance, - promise_id, - web_session_id_var.get()); + ScopedPPVar session_id_var(ScopedPPVar::PassRef(), + StringVar::StringToPPVar(session_id)); + CallWhileUnlocked(ppp_decryptor_impl_->RemoveSession, instance, promise_id, + session_id_var.get()); } } diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.h b/ppapi/proxy/ppp_content_decryptor_private_proxy.h index 398be63..cc67f94 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.h +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.h @@ -45,17 +45,17 @@ class PPP_ContentDecryptor_Private_Proxy : public InterfaceProxy { void OnMsgLoadSession(PP_Instance instance, uint32_t promise_id, PP_SessionType session_type, - SerializedVarReceiveInput web_session_id); + SerializedVarReceiveInput session_id); void OnMsgUpdateSession(PP_Instance instance, uint32_t promise_id, - SerializedVarReceiveInput web_session_id, + SerializedVarReceiveInput session_id, SerializedVarReceiveInput response); void OnMsgCloseSession(PP_Instance instance, uint32_t promise_id, - const std::string& web_session_id); + const std::string& session_id); void OnMsgRemoveSession(PP_Instance instance, uint32_t promise_id, - const std::string& web_session_id); + const std::string& session_id); void OnMsgDecrypt(PP_Instance instance, const PPPDecryptor_Buffer& encrypted_buffer, const std::string& serialized_encrypted_block_info); diff --git a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc index fd2adde..1a52c05 100644 --- a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc +++ b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc @@ -26,13 +26,13 @@ void PromiseResolved(PP_Instance instance, uint32_t promise_id) { void PromiseResolvedWithSession(PP_Instance instance, uint32_t promise_id, - struct PP_Var web_session_id) { + struct PP_Var session_id) { VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()"; EnterInstance enter(instance); if (enter.failed()) return; enter.functions()->PromiseResolvedWithSession(instance, promise_id, - web_session_id); + session_id); } void PromiseRejected(PP_Instance instance, @@ -49,7 +49,7 @@ void PromiseRejected(PP_Instance instance, } void SessionMessage(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_CdmMessageType message_type, struct PP_Var message, struct PP_Var legacy_destination_url) { @@ -57,12 +57,12 @@ void SessionMessage(PP_Instance instance, EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SessionMessage(instance, web_session_id, message_type, - message, legacy_destination_url); + enter.functions()->SessionMessage(instance, session_id, message_type, message, + legacy_destination_url); } void SessionKeysChange(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) { @@ -70,32 +70,32 @@ void SessionKeysChange(PP_Instance instance, EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SessionKeysChange(instance, web_session_id, + enter.functions()->SessionKeysChange(instance, session_id, has_additional_usable_key, key_count, key_information); } void SessionExpirationChange(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_Time new_expiry_time) { VLOG(4) << "PPB_ContentDecryptor_Private::SessionExpirationChange()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SessionExpirationChange(instance, web_session_id, + enter.functions()->SessionExpirationChange(instance, session_id, new_expiry_time); } -void SessionClosed(PP_Instance instance, struct PP_Var web_session_id) { +void SessionClosed(PP_Instance instance, struct PP_Var session_id) { VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SessionClosed(instance, web_session_id); + enter.functions()->SessionClosed(instance, session_id); } void SessionError(PP_Instance instance, - struct PP_Var web_session_id, + struct PP_Var session_id, PP_CdmExceptionCode exception_code, uint32_t system_code, struct PP_Var error_description) { @@ -103,7 +103,7 @@ void SessionError(PP_Instance instance, EnterInstance enter(instance); if (enter.failed()) return; - enter.functions()->SessionError(instance, web_session_id, exception_code, + enter.functions()->SessionError(instance, session_id, exception_code, system_code, error_description); } diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index b0fccbd..1b3b4da 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -165,30 +165,29 @@ class PPB_Instance_API { virtual void PromiseResolved(PP_Instance instance, uint32 promise_id) = 0; virtual void PromiseResolvedWithSession(PP_Instance instance, uint32 promise_id, - PP_Var web_session_id_var) = 0; + PP_Var session_id_var) = 0; virtual void PromiseRejected(PP_Instance instance, uint32 promise_id, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) = 0; virtual void SessionMessage(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmMessageType message_type, PP_Var message_var, PP_Var legacy_destination_url_var) = 0; virtual void SessionKeysChange( PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Bool has_additional_usable_key, uint32_t key_count, const struct PP_KeyInformation key_information[]) = 0; virtual void SessionExpirationChange(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_Time new_expiry_time) = 0; - virtual void SessionClosed(PP_Instance instance, - PP_Var web_session_id_var) = 0; + virtual void SessionClosed(PP_Instance instance, PP_Var session_id_var) = 0; virtual void SessionError(PP_Instance instance, - PP_Var web_session_id_var, + PP_Var session_id_var, PP_CdmExceptionCode exception_code, uint32 system_code, PP_Var error_description_var) = 0; |