Bug 16614 - There is no way to correlate multiple generateKeyRequest calls with their responses
Summary: There is no way to correlate multiple generateKeyRequest calls with their res...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: David Dorwin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on: 16613
Blocks: 16549
  Show dependency treegraph
 
Reported: 2012-04-03 16:18 UTC by Mark Watson
Modified: 2012-08-17 06:14 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Watson 2012-04-03 16:18:22 UTC
The current API design allows for multiple parallel key requests to be in flight. Each call to generateKeyRequest() begins a message exchange resulting ultimately in a keyadded or keyerror event. The first keymessage event may contain a Session ID identifying the session. This session ID is later used to enable correlation between messages conveyed in keymessage and responses added in addKey.

However, the current design does not support correlation between specific generateKeyRequest() calls (and the needkey event that might have triggered it) and subsequent sessions. If a page knows it needs two keys, it can call generateKeyRequest() twice but there is no way to know which keymessage or keyerror results from each call. This might be particularly important for the error case. Modifications to the API such as those described in Object-Oriented API Design (https://www.w3.org/Bugs/Public/show_bug.cgi?id=16613) could address this issue.
Comment 1 David Dorwin 2012-08-17 06:14:14 UTC
Addressed by the object-oriented API (bug 16613). createSession(), which replaces generateKeyRequest(), returns a MediaKeySession object on which all events are fired.