[EME] Implement MediaKeys.isTypeSupported()
Created attachment 208357 [details] Patch
Comment on attachment 208357 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=208357&action=review > Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp:135 > + // 1. If keySystem contains an unrecognized or unsupported Key System, return false and abort these steps. > + // Key system string comparison is case-sensitive. > + if (keySystem.isNull() || keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem)) > + return false; > + > + // 2. If type is null or an empty string, return true and abort these steps. > + if (mimeType.isNull() || mimeType.isEmpty()) > + return true; > + > + // 3. If the Key System specified by keySystem does not support decrypting the container and/or codec > + // specified by type, return false and abort these steps. > + if (!CDM::supportsKeySystemAndMimeType(keySystem, mimeType)) > + return false; Nit: it would be nice if this didn't have to ask the CDM if it supports the key system twice.
Committed r153838: <http://trac.webkit.org/changeset/153838>
<rdar://problem/14688350>
Comment on attachment 208357 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=208357&action=review > Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp:125 > + if (keySystem.isNull() || keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem)) nit: The call to isNull() is redundant because it is already included in isEmpty(). > Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp:129 > + if (mimeType.isNull() || mimeType.isEmpty()) Ditto