Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f7a7c2332942260c44489ff33acecbd87a1152e4
      
https://github.com/WebKit/WebKit/commit/f7a7c2332942260c44489ff33acecbd87a1152e4
  Author: Franco Vieira de Souza <[email protected]>
  Date:   2026-06-23 (Tue, 23 Jun 2026)

  Changed paths:
    A 
LayoutTests/fast/events/message-port-transfer-preserves-pending-message-expected.txt
    A 
LayoutTests/fast/events/message-port-transfer-preserves-pending-message.html
    A PerformanceTests/DOM/MessagePort/throughput-same-context-batch.html
    A PerformanceTests/DOM/MessagePort/throughput-same-context-new-ports.html
    A PerformanceTests/DOM/MessagePort/throughput-same-context.html
    M Source/WebCore/dom/MessageChannel.cpp
    M Source/WebCore/dom/MessagePort.cpp
    M Source/WebCore/dom/MessagePort.h

  Log Message:
  -----------
  Short circuit same-realm MessagePort message delivery
https://bugs.webkit.org/show_bug.cgi?id=317242
rdar://168247413

Reviewed by Chris Dumez.

A path that does not involve IPC nor thread-hopping was added to
MessagePort::postMessage(). It is only used when both the sending and
receiving ends have never been shipped. This use case is not uncommon
because using a port pair simply for scheduling reasons is a known
workaround for nested setTimeout() timing restrictions.

When any of the ends is disentangled, all unhandled messages are
drained to the MessagePortChannelProvider, and the local path is
never used again.

One new test verifying the correctness of port transfer, for an
already started local port:
* LayoutTests/fast/events/message-port-transfer-preserves-pending-message.html

Three microbenchmarks were added:
* PerformanceTests/DOM/MessagePort/throughput-same-context-batch.html
* PerformanceTests/DOM/MessagePort/throughput-same-context-new-ports.html
* PerformanceTests/DOM/MessagePort/throughput-same-context.html

throughput-same-context-new-ports.html is of extra relevance because
it is analogous to a real requestIdleCallback() polyfill.

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



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

Reply via email to