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

Unified Diff: content/renderer/media/crypto/proxy_decryptor.cc

Issue 427993002: Implement ClearKey message format as JSON. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « no previous file | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/proxy_decryptor.cc
diff --git a/content/renderer/media/crypto/proxy_decryptor.cc b/content/renderer/media/crypto/proxy_decryptor.cc
index 05026803c9f3ea8b88304860714a84916f166861..8a9a757a9046c9150d95f7579429edfbd0e08d2f 100644
--- a/content/renderer/media/crypto/proxy_decryptor.cc
+++ b/content/renderer/media/crypto/proxy_decryptor.cc
@@ -247,6 +247,17 @@ void ProxyDecryptor::OnSessionMessage(const std::string& web_session_id,
const std::vector<uint8>& message,
const GURL& destination_url) {
// Assumes that OnSessionCreated() has been called before this.
+
+ // For ClearKey, convert the message from JSON into just passing the key
+ // as the message. If unable to extract the key, return the message unchanged.
+ if (is_clear_key_) {
+ std::vector<uint8> key;
+ if (media::ExtractFirstKeyIdFromLicenseRequest(message, &key)) {
+ key_message_cb_.Run(web_session_id, key, destination_url);
+ return;
+ }
+ }
+
key_message_cb_.Run(web_session_id, message, destination_url);
}
« no previous file with comments | « no previous file | media/cdm/aes_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698