[webkit-changes] [WebKit/WebKit] 063551: [Site Isolation] RemotePageProxy should generate a...
Charlie Wolfe
noreply at github.com
Fri Feb 7 09:52:53 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 063551dd3c6200e93fb9eb92f80b9c7a6d813ce7
https://github.com/WebKit/WebKit/commit/063551dd3c6200e93fb9eb92f80b9c7a6d813ce7
Author: Charlie Wolfe <charliew at apple.com>
Date: 2025-02-07 (Fri, 07 Feb 2025)
Changed paths:
M Source/WebKit/UIProcess/BrowsingContextGroup.cpp
M Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
M Source/WebKit/UIProcess/RemotePageProxy.cpp
M Source/WebKit/UIProcess/RemotePageProxy.h
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/UIProcess/WebFrameProxy.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPasteboardProxy.cpp
M Source/WebKit/UIProcess/WebPasteboardProxy.h
M Source/WebKit/UIProcess/WebPasteboardProxy.messages.in
M Source/WebKit/UIProcess/WebURLSchemeTask.cpp
M Source/WebKit/UIProcess/WebURLSchemeTask.h
M Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp
M Source/WebKit/UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Log Message:
-----------
[Site Isolation] RemotePageProxy should generate a new PageIdentifier on creation
https://bugs.webkit.org/show_bug.cgi?id=287217
rdar://144360250
Reviewed by Alex Christensen.
Creating a new PageIdentifier for each RemotePageProxy prevents a situation where a navigation to an
existing remote page would cause the new page to reuse the previous page’s identifier. This reuse cannot
work with the back/forward cache enabled, because we need to assign a separate identifier to the page
that was navigated away from and suspended.
This change also reveals and fixes several bugs where incorrect page IDs might be used when sending
messages to web processes. More details follow.
* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::BrowsingContextGroup::transitionPageToRemotePage):
(WebKit::BrowsingContextGroup::transitionProvisionalPageToRemotePage):
If we are transitioning an existing ProvisionalPageProxy or WebPageProxy to a RemotePageProxy the pageID
should be kept.
* Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardTypes):
(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
(WebKit::WebPasteboardProxy::getPasteboardStringForType):
(WebKit::WebPasteboardProxy::getPasteboardStringsForType):
(WebKit::WebPasteboardProxy::getPasteboardBufferForType):
(WebKit::WebPasteboardProxy::getPasteboardChangeCount):
(WebKit::WebPasteboardProxy::getPasteboardColor):
(WebKit::WebPasteboardProxy::getPasteboardURL):
(WebKit::WebPasteboardProxy::addPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardTypes):
(WebKit::WebPasteboardProxy::setPasteboardURL):
(WebKit::WebPasteboardProxy::setPasteboardColor):
(WebKit::WebPasteboardProxy::setPasteboardStringForType):
(WebKit::WebPasteboardProxy::containsURLStringSuitableForLoading):
(WebKit::WebPasteboardProxy::urlStringSuitableForLoading):
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
(WebKit::WebPasteboardProxy::getNumberOfFiles):
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
(WebKit::WebPasteboardProxy::informationForItemAtIndex):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::containsStringSafeForDOMToReadForType):
(WebKit::WebPasteboardProxy::writeURLToPasteboard):
(WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
(WebKit::WebPasteboardProxy::writeImageToPasteboard):
(WebKit::WebPasteboardProxy::writeStringToPasteboard):
(WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):
(WebKit::WebPasteboardProxy::determineDataOwner const):
(WebKit::WebPasteboardProxy::testIPCSharedMemory):
* Source/WebKit/UIProcess/WebPasteboardProxy.cpp:
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
(WebKit::WebPasteboardProxy::informationForItemAtIndex):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
(WebKit::WebPasteboardProxy::containsStringSafeForDOMToReadForType):
(WebKit::WebPasteboardProxy::containsURLStringSuitableForLoading):
(WebKit::WebPasteboardProxy::urlStringSuitableForLoading):
* Source/WebKit/UIProcess/WebPasteboardProxy.h:
* Source/WebKit/UIProcess/WebPasteboardProxy.messages.in:
* Source/WebKit/UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
(WebKit::WebPasteboardProxy::writeCustomData):
(WebKit::WebPasteboardProxy::allPasteboardItemInfo):
(WebKit::WebPasteboardProxy::informationForItemAtIndex):
(WebKit::WebPasteboardProxy::getPasteboardItemsCount):
(WebKit::WebPasteboardProxy::readURLFromPasteboard):
(WebKit::WebPasteboardProxy::readBufferFromPasteboard):
* Source/WebKit/UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp:
(WebKit::WebPasteboardProxy::readStringFromPasteboard):
* Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::pageIdentifier):
These messages should send a WebPageProxyIdentifier instead of a PageIdentifier. This fixes a failing
message check in WebPasteboardProxy::determineDataOwner that verifies the web process sending the IPC has
the same page identifier as the page’s main frame.
* Source/WebKit/UIProcess/RemotePageProxy.cpp:
(WebKit::RemotePageProxy::create):
(WebKit::RemotePageProxy::RemotePageProxy):
* Source/WebKit/UIProcess/RemotePageProxy.h:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::prepareForProvisionalLoadInProcess):
* Source/WebKit/UIProcess/WebFrameProxy.h:
A RemotePageProxy and its PageIdentifier can be created in ensureProcessForSite, so the call to
webPageIDInProcess must occur afterward.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationActionPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
(WebKit::WebPageProxy::startURLSchemeTask):
(WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
* Source/WebKit/UIProcess/WebURLSchemeTask.cpp:
(WebKit::WebURLSchemeTask::pageDestroyed): Deleted.
This function isn't used, so remove it.
(WebKit::WebURLSchemeTask::willPerformRedirection):
Canonical link: https://commits.webkit.org/290019@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list