Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2018 04:36:34 +0000 (04:36 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Aug 2018 04:36:34 +0000 (04:36 +0000)
commitf2ce4e954d5e950c7637665a7f67350bc9b618f5
tree5bc4b0b60b63460a5160067a0abc12bb6c39b9df
parentd1f746333ccae83833f1c97f798a98bbce89d97c
Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
https://bugs.webkit.org/show_bug.cgi?id=188427
<rdar://problem/43064672>

Reviewed by Wenson Hsieh.

Speculatively fix more crashes seen under setSuggestions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession isValid]):
(-[WKFormInputSession setSuggestions:]):
(-[WKFormInputSession invalidate]):
Belt-and-suspenders fix: use WeakObjCPtr for WKFormInputSession's WKContentView reference.

(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
Invalidate the WKFormInputSession before replacing it; we theorize that
there is a path in which we get here without having previously called stopAssistingNode.
Most of the code is OK with this, but this leaves WKFormInputSession
with a raw reference to WKContentView which can later become stale.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm