Changeset 244970 in webkit


Ignore:
Timestamp:
May 6, 2019 1:24:29 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Null check m_mainFrame in WebPageProxy.cpp
https://bugs.webkit.org/show_bug.cgi?id=197618
<rdar://problem/47463054>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-06
Reviewed by Geoffrey Garen.

It's already null checked in some places, and the places where it isn't are causing crashes.
Let's fix all of them.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::createNewPage):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244969 r244970  
     12019-05-06  Alex Christensen  <achristensen@webkit.org>
     2
     3        Null check m_mainFrame in WebPageProxy.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=197618
     5        <rdar://problem/47463054>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        It's already null checked in some places, and the places where it isn't are causing crashes.
     10        Let's fix all of them.
     11
     12        * UIProcess/WebPageProxy.cpp:
     13        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     14        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
     15        (WebKit::WebPageProxy::createNewPage):
     16
    1172019-05-06  Brent Fulgham  <bfulgham@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r244966 r244970  
    46784678
    46794679        auto userInitiatedActivity = process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
    4680         bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision && destinationFrameInfo->isMainFrame() && !hostsAreEqual(URL({ }, m_mainFrame->url()), request.url()) && navigationActionData.navigationType != WebCore::NavigationType::BackForward;
     4680        bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision
     4681            && destinationFrameInfo->isMainFrame()
     4682            && (m_mainFrame ? !hostsAreEqual(m_mainFrame->url(), request.url()) : false)
     4683            && navigationActionData.navigationType != WebCore::NavigationType::BackForward;
    46814684
    46824685        auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTF::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation);
     
    48084811
    48094812        auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
    4810         bool shouldOpenAppLinks = !hostsAreEqual(URL({ }, m_mainFrame->url()), request.url());
     4813        bool shouldOpenAppLinks = m_mainFrame ? !hostsAreEqual(m_mainFrame->url(), request.url()) : false;
    48114814        auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), nullptr, frameName, WTFMove(request), URL { }, shouldOpenAppLinks, WTFMove(userInitiatedActivity));
    48124815
     
    49954998    MESSAGE_CHECK(m_process, m_process->webFrame(originatingFrameInfoData.frameID));
    49964999    auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID));
    4997     auto mainFrameURL = m_mainFrame->url();
     5000    auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL();
    49985001    auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)] (RefPtr<WebPageProxy> newPage) mutable {
    49995002        if (!newPage) {
Note: See TracChangeset for help on using the changeset viewer.