[webkit-reviews] review granted: [Bug 216974] Make sure our calls to AVCaptureDevice requestAccessForMediaType do processing on the main thread : [Attachment 409694] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Sep 26 16:07:27 PDT 2020


Darin Adler <darin at apple.com> has granted youenn fablet <youennf at gmail.com>'s
request for review:
Bug 216974: Make sure our calls to AVCaptureDevice requestAccessForMediaType do
processing on the main thread
https://bugs.webkit.org/show_bug.cgi?id=216974

Attachment 409694: Patch

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




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

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

> Source/WebKit/ChangeLog:8
> +	   The completion handler to [AVCaptureDeviceClass
requestAccessForMediaType:] may sometimes be called in a background thread on
iOS.

Can we make a test for this that will fail on iOS?

> Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:995
> +	       auto completionHandler = [this, weakThis = WTFMove(weakThis),
frame = WTFMove(frame), protectedRequest = WTFMove(protectedRequest), webView =
WTFMove(webView), topLevelOrigin = WTFMove(topLevelOrigin)](BOOL authorized) {

I think it’s a bad pattern when we pass a pointer twice, once that we use and
other for lifetime checking. In case like this, can we *not* capture this,
please? Minimizes the chance we use it wrong. I feel the same way about
capturing both "this" and "protectedThis".


More information about the webkit-reviews mailing list