Bug 279950
| Summary: | Have WebPageProxy::pageClient() return a pointer instead of a reference | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> |
| Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | kkinnunen, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Chris Dumez
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
Pull request: https://github.com/WebKit/WebKit/pull/33875
EWS
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
<rdar://problem/136305617>