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

Unified Diff: webkit/media/crypto/ppapi/cdm_wrapper.cc

Issue 11348365: Encrypted Media: Allows empty key message to be fired. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update doc Created 8 years 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
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/ppapi/cdm_wrapper.cc
diff --git a/webkit/media/crypto/ppapi/cdm_wrapper.cc b/webkit/media/crypto/ppapi/cdm_wrapper.cc
index c5f391c9287419ae1881b28117507aa0e389c626..b39f5d14ae02ff058012a8f1bd72b835b3cf9cbb 100644
--- a/webkit/media/crypto/ppapi/cdm_wrapper.cc
+++ b/webkit/media/crypto/ppapi/cdm_wrapper.cc
@@ -554,9 +554,7 @@ void CdmWrapper::GenerateKeyRequest(const std::string& key_system,
init_data.ByteLength(),
key_request.get());
PP_DCHECK(status == cdm::kSuccess || status == cdm::kSessionError);
- if (status != cdm::kSuccess ||
- !key_request->message() ||
- key_request->message()->size() == 0) {
+ if (status != cdm::kSuccess) {
FireKeyError("");
return;
}
@@ -816,8 +814,13 @@ void CdmWrapper::KeyAdded(int32_t result, const std::string& session_id) {
void CdmWrapper::KeyMessage(int32_t result,
const LinkedKeyMessage& key_message) {
PP_DCHECK(result == PP_OK);
- pp::Buffer_Dev message_buffer =
- static_cast<const PpbBuffer*>(key_message->message())->buffer_dev();
+
+ pp::Buffer_Dev message_buffer;
+ if (key_message->message()) {
+ message_buffer = static_cast<const PpbBuffer*>(
+ key_message->message())->buffer_dev();
+ }
+
pp::ContentDecryptor_Private::KeyMessage(
key_system_,
key_message->session_id_string(),
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698