Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix performance regression after 271209@main
https://bugs.webkit.org/show_bug.cgi?id=265826 rdar://118948980 Reviewed by Per Arne Vollan. 271209@main introduced a CompletionHandler to SpeculativeLoad::willSendRedirectedRequest. Before that change, we would just destroy the NetworkLoad and be done. After that change, we call the redirect completion handler with an empty ResourceRequest before destroying the NetworkLoad, which calls updateRequest and didCompleteWithError. This PR changes calling the completion handler to after the call to SpeculativeLoad::didComplete which destroys the NetworkLoad. That way, the lambda at the end of the function NetworkLoad::willPerformHTTPRedirection just finds a null weakThis and does none of this unnecessary work. I verified that this is what is going on on the sites in the radar that showed a performance regression, and I verified that this change removes that unnecessary work when not following redirects. * Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest): Canonical link: https://commits.webkit.org/271526@main
- Loading branch information