Title: [228257] trunk/Source/WebKit
Revision
228257
Author
[email protected]
Date
2018-02-07 19:30:34 -0800 (Wed, 07 Feb 2018)

Log Message

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  <[email protected]> and Youenn Fablet <[email protected]> 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: trunk/Source/WebKit/ChangeLog (228256 => 228257)


--- trunk/Source/WebKit/ChangeLog	2018-02-08 02:32:38 UTC (rev 228256)
+++ trunk/Source/WebKit/ChangeLog	2018-02-08 03:30:34 UTC (rev 228257)
@@ -1,3 +1,17 @@
+2018-02-07  Antti Koivisto  <[email protected]> and Youenn Fablet  <[email protected]>
+
+        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  Tim Horton  <[email protected]>
 
         Evernote device management web view sometimes displays at the wrong scale

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (228256 => 228257)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-02-08 02:32:38 UTC (rev 228256)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-02-08 03:30:34 UTC (rev 228257)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to