Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a mechanism to remember the last IP address of the response for t…
…he main resource request https://bugs.webkit.org/show_bug.cgi?id=246128 rdar://100831206 Reviewed by John Wilander. Add a mechanism to keep track of the last IP address, corresponding to the main resource request's response; this information is stashed in a side table on the network session, alongside the existing map of first party host to CNAME. * Source/WTF/wtf/PlatformHave.h: Remove this feature flag, since the oldest macOS version we currently support (Big Sur) contains this SPI. * Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h: * Source/WebCore/platform/network/DNS.cpp: (WebCore::IPAddress::fromString): Add a helper method to create an `IPAddress` from an IP address string (IPv4 or IPv6). * Source/WebCore/platform/network/DNS.h: (WebCore::IPAddress::IPAddress): Add another explicit constructor that takes `WTF::HashTableEmptyValueType`, so that we can store `IPAddress` as a value in a `HashMap`; see below. (WTF::HashTraits<WebCore::IPAddress>::emptyValue): Additionally add a `HashTraits` template class for `IPAddress`, which allows us to store `WebCore::IPAddress` as a hash table value by implementing `emptyValue()`. * Source/WebKit/NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::networkSession const): * Source/WebKit/NetworkProcess/NetworkDataTask.h: * Source/WebKit/NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resetParametersToDefaultValues): * Source/WebKit/NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setFirstPartyHostCNAMEDomain): (WebKit::NetworkSession::firstPartyHostCNAMEDomain): (WebKit::NetworkSession::resetFirstPartyDNSData): (WebKit::NetworkSession::setFirstPartyHostIPAddress): (WebKit::NetworkSession::firstPartyHostIPAddress): (WebKit::NetworkSession::resetCNAMEDomainData): Deleted. Rename `resetCNAMEDomainData` to `resetFirstPartyDNSData`, since we now use it to clear both first party CNAME information as well as first party IP address information. * Source/WebKit/NetworkProcess/NetworkSession.h: * Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::lastRemoteIPAddress): Add a helper function to grab the last resolved IP address of the network data task; this is intended to be used after we get a response. (WebKit::NetworkDataTaskCocoa::shouldApplyCookiePolicyForThirdPartyCNAMECloaking const): (WebKit::NetworkDataTaskCocoa::updateFirstPartyInfoForSession): Update the first party IP address, alongside the first party CNAME for the main resource. (WebKit::NetworkDataTaskCocoa::applyCookiePolicyForThirdPartyCNAMECloaking): (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): (WebKit::hasCNAMEAndCookieTransformSPI): Deleted. Remove this helper function, since we no longer need `-respondsToSelector` checks for `_resolvedCNAMEChain` and `_cookieTransformCallback`. Canonical link: https://commits.webkit.org/255507@main
- Loading branch information
Showing
11 changed files
with
87 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters