Closed Bug 1057171 Opened 6 years ago Closed 6 years ago

[EME] Implement MediaKeySession.getUsableKeyIds

Categories

(Core :: Audio/Video, defect)

29 Branch
x86_64
All
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla34
Tracking Status
firefox37 --- fixed
firefox38 --- fixed
firefox39 --- fixed

People

(Reporter: cpearce, Assigned: cpearce)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed)

Attachments

(1 file, 1 obsolete file)

Assignee: nobody → cpearce
Attached patch Patch (obsolete) — Splinter Review
Implement MediaKeySession.getUsableKeyIds().
Attachment #8478083 - Flags: review?(bzbarsky)
Comment on attachment 8478083 [details] [diff] [review]
Patch

>+  if (!ToJSValue(cx, keyIds, &array)) {

You shouldn't need this.  This should work fine for the behavior your code has right now:

  promise->MaybeResolve(keyIds);

(which will under the hood do the ToJSValue, reject if that fails, etc).  Note that you also won't need cx in that case.

>+  Promise<sequence<ArrayBuffer>> getUsableKeyIds();

That said, if you want the behavior this IDL describes, you need something different.  keyIds is an nsTArray<nsTArray<uint8_t>>.  Calling ToJSValue on it will produce an array of arrays of numbers, not an array of arraybuffers.  So if you want the latter you need to do the conversion more carefully: first construct an nsTArray<TypedArrayCreator<ArrayBuffer>> whose elements are pointing to the elements of keyIds, then resolve the promise with _that_.

And clearly this needs a test to make sure the right sort of thing is returned.
Attachment #8478083 - Flags: review?(bzbarsky) → review-
Attached patch Patch v2Splinter Review
I updated the patch to use nsTArray<TypedArrayCreator<ArrayBuffer>>.

I have tested this with my example EME GMP, so I know this is working.

But yes, we absolutely do need an automated test here. Edwin is working on our ClearKey CDM implementation which we will use for most EME testing in bug 1044742. ClearKey is specified to support this API, so we'll be testing it with that GMP.
Attachment #8478083 - Attachment is obsolete: true
Attachment #8479454 - Flags: review?(bzbarsky)
Comment on attachment 8479454 [details] [diff] [review]
Patch v2

r=me.  Looks great!
Attachment #8479454 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/f73be78d1cca
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Mass update firefox-status to track EME uplift.
You need to log in before you can comment on or make changes to this bug.