| 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 e8dc612953d2b1ae9ff368e67c5098775faed1f9..7df203a893c6fc086c009d2f069360d0f9c2c443 100644
|
| --- a/content/renderer/pepper/content_decryptor_delegate.cc
|
| +++ b/content/renderer/pepper/content_decryptor_delegate.cc
|
| @@ -405,12 +405,10 @@ void ContentDecryptorDelegate::InstanceCrashed() {
|
| }
|
|
|
| void ContentDecryptorDelegate::SetServerCertificate(
|
| - const uint8_t* certificate,
|
| - uint32_t certificate_length,
|
| + const std::vector<uint8>& certificate,
|
| scoped_ptr<media::SimpleCdmPromise> promise) {
|
| - if (!certificate ||
|
| - certificate_length < media::limits::kMinCertificateLength ||
|
| - certificate_length > media::limits::kMaxCertificateLength) {
|
| + if (certificate.size() < media::limits::kMinCertificateLength ||
|
| + certificate.size() > media::limits::kMaxCertificateLength) {
|
| promise->reject(
|
| media::MediaKeys::INVALID_ACCESS_ERROR, 0, "Incorrect certificate.");
|
| return;
|
| @@ -419,7 +417,7 @@ void ContentDecryptorDelegate::SetServerCertificate(
|
| uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
|
| PP_Var certificate_array =
|
| PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
|
| - certificate_length, certificate);
|
| + certificate.size(), vector_as_array(&certificate));
|
| plugin_decryption_interface_->SetServerCertificate(
|
| pp_instance_, promise_id, certificate_array);
|
| }
|
| @@ -427,13 +425,12 @@ void ContentDecryptorDelegate::SetServerCertificate(
|
| void ContentDecryptorDelegate::CreateSessionAndGenerateRequest(
|
| MediaKeys::SessionType session_type,
|
| media::EmeInitDataType init_data_type,
|
| - const uint8* init_data,
|
| - int init_data_length,
|
| + const std::vector<uint8>& init_data,
|
| scoped_ptr<NewSessionCdmPromise> promise) {
|
| uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
|
| PP_Var init_data_array =
|
| PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
|
| - init_data_length, init_data);
|
| + init_data.size(), vector_as_array(&init_data));
|
| plugin_decryption_interface_->CreateSessionAndGenerateRequest(
|
| pp_instance_, promise_id, MediaSessionTypeToPpSessionType(session_type),
|
| MediaInitDataTypeToPpInitDataType(init_data_type), init_data_array);
|
| @@ -451,13 +448,12 @@ void ContentDecryptorDelegate::LoadSession(
|
|
|
| void ContentDecryptorDelegate::UpdateSession(
|
| const std::string& session_id,
|
| - const uint8* response,
|
| - int response_length,
|
| + const std::vector<uint8>& response,
|
| scoped_ptr<SimpleCdmPromise> promise) {
|
| uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
|
| PP_Var response_array =
|
| PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(
|
| - response_length, response);
|
| + response.size(), vector_as_array(&response));
|
| plugin_decryption_interface_->UpdateSession(
|
| pp_instance_, promise_id, StringVar::StringToPPVar(session_id),
|
| response_array);
|
|
|