Title: [228658] releases/WebKitGTK/webkit-2.20/Source/WebKit
Revision
228658
Author
carlo...@webkit.org
Date
2018-02-19 04:08:34 -0800 (Mon, 19 Feb 2018)

Log Message

Merge r228257 - REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
https://bugs.webkit.org/show_bug.cgi?id=182532
<rdar://problem/36414017>

Patch by Antti Koivisto  <an...@apple.com> and Youenn Fablet <you...@apple.com> on 2018-02-07
Reviewed by Chris Dumez.

No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
We were calling a function that was WTFMoved away just a few lines above.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (228657 => 228658)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 12:08:31 UTC (rev 228657)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 12:08:34 UTC (rev 228658)
@@ -1,3 +1,17 @@
+2018-02-07  Antti Koivisto  <an...@apple.com> and Youenn Fablet  <you...@apple.com>
+
+        REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
+        https://bugs.webkit.org/show_bug.cgi?id=182532
+        <rdar://problem/36414017>
+
+        Reviewed by Chris Dumez.
+
+        No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
+        We were calling a function that was WTFMoved away just a few lines above.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+
 2018-02-07  Chris Dumez  <cdu...@apple.com>
 
         IndexedDB in service workers is using a memory backed store

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (228657 => 228658)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-02-19 12:08:31 UTC (rev 228657)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-02-19 12:08:34 UTC (rev 228658)
@@ -739,18 +739,19 @@
 
     bool canShowMIMEType = webPage->canShowMIMEType(response.mimeType());
 
+    WebCore::Frame* coreFrame = m_frame->coreFrame();
+    auto* policyDocumentLoader = coreFrame ? coreFrame->loader().provisionalDocumentLoader() : nullptr;
+    if (!policyDocumentLoader) {
+        function(PolicyAction::Ignore);
+        return;
+    }
+
+    Ref<WebFrame> protector(*m_frame);
     uint64_t listenerID = m_frame->setUpPolicyListener(WTFMove(function), WebFrame::ForNavigationAction::No);
     bool receivedPolicyAction;
     PolicyAction policyAction;
     DownloadID downloadID;
 
-    Ref<WebFrame> protect(*m_frame);
-    WebCore::Frame* coreFrame = m_frame->coreFrame();
-    if (!coreFrame)
-        return function(PolicyAction::Ignore);
-    auto* policyDocumentLoader = coreFrame->loader().provisionalDocumentLoader();
-    if (!policyDocumentLoader)
-        return function(PolicyAction::Ignore);
     auto navigationID = static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID();
     if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), navigationID, response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend)) {
         m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to