Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a4d682ea4cb4e66b6a8344b4f8a8202646ff2a35
      
https://github.com/WebKit/WebKit/commit/a4d682ea4cb4e66b6a8344b4f8a8202646ff2a35
  Author: Sihui Liu <[email protected]>
  Date:   2024-07-15 (Mon, 15 Jul 2024)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h

  Log Message:
  -----------
  [Site Isolation] Ensure WebPageProxy is added after switching 
BrowsingContextGroup
https://bugs.webkit.org/show_bug.cgi?id=276599
rdar://131728034

Reviewed by Charlie Wolfe.

Some tests with cross-site iframe (e.g. 
http/tests/cookies/third-party-cookie-relaxing.html) are timed out when site
isolation is enabled and it is run after other tests. The direct cause is that 
UI process fails to send
WebProcess::CreateWebPage message to subframe process and thus the process does 
not correctly handle the subsequent
WebPage::LoadRequest message for the cross-site frame. Currently 
WebProcess::CreateWebPage message should be sent when
FrameProcess is added to BrowsingContextGroup, which will send the message to 
the process for all existing pages in the
group (see BrowsingContextGroup::addFrameProcess and 
RemotePageProxy::injectPageIntoNewProcess). The root cause is the
target WebPageProxy is not in BrowsingContextGroup::m_pages, since WebPageProxy 
does not add itself to
BrowsingContextGroup after switching group in 
WebPageProxy::swapToProvisionalPage. Note the ProvisionalPageProxy can
have different BrowsingContextGroup from its WebPageProxy if navigation 
requires session change (see
WebPageProxy::continueNavigationInNewProcess). And session change is something 
layout tests can do
testRunner.setShouldSwapToEphemeralSessionOnNextNavigation and 
testRunner.setShouldSwapToDefaultSessionOnNextNavigation.
In this case of third-party-cookie-relaxing.html, the previous 
cookies/private-cookie-storage.html test invokes these
functions and causes new BrowsingContextGroup to lose track of WebPageProxy.

To fix this, make sure WebPageProxy is removed from old BrowsingContextGroup 
and added to new BrowsingContextGroup.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setBrowsingContextGroup):
(WebKit::WebPageProxy::swapToProvisionalPage):
* Source/WebKit/UIProcess/WebPageProxy.h:

Canonical link: https://commits.webkit.org/280992@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