Bug 168039 - [EME] Implement MediaKeySession::sessionClosed()
Summary: [EME] Implement MediaKeySession::sessionClosed()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks: 158841
  Show dependency treegraph
 
Reported: 2017-02-09 00:07 PST by Zan Dobersek
Modified: 2017-02-10 02:33 PST (History)
2 users (show)

See Also:


Attachments
Patch (13.80 KB, patch)
2017-02-09 00:27 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (15.17 KB, patch)
2017-02-09 07:04 PST, Zan Dobersek
calvaris: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2017-02-09 00:07:42 PST
SSIA.
Comment 1 Zan Dobersek 2017-02-09 00:27:00 PST
Created attachment 301021 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2017-02-09 05:20:58 PST
Comment on attachment 301021 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301021&action=review

> Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp:525
> +    // 5. Let promise be the closed attribute of the session.
> +    // 6. Resolve promise.
> +    if (m_closedPromise)
> +        m_closedPromise->resolve();

These lines make me think a lot given that m_closedPromise is created when the JS closed attribute is accessed. So for this to work we would have to access closed so that the promise can be ever resolved. If the run this algorithm before accessing closed from JS we will be returning an unresolved promise that should be resolved already. I think we need to change the strategy. We need to have the promise created in advance and get it from the JS getter.

Actually, please update the tests to test this situation this too.
Comment 3 Zan Dobersek 2017-02-09 07:04:02 PST
Created attachment 301034 [details]
Patch
Comment 4 Zan Dobersek 2017-02-10 02:33:33 PST
Committed r212109: <http://trac.webkit.org/changeset/212109>