Changeset 228355 in webkit


Ignore:
Timestamp:
Feb 9, 2018 9:43:38 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r228257. rdar://problem/37408882

Location:
branches/safari-605-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/Source/WebKit/ChangeLog

    r228354 r228355  
     12018-02-09  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228257. rdar://problem/37408882
     4
     5    2018-02-07  Antti Koivisto  <antti@apple.com> and Youenn Fablet  <youenn@apple.com>
     6
     7            REGRESSION(r227758): Webpage fails to load due to crash in com.apple.WebKit: WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse + 267
     8            https://bugs.webkit.org/show_bug.cgi?id=182532
     9            <rdar://problem/36414017>
     10
     11            Reviewed by Chris Dumez.
     12
     13            No test case, don't know how to make one. The repro involves multipart HTTP streaming and details are hazy.
     14            We were calling a function that was WTFMoved away just a few lines above.
     15
     16            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     17            (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
     18
    1192018-02-09  Jason Marcell  <jmarcell@apple.com>
    220
  • branches/safari-605-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r227836 r228355  
    747747    bool canShowMIMEType = webPage->canShowMIMEType(response.mimeType());
    748748
     749    WebCore::Frame* coreFrame = m_frame->coreFrame();
     750    auto* policyDocumentLoader = coreFrame ? coreFrame->loader().provisionalDocumentLoader() : nullptr;
     751    if (!policyDocumentLoader) {
     752        function(PolicyAction::Ignore);
     753        return;
     754    }
     755
     756    Ref<WebFrame> protector(*m_frame);
    749757    uint64_t listenerID = m_frame->setUpPolicyListener(WTFMove(function), WebFrame::ForNavigationAction::No);
    750758    bool receivedPolicyAction;
     
    752760    DownloadID downloadID;
    753761
    754     Ref<WebFrame> protect(*m_frame);
    755     WebCore::Frame* coreFrame = m_frame->coreFrame();
    756     if (!coreFrame)
    757         return function(PolicyAction::Ignore);
    758     auto* policyDocumentLoader = coreFrame->loader().provisionalDocumentLoader();
    759     if (!policyDocumentLoader)
    760         return function(PolicyAction::Ignore);
    761762    auto navigationID = static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID();
    762763    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.