[webkit-reviews] review granted: [Bug 216894] Use less explicit ref() / deref() calls in WebAudio code : [Attachment 409498] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 23 15:55:15 PDT 2020


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 216894: Use less explicit ref() / deref() calls in WebAudio code
https://bugs.webkit.org/show_bug.cgi?id=216894

Attachment 409498: Patch

https://bugs.webkit.org/attachment.cgi?id=409498&action=review




--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 409498
  --> https://bugs.webkit.org/attachment.cgi?id=409498
Patch

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

> Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.cpp:88
> +    auto protectedThis = makeRef(*this);

Not sure I understand where the need for this comes from exactly. Not that I am
arguing to not do it, just that I was wondering how I would have known it’s
needed.

> Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp:102
> +    m_renderThread = Thread::create("offline renderer", [this, protectedThis
= WTFMove(protectedThis)]() mutable {

Not sure anyone else agrees, but I’ve always been a fan of *not* capturing this
in cases like this. I know it makes the code less elegant.


More information about the webkit-reviews mailing list