Bug 119586 - [EME] Implement MediaKeys.isTypeSupported()
Summary: [EME] Implement MediaKeys.isTypeSupported()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-08 11:39 PDT by Jer Noble
Modified: 2013-12-30 23:16 PST (History)
7 users (show)

See Also:


Attachments
Patch (17.77 KB, patch)
2013-08-08 11:48 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2013-08-08 11:39:15 PDT
[EME] Implement MediaKeys.isTypeSupported()
Comment 1 Jer Noble 2013-08-08 11:48:53 PDT
Created attachment 208357 [details]
Patch
Comment 2 Eric Carlson 2013-08-08 12:02:18 PDT
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.
Comment 3 Jer Noble 2013-08-08 12:16:53 PDT
Committed r153838: <http://trac.webkit.org/changeset/153838>
Comment 4 Jer Noble 2013-08-08 12:17:17 PDT
<rdar://problem/14688350>
Comment 5 Chris Dumez 2013-08-08 12:22:32 PDT
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