Bug 258051

Summary: Stop autoreleasing WKWebView and WKContentView in WebKit::PageClientImplIOS
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebKit Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 257938    
Bug Blocks:    

Description David Kilzer (:ddkilzer) 2023-06-13 16:28:36 PDT
Stop autoreleasing WKWebView and WKContentView in WebKit::PageClientImplIOS.

Since both m_webView and m_contentView are WeakObjCPtr<> instance variables, calling methods like `[m_webView bar]` results in autoreleasing `m_webView` every time.

Fix this by using convenience methods that call WeakObjCPtr<>::get() and return a RetainPtr<> instead.
Comment 1 Radar WebKit Bug Importer 2023-06-13 16:29:00 PDT
<rdar://problem/110740310>
Comment 2 David Kilzer (:ddkilzer) 2023-06-13 16:35:39 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14938
Comment 3 EWS 2023-06-14 11:24:17 PDT
Committed 265157@main (3fe8f3b95be5): <https://commits.webkit.org/265157@main>

Reviewed commits have been landed. Closing PR #14938 and removing active labels.