[webkit-changes] [WebKit/WebKit] 538a42: Broadcast frame removal from non-main-frame proces...

Alex Christensen noreply at github.com
Sat Dec 7 10:11:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 538a4205bd8cf28132797e17ae63fdfa48ce6238
      https://github.com/WebKit/WebKit/commit/538a4205bd8cf28132797e17ae63fdfa48ce6238
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-12-07 (Sat, 07 Dec 2024)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.messages.in
    M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
    M Source/WebKit/WebProcess/WebPage/WebFrame.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebProcess.cpp
    M Source/WebKit/WebProcess/WebProcess.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm

  Log Message:
  -----------
  Broadcast frame removal from non-main-frame processes with site isolation
https://bugs.webkit.org/show_bug.cgi?id=284219

Reviewed by Pascoe.

This fixes a case where our frame accounting got messed up and led to
blank frames.  We had WebProcessProxy receiving the message that a frame
was destroyed and forwarding it to the WebPageProxy to broadcast to update
all the other processes's state.  However, if that message came from a
process other than the main frame's process, m_pageMap wouldn't contain
the page for a process that only had a RemotePageProxy associated with it.

Two changes were needed to get this working.  The first is that the
DidDestroyFrame message receiver was moved from WebProcessProxy to
WebPageProxy so the RemotePageProxy's message forwarding will make it
just arrive at the correct WebPageProxy.  The second is that if the UI
process has just told the web content process to destroy the frame or page,
then we need to not tell the UI process that the frame was destroyed.
Otherwise the broadcast messages would effectively echo.

* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didDestroyFrame): Deleted.
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/WebProcessProxy.messages.in:
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::invalidate):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:
(WebKit::WebFrame::markAsRemovedInAnotherProcess):
(WebKit::WebFrame::wasRemovedInAnotherProcess const):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::frameWasRemovedInAnotherProcess):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::WebProcess::removeWebFrame):
* Source/WebKit/WebProcess/WebProcess.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation, RemoveFrameFromRemoteFrame)):

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