New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check the correct network connection integrity policy after a navigation #9955
Check the correct network connection integrity policy after a navigation #9955
Conversation
EWS run on previous version of this PR (hash 4c3d11f) |
4c3d11f
to
de465ce
Compare
EWS run on previous version of this PR (hash de465ce) |
de465ce
to
8b642f8
Compare
EWS run on previous version of this PR (hash 8b642f8) |
8b642f8
to
9b96b9e
Compare
EWS run on previous version of this PR (hash 9b96b9e) |
9b96b9e
to
4511b19
Compare
EWS run on previous version of this PR (hash 4511b19) |
4511b19
to
5035c22
Compare
EWS run on previous version of this PR (hash 5035c22) |
5035c22
to
4a74de8
Compare
EWS run on previous version of this PR (hash 4a74de8) |
4a74de8
to
6bd5e9f
Compare
EWS run on previous version of this PR (hash 6bd5e9f) |
6bd5e9f
to
fddba55
Compare
EWS run on previous version of this PR (hash fddba55) |
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Outdated
Show resolved
Hide resolved
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Outdated
Show resolved
Hide resolved
fddba55
to
b402390
Compare
EWS run on previous version of this PR (hash b402390) |
@@ -1113,4 +1113,11 @@ uint64_t WebFrame::messageSenderDestinationID() const | |||
return m_frameID.object().toUInt64(); | |||
} | |||
|
|||
OptionSet<WebCore::NetworkConnectionIntegrity> WebFrame::networkConnectionIntegrityPolicy() const | |||
{ | |||
if (!coreFrame() || !coreFrame()->document() || !coreFrame()->document()->topDocument().loader()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto* coreFrame = this->coreFrame();
if (!coreFrame)
return { };
auto* document = coreFrame->document();
if (!document)
return { };
auto* topDocumentLoader = document->topDocument().loader();
if (!topDocumentLoader)
return { };
return topDocumentLoader->networkConnectionIntegrityPolicy();
That way, we don't have any duplicate function calls.
Also, I'm not sure how this interacts with #13108 where we're no longer always using the top document loader as the source. One of them needs to be updated, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this function will need to change. I'll land this patch first and change this function in the other patch to check the current frame's document loader whenever the main frame URL has a custom scheme.
b402390
to
15fd7ee
Compare
EWS run on current version of this PR (hash 15fd7ee) |
https://bugs.webkit.org/show_bug.cgi?id=252089 rdar://104452273 Reviewed by Alex Christensen. In some cases where we check the network connection integrity policy, we are checking the policy in the context of a navigation that may have occurred. This can cause issues when the network connection integrity policy was set, but changed during navigation. In this situation, the network connection integrity policy we are interested in checking is the one set on the page we navigated away from. To fix this, we preserve the policy set on the old document loader to the new one so we can check it on the destination site. * Source/WebCore/dom/Document.cpp: (WebCore::Document::urlForBindings const): (WebCore::Document::referrerForBindings): * Source/WebCore/loader/DocumentLoader.h: (WebCore::DocumentLoader::setOriginalNetworkConnectionIntegrityPolicy): (WebCore::DocumentLoader::originalNetworkConnectionIntegrityPolicy const): * Source/WebCore/loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setNetworkConnectionIntegrityPolicy): (WebCore::FrameLoadRequest::networkConnectionIntegrityPolicy const): * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::load): * Source/WebKit/Shared/LoadParameters.cpp: (WebKit::LoadParameters::encode const): (WebKit::LoadParameters::decode): * Source/WebKit/Shared/LoadParameters.h: * Source/WebKit/Shared/NavigationActionData.h: * Source/WebKit/Shared/NavigationActionData.serialization.in: * Source/WebKit/UIProcess/API/APINavigation.h: (API::Navigation::setOriginatorNetworkConnectionIntegrityPolicy): (API::Navigation::originatorNetworkConnectionIntegrityPolicy const): * Source/WebKit/Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::didSameDocumentNavigationForFrameViaJSHistoryAPI): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * Source/WebKit/WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::info const): (WebKit::WebFrame::networkConnectionIntegrityPolicy const): * Source/WebKit/WebProcess/WebPage/WebFrame.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): Canonical link: https://commits.webkit.org/263421@main
15fd7ee
to
801abd6
Compare
Committed 263421@main (801abd6): https://commits.webkit.org/263421@main Reviewed commits have been landed. Closing PR #9955 and removing active labels. |
801abd6
15fd7ee
π π§ͺ merge