[encrypted-media] Access of session's "record of key usage" in the MediaKeySession Destroyed and Session Closed algorithms is inconsistent

ddorwin has just created a new issue for 
https://github.com/w3c/encrypted-media:

== Access of session's "record of key usage" in the MediaKeySession 
Destroyed and Session Closed algorithms is inconsistent ==
The current access of a session's _record of key usage_ are:

1. `generateRequest()`, `remove()`, and `update()` algorithms: By the 
CDM and in parallel to the main event loop
1. Attempt to Decrypt algorithm: By the CDM within the playback 
algorithms, which must run in parallel to the main event loop
1. Session Closed algorithm: By the **user agent** in a task, which 
runs **on the main event loop**
1. MediaKeySession Destroyed algorithm: By the **user agent** in 
parallel to the main event loop

This session state is managed by the CDM, which always operates in 
parallel to the main event loop. Thus, it should either be explicitly 
provided to the user agent algorithm by the CDM (i.e. "Run the Foo Bar
 algorithm, passing _record of key usage_.") or accessed by the the 
CDM in parallel. In the latter case, the CDM could perform the 
operation or be used to obtain the value.

The fix for (4) could be as simple as moving the last two steps under 
a "Use the _cdm_ to execute the following steps:" step. (3) is more 
complex because the algorithm is running in a task on the main event 
loop. If ordering with the other events and the promise in that method
 are important, just running the step in parallel could be 
problematic.

Please view or discuss this issue at 
https://github.com/w3c/encrypted-media/issues/225 using your GitHub 
account

Received on Monday, 6 June 2016 22:46:44 UTC