Bug 212050 - Rare crash under -[WKContentView resignFirstResponderForWebView]
Summary: Rare crash under -[WKContentView resignFirstResponderForWebView]
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: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks: 213666
  Show dependency treegraph
 
Reported: 2020-05-18 15:29 PDT by Tim Horton
Modified: 2020-06-26 15:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.92 KB, patch)
2020-05-18 15:30 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2020-05-18 15:29:45 PDT
Rare crash under -[WKContentView resignFirstResponderForWebView]
Comment 1 Tim Horton 2020-05-18 15:30:19 PDT
Created attachment 399677 [details]
Patch
Comment 2 Tim Horton 2020-05-18 15:30:21 PDT
<rdar://problem/60187111>
Comment 3 Wenson Hsieh 2020-05-18 15:32:54 PDT
Comment on attachment 399677 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:1412
> +                if (strongSelf->_keyWebEventHandler.get() != strongHandler.get())

Nit - are both of these .get() needed?
Comment 4 Megan Gardner 2020-05-18 15:34:53 PDT
Comment on attachment 399677 [details]
Patch

r=me as well
Comment 5 Tim Horton 2020-05-18 16:02:33 PDT
Comment on attachment 399677 [details]
Patch

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

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:1412
>> +                if (strongSelf->_keyWebEventHandler.get() != strongHandler.get())
> 
> Nit - are both of these .get() needed?

As we learned extensively on Slack, yes, because this code is being pretty dirty and WeakObjCPtr<id>-ing the block, and no combination of BlockPtr/WeakObjCPtr on either side make enough implicit conversions that you can drop either get (nor both).
Comment 6 EWS 2020-05-18 16:31:47 PDT
Committed r261838: <https://trac.webkit.org/changeset/261838>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399677 [details].