Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ae1111af5882a35dafa88dda632bcaa89e6c8b0f
      
https://github.com/WebKit/WebKit/commit/ae1111af5882a35dafa88dda632bcaa89e6c8b0f
  Author: Brady Eidson <[email protected]>
  Date:   2025-12-17 (Wed, 17 Dec 2025)

  Changed paths:
    M Source/WebCore/dom/messageports/MessagePortChannel.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/MessagePortProviders.mm

  Log Message:
  -----------
  Transferring buffers to a closed MessageChannel causes memory leaks in Safari 
Networking
rdar://138550781
https://bugs.webkit.org/show_bug.cgi?id=281662

Reviewed by Ben Nham.

The networking process buffers MessageChannel messages for later retrieval by 
the appropriate web process.
Even if the target port is closed.

The fix is to skip those messages that will never be delivered.

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/MessagePortProviders.mm

* Source/WebCore/dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::postMessageToRemote):

* Tools/TestWebKitAPI/Tests/WebKitCocoa/MessagePortProviders.mm:
(TestWebKitAPI:: const):
(TestWebKitAPI::setInterval):
(TestWebKitAPI::MessageToClosedPort)): Doing some memory math and pid 
comparison, we can regression test this!

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to