[webkit-changes] [WebKit/WebKit] 91d984: Plumb SecurityOriginData from Network requests
Matthew Finkel
noreply at github.com
Thu Aug 10 06:51:11 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 91d984e6865db9e0f1173e7954efe4d0ec7ba7b2
https://github.com/WebKit/WebKit/commit/91d984e6865db9e0f1173e7954efe4d0ec7ba7b2
Author: Matthew Finkel <sysrqb at apple.com>
Date: 2023-08-10 (Thu, 10 Aug 2023)
Changed paths:
M Source/WebCore/html/HTMLAnchorElement.cpp
M Source/WebCore/loader/PolicyChecker.cpp
M Source/WebCore/page/ChromeClient.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebCore/platform/network/BlobRegistryImpl.cpp
M Source/WebCore/platform/network/BlobRegistryImpl.h
M Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp
M Source/WebKit/NetworkProcess/Downloads/DownloadManager.h
M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
M Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp
M Source/WebKit/NetworkProcess/NetworkDataTaskBlob.h
M Source/WebKit/NetworkProcess/NetworkLoad.cpp
M Source/WebKit/NetworkProcess/NetworkProcess.cpp
M Source/WebKit/NetworkProcess/NetworkProcess.h
M Source/WebKit/NetworkProcess/NetworkProcess.messages.in
M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
M Source/WebKit/NetworkProcess/NetworkSession.h
M Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
M Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm
M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
M Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
M Source/WebKit/UIProcess/SystemPreviewController.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
Log Message:
-----------
Plumb SecurityOriginData from Network requests
https://bugs.webkit.org/show_bug.cgi?id=259904
rdar://problem/113528936
Reviewed by Chris Dumez.
Similar to the previous patches related to partitioning the blob registry, this
patch plumbs the SecurityOriginData associated with the top document when we
are handling a request for a blob.
Most network loads already contained an associated topOrigin, but the challenge
of this patch was making sure we provided the correct origin when loading a
blob URL. In general, that top origin is the same as a normal request, but
there is an edge case where a blob URL is opened in a popup where we actually
need the top origin of the triggering document (and not the top origin of the
popup).
Downloading and System Preview required additional plumbing.
This shouldn't have any behavioral changes. No new tests.
* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): Needed for supporting system preview
* Source/WebCore/loader/PolicyChecker.cpp:
(WebCore::FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
We need to correct top origin so we can extend the lifetime.
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::beginSystemPreview):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::beginSystemPreview):
* Source/WebCore/page/Page.h:
More system preview plumbing
* Source/WebCore/platform/network/BlobRegistryImpl.cpp:
(WebCore::loadBlobResourceSynchronously):
(WebCore::BlobRegistryImpl::createResourceHandle): I believe these are only used
by WebKitLegacy. I wanted to make a note about that.
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
(WebCore::BlobRegistryImpl::filesInBlob const):
(WebCore::BlobRegistryImpl::addBlobData):
* Source/WebCore/platform/network/BlobRegistryImpl.h: General plumbing
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* Source/WebKit/NetworkProcess/Downloads/DownloadManager.h:
(WebKit::DownloadManager::startDownload):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startDownload):
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::startDownload):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in:
Supporting downloads
* Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
* Source/WebKit/NetworkProcess/NetworkDataTaskBlob.h:
* Source/WebKit/NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::downloadRequest):
(WebKit::NetworkProcess::dataTaskWithRequest):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/NetworkProcess.messages.in:
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::convertToDownload):
* Source/WebKit/NetworkProcess/NetworkSession.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::dataTaskWithRequest):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _dataTaskWithRequest:completionHandler:]): We don't know the
correct top origin for this request, and that affects how we will partition the
registry in a future patch.
* Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::dataTaskWithRequest):
* Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:
* Source/WebKit/UIProcess/SystemPreviewController.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dataTaskWithRequest):
(WebKit::WebPageProxy::beginSystemPreview):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::beginSystemPreview):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
Canonical link: https://commits.webkit.org/266760@main
More information about the webkit-changes
mailing list