Bug 212050

Summary: Rare crash under -[WKContentView resignFirstResponderForWebView]
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: megan_gardner, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 213666    
Attachments:
Description Flags
Patch none

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].