WebKit Bugzilla
Attachment 369151 Details for
Bug 197618
: Null check m_mainFrame in WebPageProxy.cpp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197618-20190506114301.patch (text/plain), 3.80 KB, created by
Alex Christensen
on 2019-05-06 11:43:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-05-06 11:43:01 PDT
Size:
3.80 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 244968) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-05-06 Alex Christensen <achristensen@webkit.org> >+ >+ Null check m_mainFrame in WebPageProxy.cpp >+ https://bugs.webkit.org/show_bug.cgi?id=197618 >+ <rdar://problem/47463054> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-05-06 Wenson Hsieh <wenson_hsieh@apple.com> > > Introduce SPI to request modern compatibility mode but defer to site-specific quirks >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 244954) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -4677,7 +4677,10 @@ void WebPageProxy::decidePolicyForNaviga > sourceFrameInfo = API::FrameInfo::create(originatingFrameInfoData, originatingPageID ? process->webPage(originatingPageID) : nullptr); > > auto userInitiatedActivity = process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); >- bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision && destinationFrameInfo->isMainFrame() && !hostsAreEqual(URL({ }, m_mainFrame->url()), request.url()) && navigationActionData.navigationType != WebCore::NavigationType::BackForward; >+ bool shouldOpenAppLinks = !m_shouldSuppressAppLinksInNextNavigationPolicyDecision >+ && destinationFrameInfo->isMainFrame() >+ && (m_mainFrame ? !hostsAreEqual(m_mainFrame->url(), request.url()) : false) >+ && navigationActionData.navigationType != WebCore::NavigationType::BackForward; > > auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTF::nullopt, WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity), mainFrameNavigation); > >@@ -4807,7 +4810,7 @@ void WebPageProxy::decidePolicyForNewWin > sourceFrameInfo = API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin()); > > auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier); >- bool shouldOpenAppLinks = !hostsAreEqual(URL({ }, m_mainFrame->url()), request.url()); >+ bool shouldOpenAppLinks = m_mainFrame ? !hostsAreEqual(m_mainFrame->url(), request.url()) : false; > auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), nullptr, frameName, WTFMove(request), URL { }, shouldOpenAppLinks, WTFMove(userInitiatedActivity)); > > m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get()); >@@ -4994,7 +4997,7 @@ void WebPageProxy::createNewPage(const F > { > MESSAGE_CHECK(m_process, m_process->webFrame(originatingFrameInfoData.frameID)); > auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID)); >- auto mainFrameURL = m_mainFrame->url(); >+ auto mainFrameURL = m_mainFrame ? m_mainFrame->url() : URL(); > auto completionHandler = [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)] (RefPtr<WebPageProxy> newPage) mutable { > if (!newPage) { > reply(0, WTF::nullopt);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197618
: 369151