Title: [231128] trunk/Source/WebCore
Revision
231128
Author
[email protected]
Date
2018-04-27 18:09:11 -0700 (Fri, 27 Apr 2018)

Log Message

Fix crash in DocumentLoader::startLoadingMainResource
https://bugs.webkit.org/show_bug.cgi?id=185088
rdar://problem/39689263

Reviewed by Chris Dumez.

Add a "protectedThis" to address a case where a deleted "this" was
accessed in a RELEASE_LOG statement.

No new tests -- covered by existing tests, which now pass.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (231127 => 231128)


--- trunk/Source/WebCore/ChangeLog	2018-04-28 00:53:41 UTC (rev 231127)
+++ trunk/Source/WebCore/ChangeLog	2018-04-28 01:09:11 UTC (rev 231128)
@@ -1,3 +1,19 @@
+2018-04-27  Keith Rollin  <[email protected]>
+
+        Fix crash in DocumentLoader::startLoadingMainResource
+        https://bugs.webkit.org/show_bug.cgi?id=185088
+        rdar://problem/39689263
+
+        Reviewed by Chris Dumez.
+
+        Add a "protectedThis" to address a case where a deleted "this" was
+        accessed in a RELEASE_LOG statement.
+
+        No new tests -- covered by existing tests, which now pass.
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::startLoadingMainResource):
+
 2018-04-27  Simon Fraser  <[email protected]>
 
         Implement color-filter for text stroke

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (231127 => 231128)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-04-28 00:53:41 UTC (rev 231127)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-04-28 01:09:11 UTC (rev 231128)
@@ -1674,6 +1674,8 @@
     ASSERT(!m_loadingMainResource);
     m_loadingMainResource = true;
 
+    Ref<DocumentLoader> protectedThis(*this);
+
     if (maybeLoadEmpty()) {
         RELEASE_LOG_IF_ALLOWED("startLoadingMainResource: Returning empty document (frame = %p, main = %d)", m_frame, m_frame ? m_frame->isMainFrame() : false);
         return;
@@ -1694,7 +1696,7 @@
     ASSERT(timing().startTime());
     ASSERT(timing().fetchStart());
 
-    willSendRequest(ResourceRequest(m_request), ResourceResponse(), shouldContinue, [this, protectedThis = makeRef(*this)] (ResourceRequest&& request) mutable {
+    willSendRequest(ResourceRequest(m_request), ResourceResponse(), shouldContinue, [this, protectedThis = WTFMove(protectedThis)] (ResourceRequest&& request) mutable {
         m_request = request;
 
         // willSendRequest() may lead to our Frame being detached or cancelling the load via nulling the ResourceRequest.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to