Changeset 228257 in webkit


Ignore:
Timestamp:
Feb 7, 2018 7:30:34 PM (6 years ago)
Author:
commit-queue@webkit.org
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 <Antti Koivisto> and Youenn Fablet <youenn@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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228253 r228257  
     12018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>
     2
     3        REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
     4        https://bugs.webkit.org/show_bug.cgi?id=182532
     5        <rdar://problem/36414017>
     6
     7        Reviewed by Chris Dumez.
     8
     9        No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
     10        We were calling a function that was WTFMoved away just a few lines above.
     11
     12        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     13        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
     14
    1152018-02-07  Tim Horton  <timothy_horton@apple.com>
    216
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r227772 r228257  
    740740    bool canShowMIMEType = webPage->canShowMIMEType(response.mimeType());
    741741
     742    WebCore::Frame* coreFrame = m_frame->coreFrame();
     743    auto* policyDocumentLoader = coreFrame ? coreFrame->loader().provisionalDocumentLoader() : nullptr;
     744    if (!policyDocumentLoader) {
     745        function(PolicyAction::Ignore);
     746        return;
     747    }
     748
     749    Ref<WebFrame> protector(*m_frame);
    742750    uint64_t listenerID = m_frame->setUpPolicyListener(WTFMove(function), WebFrame::ForNavigationAction::No);
    743751    bool receivedPolicyAction;
     
    745753    DownloadID downloadID;
    746754
    747     Ref<WebFrame> protect(*m_frame);
    748     WebCore::Frame* coreFrame = m_frame->coreFrame();
    749     if (!coreFrame)
    750         return function(PolicyAction::Ignore);
    751     auto* policyDocumentLoader = coreFrame->loader().provisionalDocumentLoader();
    752     if (!policyDocumentLoader)
    753         return function(PolicyAction::Ignore);
    754755    auto navigationID = static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID();
    755756    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)) {
Note: See TracChangeset for help on using the changeset viewer.