summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 19:49:25 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-21 19:49:25 +0000
commit4bc3711a894161090a26a86191256520ccc7b5bd (patch)
tree09ed2a88ed2be6f85c4d76800beff701a4399579 /webkit
parent5ffbc626ebfad4eb89c4f20730c9583afc501151 (diff)
downloadchromium_src-4bc3711a894161090a26a86191256520ccc7b5bd.zip
chromium_src-4bc3711a894161090a26a86191256520ccc7b5bd.tar.gz
chromium_src-4bc3711a894161090a26a86191256520ccc7b5bd.tar.bz2
Remove KeyError in CdmWrapper::Decrypt().
Based on the EME spec, KeyError shouldn't be fired in decryption operations. Also, in CdmWrapper::DeliverBlock() and PluginInstance::DeliverBlock() we have code dealing with decryption failures. So we don't need to check the decryption status in CdmWrapper::Decrypt(). TBR=tomfinegan@chromium.org BUG=151454 TEST=http://codereview.chromium.org/10917202/ Review URL: https://chromiumcodereview.appspot.com/10963020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/media/crypto/ppapi/cdm_wrapper.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/webkit/media/crypto/ppapi/cdm_wrapper.cc b/webkit/media/crypto/ppapi/cdm_wrapper.cc
index 8300171..75c69d2 100644
--- a/webkit/media/crypto/ppapi/cdm_wrapper.cc
+++ b/webkit/media/crypto/ppapi/cdm_wrapper.cc
@@ -392,13 +392,6 @@ void CdmWrapper::Decrypt(pp::Buffer_Dev encrypted_buffer,
LinkedOutputBuffer output_buffer(new OutputBufferImpl());
cdm::Status status = cdm_->Decrypt(input_buffer, output_buffer.get());
- if (status != cdm::kSuccess || !output_buffer->buffer()) {
- CallOnMain(callback_factory_.NewCallback(&CdmWrapper::KeyError,
- std::string()));
- return;
- }
-
- PP_DCHECK(output_buffer->buffer());
CallOnMain(callback_factory_.NewCallback(
&CdmWrapper::DeliverBlock,
status,
@@ -446,6 +439,7 @@ void CdmWrapper::DeliverBlock(int32_t result,
switch (status) {
case cdm::kSuccess:
decrypted_block_info.result = PP_DECRYPTRESULT_SUCCESS;
+ PP_DCHECK(output_buffer.get() && output_buffer->buffer());
break;
case cdm::kNoKey:
decrypted_block_info.result = PP_DECRYPTRESULT_DECRYPT_NOKEY;
@@ -454,9 +448,12 @@ void CdmWrapper::DeliverBlock(int32_t result,
decrypted_block_info.result = PP_DECRYPTRESULT_DECRYPT_ERROR;
}
- pp::ContentDecryptor_Private::DeliverBlock(
- static_cast<PpbBuffer*>(output_buffer->buffer())->buffer_dev(),
- decrypted_block_info);
+ const pp::Buffer_Dev& buffer =
+ output_buffer.get() && output_buffer->buffer() ?
+ static_cast<PpbBuffer*>(output_buffer->buffer())->buffer_dev() :
+ pp::Buffer_Dev();
+
+ pp::ContentDecryptor_Private::DeliverBlock(buffer, decrypted_block_info);
}
// This object is the global object representing this plugin library as long