Title: [283330] branches/safari-612.2.9.2-branch/Source/WebKit
- Revision
- 283330
- Author
- alanc...@apple.com
- Date
- 2021-09-30 13:17:03 -0700 (Thu, 30 Sep 2021)
Log Message
Cherry-pick r283294. rdar://problem/83733551
Add weakThis check in addition to null check added in r282881
https://bugs.webkit.org/show_bug.cgi?id=231000
<rdar://83605614>
Patch by Alex Christensen <achristen...@webkit.org> on 2021-09-29
Reviewed by Brady Eidson.
r282881 made NetworkLoad::start call didCompleteWithError, which can cause the
NetworkResourceLoader to be deleted. It added a null check on m_networkLoad which
sometimes reads freed memory. This certainly isn't great, but luckily we have a way
to check if this object has been deleted. Let's do that.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-612.2.9.2-branch/Source/WebKit/ChangeLog (283329 => 283330)
--- branches/safari-612.2.9.2-branch/Source/WebKit/ChangeLog 2021-09-30 20:13:18 UTC (rev 283329)
+++ branches/safari-612.2.9.2-branch/Source/WebKit/ChangeLog 2021-09-30 20:17:03 UTC (rev 283330)
@@ -1,3 +1,40 @@
+2021-09-30 Alan Coon <alanc...@apple.com>
+
+ Cherry-pick r283294. rdar://problem/83733551
+
+ Add weakThis check in addition to null check added in r282881
+ https://bugs.webkit.org/show_bug.cgi?id=231000
+ <rdar://83605614>
+
+ Patch by Alex Christensen <achristen...@webkit.org> on 2021-09-29
+ Reviewed by Brady Eidson.
+
+ r282881 made NetworkLoad::start call didCompleteWithError, which can cause the
+ NetworkResourceLoader to be deleted. It added a null check on m_networkLoad which
+ sometimes reads freed memory. This certainly isn't great, but luckily we have a way
+ to check if this object has been deleted. Let's do that.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::startNetworkLoad):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-09-29 Alex Christensen <achristen...@webkit.org>
+
+ Add weakThis check in addition to null check added in r282881
+ https://bugs.webkit.org/show_bug.cgi?id=231000
+ <rdar://83605614>
+
+ Reviewed by Brady Eidson.
+
+ r282881 made NetworkLoad::start call didCompleteWithError, which can cause the
+ NetworkResourceLoader to be deleted. It added a null check on m_networkLoad which
+ sometimes reads freed memory. This certainly isn't great, but luckily we have a way
+ to check if this object has been deleted. Let's do that.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::startNetworkLoad):
+
2021-09-27 Alan Coon <alanc...@apple.com>
Cherry-pick r283081. rdar://problem/83584464
Modified: branches/safari-612.2.9.2-branch/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (283329 => 283330)
--- branches/safari-612.2.9.2-branch/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp 2021-09-30 20:13:18 UTC (rev 283329)
+++ branches/safari-612.2.9.2-branch/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp 2021-09-30 20:17:03 UTC (rev 283330)
@@ -342,12 +342,13 @@
parameters.isNavigatingToAppBoundDomain = m_parameters.isNavigatingToAppBoundDomain;
m_networkLoad = makeUnique<NetworkLoad>(*this, &networkSession->blobRegistry(), WTFMove(parameters), *networkSession);
+ auto weakThis = makeWeakPtr(*this);
if (isSynchronous())
- m_networkLoad->start();
+ m_networkLoad->start(); // May delete this object
else
m_networkLoad->startWithScheduling();
- if (m_networkLoad)
+ if (weakThis && m_networkLoad)
LOADER_RELEASE_LOG("startNetworkLoad: Going to the network (description=%" PUBLIC_LOG_STRING ")", m_networkLoad->description().utf8().data());
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes