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
Adopt ScopedURL in Document #8255
Closed
Closed
Conversation
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
https://bugs.webkit.org/show_bug.cgi?id=250032 rdar://problem/103840054 Reviewed by NOBODY (OOPS!). We introduce a new ScopedURL type that inherits from URL. This is a special type because it tightly couples a URL and the SecurityOrigin of the main frame where the URL was created. The adoption of ScopedURL in this patch is a no-op, and conversions between ScopedURL and URL are implicit. In this future, this class will provide important context when the URL is a Blob URL. * Source/WebCore/Headers.cmake: * Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp: (WebCore::MediaSourceRegistry::unregisterURL): * Source/WebCore/Modules/mediasource/MediaSourceRegistry.h: * Source/WebCore/Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect): (WebCore::WebSocket::url const): * Source/WebCore/Modules/websockets/WebSocket.h: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/fileapi/Blob.cpp: (WebCore::BlobURLRegistry::unregisterURL): * Source/WebCore/fileapi/Blob.h: (WebCore::Blob::url const): * Source/WebCore/fileapi/BlobLoader.h: * Source/WebCore/fileapi/BlobURL.cpp: (WebCore::BlobURL::getOriginURL): (WebCore::BlobURL::isSecureBlobURL): * Source/WebCore/fileapi/BlobURL.h: * Source/WebCore/fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::start): * Source/WebCore/fileapi/FileReaderLoader.h: * Source/WebCore/fileapi/ThreadableBlobRegistry.cpp: (WebCore::ThreadableBlobRegistry::registerFileBlobURL): (WebCore::ThreadableBlobRegistry::registerBlobURL): (WebCore::unregisterBlobURLOriginIfNecessary): (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): (WebCore::ThreadableBlobRegistry::registerBlobURLForSlice): (WebCore::ThreadableBlobRegistry::blobSize): (WebCore::ThreadableBlobRegistry::unregisterBlobURL): (WebCore::ThreadableBlobRegistry::registerBlobURLHandle): (WebCore::ThreadableBlobRegistry::unregisterBlobURLHandle): * Source/WebCore/fileapi/ThreadableBlobRegistry.h: * Source/WebCore/fileapi/URLKeepingBlobAlive.cpp: (WebCore::URLKeepingBlobAlive::URLKeepingBlobAlive): (WebCore::URLKeepingBlobAlive::operator=): * Source/WebCore/fileapi/URLKeepingBlobAlive.h: (WebCore::URLKeepingBlobAlive::URLKeepingBlobAlive): (WebCore::URLKeepingBlobAlive::operator const ScopedURL& const): (WebCore::URLKeepingBlobAlive::url const): (WebCore::URLKeepingBlobAlive::operator=): (WebCore::URLKeepingBlobAlive::operator const URL& const): Deleted. * Source/WebCore/html/HTMLMediaElement.h: * Source/WebCore/html/PublicURLManager.cpp: (WebCore::PublicURLManager::revoke): * Source/WebCore/html/PublicURLManager.h: * Source/WebCore/html/URLRegistry.h: * Source/WebCore/loader/MixedContentChecker.cpp: (WebCore::MixedContentChecker::isMixedContent): * Source/WebCore/loader/MixedContentChecker.h: * Source/WebCore/page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::create): (WebCore::SecurityOrigin::emptyOrigin): (WebCore::SecurityOrigin::isSecure): (WebCore::SecurityOrigin::canRequest const): * Source/WebCore/page/SecurityOrigin.h: (WebCore::operator==): (WebCore::operator!=): * Source/WebCore/platform/network/BlobPart.h: (WebCore::BlobPart::BlobPart): (WebCore::BlobPart::url const): * Source/WebCore/platform/network/BlobRegistry.h: * Source/WebCore/platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::registerFileBlobURL): (WebCore::BlobRegistryImpl::registerBlobURL): (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): (WebCore::BlobRegistryImpl::registerBlobURLForSlice): (WebCore::BlobRegistryImpl::unregisterBlobURL): (WebCore::BlobRegistryImpl::getBlobDataFromURL const): (WebCore::BlobRegistryImpl::blobSize): (WebCore::BlobRegistryImpl::writeBlobToFilePath): (WebCore::BlobRegistryImpl::filesInBlob const): (WebCore::BlobRegistryImpl::registerBlobURLHandle): (WebCore::BlobRegistryImpl::unregisterBlobURLHandle): * Source/WebCore/platform/network/BlobRegistryImpl.h: * Source/WebCore/platform/network/FormData.cpp: (WebCore::FormDataElement::lengthInBytes const): (WebCore::FormData::appendBlob): (WebCore::appendBlobResolved): * Source/WebCore/platform/network/FormData.h: (WebCore::FormDataElement::FormDataElement): * Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp: * Source/WebCore/workers/AbstractWorker.cpp: * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked): (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLHandle): (WebKit::NetworkConnectionToWebProcess::unregisterBlobURLHandle): (WebKit::NetworkConnectionToWebProcess::blobSize): * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h: * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp: * Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp: (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry): * Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h: * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: * Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): (WebKit::BlobRegistryProxy::registerBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked): (WebKit::BlobRegistryProxy::unregisterBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLForSlice): (WebKit::BlobRegistryProxy::registerBlobURLHandle): (WebKit::BlobRegistryProxy::unregisterBlobURLHandle): (WebKit::BlobRegistryProxy::blobSize): * Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h: * Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm: * Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm: (-[WebSecurityOrigin initWithURL:]): * Tools/TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp: (TestWebKitAPI::TEST_F):
https://bugs.webkit.org/show_bug.cgi?id=250152 rdar://problem/103929390 Reviewed by NOBODY (OOPS!). A ScopedURL carries the associated top frame SecurityOrigin along with the URL. This tight coupling will provide easier seamless partitioning of Blob URLs in the future. This patch does not make any semantic changes. * Source/WebCore/dom/Document.cpp: (WebCore::Document::setURL): (WebCore::isURLPotentiallyTrustworthy): * Source/WebCore/dom/Document.h: * Source/WebCore/loader/DocumentLoader.cpp: (WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse): * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::scheduleRefreshIfNeeded): * Source/WebCore/plugins/PluginData.cpp: (WebCore::PluginData::webVisiblePlugins const): * Source/WebCore/xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource): * Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: (WebKit::WebResourceLoadObserver::logSubresourceLoading):
EWS run on current version of this PR (hash 37c552a) |
webkit-ews-buildbot
added
the
merging-blocked
Applied to prevent a change from being merged
label
Jan 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
37c552a
5ac4aee
37c552a