Skip to content

Conversation

igower
Copy link
Contributor

@igower igower commented Aug 20, 2025

a3bc93f

Extend Fetch to accept local connections
https://bugs.webkit.org/show_bug.cgi?id=296710
rdar://154439024

Reviewed by Alex Christensen.

Reintroducing changes that had previously caused build failure. Original PR: 298921@main (d4e2bd4)
Integration with fetch as per the local network access spec: (https://wicg.github.io/local-network-access/#integration-with-fetch)

* LayoutTests/TestExpectations:
* LayoutTests/ipc/invalid-url-network-data-task-crash.html:
* LayoutTests/platform/glib/TestExpectations:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Modules/fetch/FetchRequest.cpp:
(WebCore::updateTargetAddressSpaceIfNeeded):
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::resourceRequest const):
(WebCore::FetchRequest::clone):
* Source/WebCore/Modules/fetch/FetchRequest.h:
* Source/WebCore/Modules/fetch/FetchRequest.idl:
* Source/WebCore/Modules/fetch/FetchRequestInit.h:
(WebCore::FetchRequestInit::hasMembers const):
* Source/WebCore/Modules/fetch/FetchRequestInit.idl:
* Source/WebCore/Modules/fetch/IPAddressSpace.cpp: Added.
(WebCore::determineIPAddressSpace):
(WebCore::isLocalIPAddressSpace):
* Source/WebCore/Modules/fetch/IPAddressSpace.h:
* Source/WebCore/Modules/geolocation/Geolocation.h:
* Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:
* Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.cpp:
* Source/WebCore/Modules/mediastream/RTCSessionDescription.h:
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Source/WebCore/Modules/notifications/NotificationEvent.cpp:
* Source/WebCore/Modules/streams/WritableStream.h:
* Source/WebCore/Modules/webaudio/AudioNode.h:
* Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp:
* Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/SecurityContext.cpp:
(WebCore::SecurityContext::policyContainer const):
(WebCore::SecurityContext::inheritPolicyContainerFrom):
* Source/WebCore/dom/SecurityContext.h:
(WebCore::SecurityContext::ipAddressSpace const):
(WebCore::SecurityContext::setIPAddressSpace):
* Source/WebCore/loader/LinkLoader.cpp:
* Source/WebCore/loader/PolicyContainer.h:
(WebCore::PolicyContainer::isolatedCopy const):
(WebCore::PolicyContainer::isolatedCopy):
* Source/WebCore/platform/network/ResourceRequestBase.cpp:
* Source/WebCore/platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::RequestData::RequestData):
(WebCore::ResourceRequestBase::targetAddressSpace const):
(WebCore::ResourceRequestBase::setTargetAddressSpace):
* Source/WebCore/platform/network/ResourceResponseBase.cpp:
(WebCore::m_ipAddressSpace):
(WebCore::ResourceResponseData::isolatedCopy const):
(WebCore::ResourceResponseBase::crossThreadData const):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::getResponseData const):
(WTF::Persistence::Coder<WebCore::ResourceResponseData>::decodeForPersistence):
(WebCore::m_type): Deleted.
* Source/WebCore/platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::ipAddressSpace):
(WebCore::ResourceResponseBase::setIPAddressSpace):
(WebCore::ResourceResponseData::ResourceResponseData):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/IPAddressSpaceTests.cpp: Added.
(TestWebKitAPI::TEST(IPAddressSpace, IPv4Loopback)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4PrivateAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4CarrierGradeNAT)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4LinkLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4Benchmarking)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4PublicAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6Loopback)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6UniqueLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6LinkLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6MappedIPv4DottedDecimal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6MappedIPv4HexNotation)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6PublicAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, HostnameAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, EdgeCasesAndMalformed)):
(TestWebKitAPI::TEST(IPAddressSpace, UtilityFunctions)):
(TestWebKitAPI::TEST(IPAddressSpace, DifferentURLSchemes)):
(TestWebKitAPI::TEST(IPAddressSpace, URLsWithPorts)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4BoundaryConditions)):

Canonical link: https://commits.webkit.org/298981@main

29d6dc1

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 💥 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
⏳ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ❌ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@igower igower requested review from cdumez and rniwa as code owners August 20, 2025 04:14
@igower igower self-assigned this Aug 20, 2025
@igower igower added the Page Loading For bugs in page loading, including handling of network callbacks. label Aug 20, 2025
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower removed the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower force-pushed the fetch-LNA-integration branch from 626a279 to 34d361f Compare August 20, 2025 16:35
@igower igower requested a review from marcoscaceres as a code owner August 20, 2025 16:35
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower removed the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower force-pushed the fetch-LNA-integration branch from 34d361f to f8d847f Compare August 20, 2025 17:50
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower removed the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower force-pushed the fetch-LNA-integration branch from f8d847f to 3b4a20f Compare August 20, 2025 18:28
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower removed the merging-blocked Applied to prevent a change from being merged label Aug 20, 2025
@igower igower force-pushed the fetch-LNA-integration branch from 3b4a20f to 29d6dc1 Compare August 20, 2025 18:45
Copy link
Contributor

@brentfulgham brentfulgham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for correcting the missing include.

@brentfulgham brentfulgham added the merge-queue Applied to send a pull request to merge-queue label Aug 20, 2025
@webkit-ews-buildbot webkit-ews-buildbot added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels Aug 20, 2025
@vitorroriz vitorroriz added ANGLE Bugs related to the ANGLE project merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Aug 20, 2025
https://bugs.webkit.org/show_bug.cgi?id=296710
rdar://154439024

Reviewed by Alex Christensen.

Reintroducing changes that had previously caused build failure. Original PR: 298921@main (d4e2bd4)
Integration with fetch as per the local network access spec: (https://wicg.github.io/local-network-access/#integration-with-fetch)

* LayoutTests/TestExpectations:
* LayoutTests/ipc/invalid-url-network-data-task-crash.html:
* LayoutTests/platform/glib/TestExpectations:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Modules/fetch/FetchRequest.cpp:
(WebCore::updateTargetAddressSpaceIfNeeded):
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::resourceRequest const):
(WebCore::FetchRequest::clone):
* Source/WebCore/Modules/fetch/FetchRequest.h:
* Source/WebCore/Modules/fetch/FetchRequest.idl:
* Source/WebCore/Modules/fetch/FetchRequestInit.h:
(WebCore::FetchRequestInit::hasMembers const):
* Source/WebCore/Modules/fetch/FetchRequestInit.idl:
* Source/WebCore/Modules/fetch/IPAddressSpace.cpp: Added.
(WebCore::determineIPAddressSpace):
(WebCore::isLocalIPAddressSpace):
* Source/WebCore/Modules/fetch/IPAddressSpace.h:
* Source/WebCore/Modules/geolocation/Geolocation.h:
* Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp:
* Source/WebCore/Modules/mediastream/MediaStreamTrackProcessor.cpp:
* Source/WebCore/Modules/mediastream/RTCSessionDescription.h:
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Source/WebCore/Modules/notifications/NotificationEvent.cpp:
* Source/WebCore/Modules/streams/WritableStream.h:
* Source/WebCore/Modules/webaudio/AudioNode.h:
* Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp:
* Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/SecurityContext.cpp:
(WebCore::SecurityContext::policyContainer const):
(WebCore::SecurityContext::inheritPolicyContainerFrom):
* Source/WebCore/dom/SecurityContext.h:
(WebCore::SecurityContext::ipAddressSpace const):
(WebCore::SecurityContext::setIPAddressSpace):
* Source/WebCore/loader/LinkLoader.cpp:
* Source/WebCore/loader/PolicyContainer.h:
(WebCore::PolicyContainer::isolatedCopy const):
(WebCore::PolicyContainer::isolatedCopy):
* Source/WebCore/platform/network/ResourceRequestBase.cpp:
* Source/WebCore/platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::RequestData::RequestData):
(WebCore::ResourceRequestBase::targetAddressSpace const):
(WebCore::ResourceRequestBase::setTargetAddressSpace):
* Source/WebCore/platform/network/ResourceResponseBase.cpp:
(WebCore::m_ipAddressSpace):
(WebCore::ResourceResponseData::isolatedCopy const):
(WebCore::ResourceResponseBase::crossThreadData const):
(WebCore::ResourceResponseBase::fromCrossThreadData):
(WebCore::ResourceResponseBase::getResponseData const):
(WTF::Persistence::Coder<WebCore::ResourceResponseData>::decodeForPersistence):
(WebCore::m_type): Deleted.
* Source/WebCore/platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::ipAddressSpace):
(WebCore::ResourceResponseBase::setIPAddressSpace):
(WebCore::ResourceResponseData::ResourceResponseData):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/IPAddressSpaceTests.cpp: Added.
(TestWebKitAPI::TEST(IPAddressSpace, IPv4Loopback)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4PrivateAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4CarrierGradeNAT)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4LinkLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4Benchmarking)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4PublicAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6Loopback)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6UniqueLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6LinkLocal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6MappedIPv4DottedDecimal)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6MappedIPv4HexNotation)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv6PublicAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, HostnameAddresses)):
(TestWebKitAPI::TEST(IPAddressSpace, EdgeCasesAndMalformed)):
(TestWebKitAPI::TEST(IPAddressSpace, UtilityFunctions)):
(TestWebKitAPI::TEST(IPAddressSpace, DifferentURLSchemes)):
(TestWebKitAPI::TEST(IPAddressSpace, URLsWithPorts)):
(TestWebKitAPI::TEST(IPAddressSpace, IPv4BoundaryConditions)):

Canonical link: https://commits.webkit.org/298981@main
@webkit-commit-queue
Copy link
Collaborator

Committed 298981@main (a3bc93f): https://commits.webkit.org/298981@main

Reviewed commits have been landed. Closing PR #49639 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a3bc93f into WebKit:main Aug 20, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ANGLE Bugs related to the ANGLE project Page Loading For bugs in page loading, including handling of network callbacks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants