Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eaca76993c7a866c7abdb95cee40df269fa1cf4d
https://github.com/WebKit/WebKit/commit/eaca76993c7a866c7abdb95cee40df269fa1cf4d
Author: Youenn Fablet <[email protected]>
Date: 2024-11-06 (Wed, 06 Nov 2024)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window.html
A
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window.js
A
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-cache-partitioning-iframe.sub.html
A
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-cache-partitioning.sub.html
A
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-partitioning.py
M Source/WebCore/loader/CrossOriginAccessControl.cpp
M Source/WebCore/loader/CrossOriginAccessControl.h
M Source/WebCore/loader/CrossOriginPreflightChecker.cpp
M Source/WebCore/loader/CrossOriginPreflightResultCache.cpp
M Source/WebCore/loader/CrossOriginPreflightResultCache.h
M Source/WebCore/loader/DocumentThreadableLoader.cpp
M Source/WebCore/loader/DocumentThreadableLoader.h
M Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp
M Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h
M Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp
Log Message:
-----------
CORS-preflight cache is not partitioned by top-level site
rdar://135272104
Reviewed by Anne van Kesteren.
We were keying the preflight cache with a partition based on the fetch context
origin.
After this patch, the partitioning will be based on the fetch context client
origin (aka top context origin and fetch context origin).
This follows how other stored data like service workers or IDB are keyed.
This patch is switching NetworkCORSPreflightChecker topOrigin from a RefPtr to
a Ref.
NetworkCORSPreflightChecker gets it from NetworkLoadChecker which is created by
PingLoad and NetworkResourceLoader from its NetworkResourceLoadParameters.
As can be seen from WebLoaderStrategy code, NetworkResourceLoadParameters
source origin and top origin are set even though they are made as RefPtr.
A follow-up patch should change NetworkResourceLoadParameters to use Ref
instead of RefPtr.
Covered by imported WPT test.
*
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/cors/preflight-cache-partitioning.sub.window.js:
Added.
(promise_test.async t):
*
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-cache-partitioning-iframe.sub.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-cache-partitioning.sub.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/cors/resources/preflight-partitioning.py:
Added.
(main):
* Source/WebCore/loader/CrossOriginAccessControl.cpp:
(WebCore::validatePreflightResponse):
* Source/WebCore/loader/CrossOriginAccessControl.h:
* Source/WebCore/loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* Source/WebCore/loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCache::appendEntry):
(WebCore::CrossOriginPreflightResultCache::canSkipPreflight):
* Source/WebCore/loader/CrossOriginPreflightResultCache.h:
* Source/WebCore/loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::topOrigin const):
* Source/WebCore/loader/DocumentThreadableLoader.h:
* Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
(WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
* Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h:
* Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
Originally-landed-as: 280938.345@safari-7619-branch (77592f3b8e28).
rdar://138936230
Canonical link: https://commits.webkit.org/286250@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes