[Bug 17750] Define the behavior MediaKeySession close() and clearing the keys attribute

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17750

David Dorwin <ddorwin@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #36 from David Dorwin <ddorwin@google.com> ---
I think most of the remaining questions have been resolved with the
implementation of promises (bug 25199).

(In reply to Adrian Bateman [MSFT] from comment #26)
> (In reply to David Dorwin from comment #25)
> > Do we need to explicitly handle release() being called in the CREATED state? 
> 
> The behaviour of release() is implementation specific. There is no
> requirement to do anything with release(). If the implementation does cause
> a close to occur, the spec already allows moving from CREATED to CLOSED at
> any point (either because of release() or because the CDM wants to close the
> session).

With promises implemented, a session is not returned until it has been
initialized, which means release() cannot be called until that point.

release() is also now entirely asynchronous except for the closed check, so
back-to-back calls cannot have different results.

> > createSession(), loadSession(), and release() all schedule tasks to do their
> > work. Are these tasks required to run serially? (If so, does the spec need
> > to be more explicit about this or is this implied by "schedule a task"?) If
> > not, the createSession() task may not complete before release() is called.
> 
> I think we need to change the createSession/loadSession task steps to say
> Spin the event loop until the MediaKeys constructor task is complete. The
> MediaKeys constructor task should say to spin the event loop until the CDM
> is loaded and initialized (step 2). Then we will need to handle release()
> being called before the session is completely created/loaded.

With promises implemented, the algorithms no longer schedule a task. As
mentioned above, no session object is returned until
createSession()/loadSession() complete, so release() cannot be called before
that.

> > It may actually be that we need to handle this in createSession() and
> > loadSession() by adding a condition to check for a release as the first
> > condition in the last substep of the "Schedule a task" step.
> 
> Perhaps all we need to do here is to make the first step of the release task
> spin the event loop until the MediaKeys constructor task is complete?


(In reply to David Dorwin from comment #28)
> Should release() cause all other tasks in the MediaKeySession() object to be
> aborted? For example, once release() is called, there is no need to continue
> generating a license request. On the other hand, an application might call
> update() to commit some data* then immediately call release().
> 
> * However, this use case doesn't make any sense since release() is supposed
> to cause the CDM to release/delete any resources associated with the session.

With promises implemented, the algorithms no longer have tasks - just
asynchronous steps - and license generation is performed before returning the
session object. There is still the possibility of "session.update();
session.release();", but I guess implementations will need to handle that in a
reasonable way.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 15 April 2014 21:04:21 UTC