Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbe8887ec47918a004b8b38dbd9efb1977b0b3c7
      
https://github.com/WebKit/WebKit/commit/cbe8887ec47918a004b8b38dbd9efb1977b0b3c7
  Author: Charlie Wolfe <[email protected]>
  Date:   2025-02-11 (Tue, 11 Feb 2025)

  Changed paths:
    M Source/WebKit/UIProcess/BrowsingContextGroup.cpp
    M Source/WebKit/UIProcess/BrowsingContextGroup.h
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.h
    M Source/WebKit/UIProcess/RemotePageProxy.cpp
    M Source/WebKit/UIProcess/RemotePageProxy.h

  Log Message:
  -----------
  [Site Isolation] Main frame navigation to a site loaded in a child frame 
should not reuse message receivers
https://bugs.webkit.org/show_bug.cgi?id=287450
rdar://144577663

Reviewed by Alex Christensen.

This is work towards enabling the back/forward cache.

Currently, if the main frame navigates to a site that is already loaded in a 
child frame,
ProvisionalPageProxy reuses the remote page’s message receiver and page 
identifier. This cannot work when
we need to cache the iframe’s page that is being navigated away from. Reusing 
the message receiver and
page’s main frame is only necessary when a new window is opened, so we should 
restrict this behavior to
that case.

* Source/WebKit/UIProcess/BrowsingContextGroup.cpp:
(WebKit::BrowsingContextGroup::removeFrameProcess):
(WebKit::BrowsingContextGroup::addRemotePage):
(WebKit::BrowsingContextGroup::removePage):
* Source/WebKit/UIProcess/BrowsingContextGroup.h:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
If a provisional navigation in the main frame fails, we need to re-add the 
RemotePageProxy that was
removed from the browsing context. We cannot use 
transitionProvisionalPageToRemotePage if the
ProvisionalPageProxy did not take the message receiver from the taken 
RemotePageProxy.

* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/RemotePageProxy.cpp:
(WebKit::RemotePageProxy::~RemotePageProxy):
Moving the Close IPC message to the RemotePageProxy destructor fixes an issue 
where the RemotePageProxy
taken by ProvisionalPageProxy would be destroyed without being evicted from the 
web process. With this
change, removePageFromProcess() is no longer needed.

(WebKit::RemotePageProxy::removePageFromProcess): Deleted.
* Source/WebKit/UIProcess/RemotePageProxy.h:

Canonical link: https://commits.webkit.org/290219@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to