We need ResourceHandleCFURLConnectionDelegate to remain alive for as long as CFURLConnection is making delegate calls. The only way to guarantee this is to have CFURLConnection retain the delegate, which it does - but we don't implement retain/release client callbacks! This causes crashes in Networking process.
*** Bug 135027 has been marked as a duplicate of this bug. ***
rdar://problem/18679320
Created attachment 239950 [details] proposed fix
Created attachment 239957 [details] with a build fix
Committed <https://trac.webkit.org/r174787>.
Comment on attachment 239957 [details] with a build fix View in context: https://bugs.webkit.org/attachment.cgi?id=239957&action=review > Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:61 > + static_cast<ResourceHandleCFURLConnectionDelegate*>(const_cast<void*>(clientInfo))->ref(); Is this thread-safe?
Yes, ResourceHandleCFURLConnectionDelegate is a ThreadSafeRefCounted object, and it doesn't have any data members that are unsafe to destruct on any thread.