Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 811923002: Changes to support CDM_7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass array Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/content_decryptor_delegate.cc
diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc
index a5c85bf3a6366bf4dbb7fd92f029ed23f0fd20da..b9a449a6de1a6793aa68afe0022adf84d2fa96bc 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -256,11 +256,12 @@ media::SampleFormat PpDecryptedSampleFormatToMediaSampleFormat(
PP_SessionType MediaSessionTypeToPpSessionType(
MediaKeys::SessionType session_type) {
+ // TODO(jrummell): Add support for PP_SESSIONTYPE_RELEASE_LICENSE.
switch (session_type) {
case MediaKeys::TEMPORARY_SESSION:
return PP_SESSIONTYPE_TEMPORARY;
case MediaKeys::PERSISTENT_SESSION:
- return PP_SESSIONTYPE_PERSISTENT;
+ return PP_SESSIONTYPE_PERSISTENT_LICENSE;
default:
NOTREACHED();
return PP_SESSIONTYPE_TEMPORARY;
@@ -320,6 +321,7 @@ ContentDecryptorDelegate::~ContentDecryptorDelegate() {
SatisfyAllPendingCallbacksOnError();
}
+// TODO(jrummell): Remove |session_ready_cb| and |session_keys_change_cb|.
void ContentDecryptorDelegate::Initialize(
const std::string& key_system,
const media::SessionMessageCB& session_message_cb,
@@ -368,6 +370,8 @@ void ContentDecryptorDelegate::SetServerCertificate(
pp_instance_, promise_id, certificate_array);
}
+// TODO(jrummell): Rename method to CreateSessionAndGenerateRequest()
+// and reorder parameter list.
void ContentDecryptorDelegate::CreateSession(
const std::string& init_data_type,
const uint8* init_data,
@@ -378,20 +382,19 @@ void ContentDecryptorDelegate::CreateSession(
PP_Var init_data_array =
PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
init_data_length, init_data);
- plugin_decryption_interface_->CreateSession(
- pp_instance_,
- promise_id,
- StringVar::StringToPPVar(init_data_type),
- init_data_array,
- MediaSessionTypeToPpSessionType(session_type));
+ plugin_decryption_interface_->CreateSessionAndGenerateRequest(
+ pp_instance_, promise_id, MediaSessionTypeToPpSessionType(session_type),
+ StringVar::StringToPPVar(init_data_type), init_data_array);
}
+// TODO(jrummell): Pass |session_type| to this method.
void ContentDecryptorDelegate::LoadSession(
const std::string& web_session_id,
scoped_ptr<NewSessionCdmPromise> promise) {
uint32_t promise_id = SavePromise(promise.Pass());
plugin_decryption_interface_->LoadSession(
- pp_instance_, promise_id, StringVar::StringToPPVar(web_session_id));
+ pp_instance_, promise_id, PP_SESSIONTYPE_PERSISTENT_LICENSE,
+ StringVar::StringToPPVar(web_session_id));
}
void ContentDecryptorDelegate::UpdateSession(
@@ -712,14 +715,6 @@ void ContentDecryptorDelegate::OnPromiseResolvedWithSession(
session_promise->resolve(web_session_id_string->value());
}
-void ContentDecryptorDelegate::OnPromiseResolvedWithKeyIds(
- uint32 promise_id,
- PP_Var key_ids_array) {
- // Since there are no calls to GetUsableKeyIds(), this should never be called.
- // FIXME(jrummell): remove once CDM interface updated.
- NOTREACHED();
-}
-
void ContentDecryptorDelegate::OnPromiseRejected(
uint32 promise_id,
PP_CdmExceptionCode exception_code,
@@ -739,9 +734,10 @@ void ContentDecryptorDelegate::OnPromiseRejected(
}
}
+// TODO(jrummell): Pass |message_type| to the callback.
void ContentDecryptorDelegate::OnSessionMessage(PP_Var web_session_id,
- PP_Var message,
- PP_Var destination_url) {
+ PP_CdmMessageType message_type,
+ PP_Var message) {
if (session_message_cb_.is_null())
return;
@@ -755,23 +751,16 @@ void ContentDecryptorDelegate::OnSessionMessage(PP_Var web_session_id,
message_vector.assign(data, data + message_array_buffer->ByteLength());
}
- StringVar* destination_url_string = StringVar::FromPPVar(destination_url);
- DCHECK(destination_url_string);
-
- GURL verified_gurl = GURL(destination_url_string->value());
- if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) {
- DLOG(WARNING) << "SessionMessage default_url is invalid : "
- << verified_gurl.possibly_invalid_spec();
- verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url.
- }
-
- session_message_cb_.Run(
- web_session_id_string->value(), message_vector, verified_gurl);
+ session_message_cb_.Run(web_session_id_string->value(), message_vector,
+ GURL::EmptyGURL());
}
+// TODO(jrummell): Decode |key_information| and pass it to the callback.
void ContentDecryptorDelegate::OnSessionKeysChange(
PP_Var web_session_id,
- PP_Bool has_additional_usable_key) {
+ PP_Bool has_additional_usable_key,
+ uint32_t key_count,
+ const struct PP_KeyInformation key_information[]) {
if (session_keys_change_cb_.is_null())
return;
@@ -795,12 +784,6 @@ void ContentDecryptorDelegate::OnSessionExpirationChange(
ppapi::PPTimeToTime(new_expiry_time));
}
-void ContentDecryptorDelegate::OnSessionReady(PP_Var web_session_id) {
- // Ready events no longer generated.
- // TODO(jrummell): Remove event from Pepper.
- NOTREACHED();
-}
-
void ContentDecryptorDelegate::OnSessionClosed(PP_Var web_session_id) {
if (session_closed_cb_.is_null())
return;

Powered by Google App Engine
This is Rietveld 408576698