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

Unified Diff: chrome/browser/media/encrypted_media_message_filter_android.cc

Issue 185993004: Encrypted Media: Confine UUID code to MediaDrmBridge. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 9 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 | « android_webview/renderer/aw_key_systems.cc ('k') | chrome/common/encrypted_media_messages_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/encrypted_media_message_filter_android.cc
diff --git a/chrome/browser/media/encrypted_media_message_filter_android.cc b/chrome/browser/media/encrypted_media_message_filter_android.cc
index 73d147a2f8cf2cb397782a99d48ffbebb3d2235b..b4a55a9fa4ae629807577c2f74a0f6df68f55ebd 100644
--- a/chrome/browser/media/encrypted_media_message_filter_android.cc
+++ b/chrome/browser/media/encrypted_media_message_filter_android.cc
@@ -17,6 +17,8 @@ using media::MediaDrmBridge;
namespace chrome {
+const size_t kMaxKeySystemLength = 256;
+
// Check whether the available codecs are supported.
static android::SupportedCodecs GetSupportedCodecs(
android::SupportedCodecs requested_codecs,
@@ -72,21 +74,29 @@ void EncryptedMediaMessageFilterAndroid::OverrideThreadForMessage(
void EncryptedMediaMessageFilterAndroid::OnGetSupportedKeySystems(
const SupportedKeySystemRequest& request,
SupportedKeySystemResponse* response) {
+ if (!response) {
+ NOTREACHED() << "NULL response pointer provided.";
+ return;
+ }
+
+ if (request.key_system.size() > kMaxKeySystemLength) {
+ NOTREACHED() << "Invalid key system: " << request.key_system;
+ return;
+ }
+
if (!MediaDrmBridge::IsAvailable() || !MediaCodecBridge::IsAvailable())
return;
// TODO(qinmin): Convert codecs to container types and check whether they
// are supported with the key system.
- if (!MediaDrmBridge::IsCryptoSchemeSupported(request.uuid, ""))
+ if (!MediaDrmBridge::IsKeySystemSupportedWithType(request.key_system, ""))
return;
DCHECK_EQ(request.codecs >> 3, 0) << "unrecognized codec";
- response->uuid = request.uuid;
+ response->key_system = request.key_system;
// TODO(qinmin): check composition is supported or not.
- response->compositing_codecs =
- GetSupportedCodecs(request.codecs, true);
- response->non_compositing_codecs =
- GetSupportedCodecs(request.codecs, false);
+ response->compositing_codecs = GetSupportedCodecs(request.codecs, true);
+ response->non_compositing_codecs = GetSupportedCodecs(request.codecs, false);
}
} // namespace chrome
« no previous file with comments | « android_webview/renderer/aw_key_systems.cc ('k') | chrome/common/encrypted_media_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698