haikuwebkit/Source/WebCore/Modules/fetch
Chris Dumez a8487ff2be Add Cross-Origin-Embedder-Policy support for Blob URLs
https://bugs.webkit.org/show_bug.cgi?id=229041

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

* web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt:
* web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https-expected.txt:

Source/WebCore:

Add Cross-Origin-Embedder-Policy (COEP) support for Blob URLs. We do the same thing as for COOP,
we pass the COEP policy when registering the Blob URL and store it in the BlobData. When we need
the construct a Blob resource response as a result of a load, we add the right COEP headers
based on the BlobData's COEP policy.

No new tests, rebaselined existing tests.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
* fileapi/Blob.cpp:
(WebCore::BlobURLRegistry::registerURL):
(WebCore::Blob::Blob):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::addCrossOriginEmbedderPolicyHeaders):
* loader/CrossOriginEmbedderPolicy.h:
(WebCore::operator==):
* loader/CrossOriginOpenerPolicy.cpp:
(WebCore::addCrossOriginOpenerPolicyHeaders):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* platform/network/BlobData.h:
(WebCore::BlobData::crossOriginEmbedderPolicy const):
(WebCore::BlobData::setCrossOriginEmbedderPolicy):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
* platform/network/BlobRegistryImpl.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.mm:

Source/WebKitLegacy/win:

* WebCoreSupport/WebPlatformStrategies.cpp:

LayoutTests:

Update test expectations to unskip tests that are now passing.

* TestExpectations:


Canonical link: https://commits.webkit.org/240518@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-14 02:28:19 +00:00
..
FetchBody.cpp Reduce use of reinterpret_cast<> in the codebase 2021-06-08 17:35:15 +00:00
FetchBody.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
FetchBody.idl
FetchBodyConsumer.cpp SharedBuffer::takeData() is a bit dangerous 2021-07-23 22:05:03 +00:00
FetchBodyConsumer.h FetchResponse.formData() should not reject promise if the body is null and the MIME Type is "application/x-www-form-urlencoded" 2021-07-19 21:33:16 +00:00
FetchBodyOwner.cpp Overly verbose catchable fetch error messages lead to cross-origin leaks 2021-08-13 10:22:38 +00:00
FetchBodyOwner.h FetchBodySource/FetchBodyOwner cleanup 2021-07-16 22:59:36 +00:00
FetchBodySource.cpp FetchBodySource/FetchBodyOwner cleanup 2021-07-16 22:59:36 +00:00
FetchBodySource.h FetchBodySource/FetchBodyOwner cleanup 2021-07-16 22:59:36 +00:00
FetchHeaders.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
FetchHeaders.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
FetchHeaders.idl [WebIDL] Remove the need to specify [MayThrowException] 2021-03-23 00:49:01 +00:00
FetchIdentifier.h
FetchLoader.cpp Add Cross-Origin-Embedder-Policy support for Blob URLs 2021-08-14 02:28:19 +00:00
FetchLoader.h Use Vector<uint8_t> instead of Vector<char> to store bytes in SharedBuffer 2021-06-05 01:16:43 +00:00
FetchLoaderClient.h Use Vector<uint8_t> instead of Vector<char> to store bytes in SharedBuffer 2021-06-05 01:16:43 +00:00
FetchReferrerPolicy.h
FetchReferrerPolicy.idl
FetchRequest.cpp Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
FetchRequest.h Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
FetchRequest.idl [WebIDL] Remove the need to specify [MayThrowException] 2021-03-23 00:49:01 +00:00
FetchRequestCache.h
FetchRequestCache.idl
FetchRequestCredentials.h
FetchRequestCredentials.idl
FetchRequestInit.h Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
FetchRequestInit.idl
FetchRequestMode.h
FetchRequestMode.idl
FetchRequestRedirect.h
FetchRequestRedirect.idl
FetchResponse.cpp Overly verbose catchable fetch error messages lead to cross-origin leaks 2021-08-13 10:22:38 +00:00
FetchResponse.h FetchBodySource/FetchBodyOwner cleanup 2021-07-16 22:59:36 +00:00
FetchResponse.idl [WebIDL] Remove the need to specify [MayThrowException] 2021-03-23 00:49:01 +00:00
WindowOrWorkerGlobalScope+Fetch.idl
WindowOrWorkerGlobalScopeFetch.cpp
WindowOrWorkerGlobalScopeFetch.h