Bug 208923 - [EME] Issue an "encrypted" event when a new encrypted initialization segment is encountered
Summary: [EME] Issue an "encrypted" event when a new encrypted initialization segment ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-11 09:47 PDT by Jer Noble
Modified: 2020-03-11 16:50 PDT (History)
15 users (show)

See Also:


Attachments
Patch (67.87 KB, patch)
2020-03-11 11:02 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (68.91 KB, patch)
2020-03-11 12:26 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2020-03-11 09:47:39 PDT
[EME] Issue an "encrypted" event when a new encrypted initialization segment is encountered
Comment 1 Jer Noble 2020-03-11 11:02:50 PDT
<rdar://problem/59603354>
Comment 2 Jer Noble 2020-03-11 11:02:53 PDT
Created attachment 393266 [details]
Patch
Comment 3 Eric Carlson 2020-03-11 11:24:26 PDT
Comment on attachment 393266 [details]
Patch

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

r=me once the bots are happy

> Source/WTF/wtf/LoggerHelper.h:64
> +#define ALWAYS_LOG_IF_POSSIBLE(...)     if (logger()) logger()->logAlways(logChannel(), __VA_ARGS__)
> +#define ERROR_LOG_IF_POSSIBLE(...)      if (logger()) logger()->error(logChannel(), __VA_ARGS__)
> +#define WARNING_LOG_IF_POSSIBLE(...)    if (logger()) logger()->warning(logChannel(), __VA_ARGS__)
> +#define INFO_LOG_IF_POSSIBLE(...)       if (logger()) logger()->info(logChannel(), __VA_ARGS__)
> +#define DEBUG_LOG_IF_POSSIBLE(...)      if (logger()) logger()->debug(logChannel(), __VA_ARGS__)
> +#define WILL_LOG_IF_POSSIBLE(_level_)   if (logger()) logger()->willLog(logChannel(), _level_)

It might be a good idea to use a method with a different name, since currently 'logger()' always return a ref. Maybe loggerPtr()?

    if (loggerPtr()) loggerPtr()->log...

> Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp:66
> +    m_taskQueue.enqueueTask([this, document = makeRef(document), promise = WTFMove(promise)] () mutable {

Do you need to keep the document alive, can't you use makeWeakPtr()?
Comment 4 Jer Noble 2020-03-11 12:26:26 PDT
Created attachment 393273 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2020-03-11 16:50:04 PDT
Comment on attachment 393273 [details]
Patch for landing

Clearing flags on attachment: 393273

Committed r258295: <https://trac.webkit.org/changeset/258295>
Comment 6 WebKit Commit Bot 2020-03-11 16:50:06 PDT
All reviewed patches have been landed.  Closing bug.