RESOLVED FIXED 279950
Have WebPageProxy::pageClient() return a pointer instead of a reference
https://bugs.webkit.org/show_bug.cgi?id=279950
Summary Have WebPageProxy::pageClient() return a pointer instead of a reference
Chris Dumez
Reported 2024-09-18 19:29:41 PDT
Have WebPageProxy::pageClient() return a pointer instead of a reference. WebPageProxy::m_pageClient is a WeakPtr and the pointer can get nulled out if the WKWebView gets deallocated. However, `pageClient()` was asserting that m_pageClient is non-null and would return a C++ reference. This keeps leading to crashes such as the one fixed in 283815@main since it is easy for the WebPageProxy to outlive the WKWebView. To make this less error prone, I'm updating pageClient() to return a pointer instead of a reference and updating call sites to null check it.
Attachments
Chris Dumez
Comment 1 2024-09-18 19:34:47 PDT
EWS
Comment 2 2024-09-19 11:22:37 PDT
Committed 283935@main (a3151425d94b): <https://commits.webkit.org/283935@main> Reviewed commits have been landed. Closing PR #33875 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2024-09-19 11:23:19 PDT
Note You need to log in before you can comment on or make changes to this bug.