Bug 208923

Summary: [EME] Issue an "encrypted" event when a new encrypted initialization segment is encountered
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, calvaris, cdumez, cmarcelo, commit-queue, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, kondapallykalyan, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

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.