Skip to content
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

[Cocoa] Add plumbing for a couple more platform flags on ResourceRequest #13150

Merged
merged 1 commit into from Apr 25, 2023

Conversation

whsieh
Copy link
Member

@whsieh whsieh commented Apr 25, 2023

2092e71

[Cocoa] Add plumbing for a couple more platform flags on ResourceRequest
https://bugs.webkit.org/show_bug.cgi?id=255927
rdar://105895713

Reviewed by Tim Horton and Matthew Finkel.

Add plumbing for two flags on `ResourceRequest`: `PrivacyProxyFailClosedForUnreachableNonMainHosts`
and `UseNetworkConnectionIntegrity`, which both map to SPI properties on `NSURLRequest`. In a
subsequent patch, this will make it possible for WebKit clients to specify these flags on a URL
request when loading a web view, and have this state propagate to everywhere (including the resource
request used for performing preconnect).

* Source/WebCore/platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
(WebCore::ResourceRequestBase::setIsAppInitiated):
(WebCore::ResourceRequestBase::setPrivacyProxyFailClosedForUnreachableNonMainHosts):
(WebCore::ResourceRequestBase::setUseNetworkConnectionIntegrity):

Add support for the new flags here; this closely follows the existing pattern used to plumb whether
or not the request is app-initiated through `ResourceRequest`.

* Source/WebCore/platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::RequestData::RequestData):
(WebCore::ResourceRequestBase::privacyProxyFailClosedForUnreachableNonMainHosts const):
(WebCore::ResourceRequestBase::useNetworkConnectionIntegrity const):
* Source/WebCore/platform/network/cf/ResourceRequest.h:
* Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
* Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::getResourceRequestPlatformData const):
(WebCore::configureRequestWithData):

Add a new helper method to set some policy flags on the platform URL request, to avoid duplicating
this logic in the two methods below.

(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
* Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Add IPC encoding/decoding support for the platform flags.

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

e1837a3

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@whsieh whsieh self-assigned this Apr 25, 2023
@whsieh whsieh added the Platform Portability improvements and other general platform improvements not driven directly by site bugs. label Apr 25, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 25, 2023
@whsieh whsieh removed the merging-blocked Applied to prevent a change from being merged label Apr 25, 2023
Copy link
Contributor

@sysrqb sysrqb left a comment

Choose a reason for hiding this comment

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

Otherwise, lgtm.

@whsieh
Copy link
Member Author

whsieh commented Apr 25, 2023

Thanks for the reviews!

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 25, 2023
@whsieh whsieh removed the merging-blocked Applied to prevent a change from being merged label Apr 25, 2023
@whsieh whsieh added the merge-queue Applied to send a pull request to merge-queue label Apr 25, 2023
https://bugs.webkit.org/show_bug.cgi?id=255927
rdar://105895713

Reviewed by Tim Horton and Matthew Finkel.

Add plumbing for two flags on `ResourceRequest`: `PrivacyProxyFailClosedForUnreachableNonMainHosts`
and `UseNetworkConnectionIntegrity`, which both map to SPI properties on `NSURLRequest`. In a
subsequent patch, this will make it possible for WebKit clients to specify these flags on a URL
request when loading a web view, and have this state propagate to everywhere (including the resource
request used for performing preconnect).

* Source/WebCore/platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
(WebCore::ResourceRequestBase::setIsAppInitiated):
(WebCore::ResourceRequestBase::setPrivacyProxyFailClosedForUnreachableNonMainHosts):
(WebCore::ResourceRequestBase::setUseNetworkConnectionIntegrity):

Add support for the new flags here; this closely follows the existing pattern used to plumb whether
or not the request is app-initiated through `ResourceRequest`.

* Source/WebCore/platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::RequestData::RequestData):
(WebCore::ResourceRequestBase::privacyProxyFailClosedForUnreachableNonMainHosts const):
(WebCore::ResourceRequestBase::useNetworkConnectionIntegrity const):
* Source/WebCore/platform/network/cf/ResourceRequest.h:
* Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
* Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::getResourceRequestPlatformData const):
(WebCore::configureRequestWithData):

Add a new helper method to set some policy flags on the platform URL request, to avoid duplicating
this logic in the two methods below.

(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
* Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.serialization.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Add IPC encoding/decoding support for the platform flags.

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

Committed 263390@main (2092e71): https://commits.webkit.org/263390@main

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

@webkit-commit-queue webkit-commit-queue merged commit 2092e71 into WebKit:main Apr 25, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 25, 2023
@whsieh whsieh deleted the eng/255927 branch April 25, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform Portability improvements and other general platform improvements not driven directly by site bugs.
Projects
None yet
6 participants