-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
34 changed files
with
97 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.