Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0ae47105d8750308a75b7a4ca05276cc4dae3e04
      
https://github.com/WebKit/WebKit/commit/0ae47105d8750308a75b7a4ca05276cc4dae3e04
  Author: Youenn Fablet <[email protected]>
  Date:   2026-03-16 (Mon, 16 Mar 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-close-array-buffer.window-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-close-blob-negotiated.window-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-close-blob.window-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-close-string-negotiated.window-expected.txt
    M LayoutTests/webrtc/datachannel/bufferedAmount-afterClose.html
    M Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
    M Source/WebCore/fileapi/NetworkSendQueue.cpp
    M Source/WebCore/fileapi/NetworkSendQueue.h

  Log Message:
  -----------
  RTCDataChannel needs to check for sctp buffered amount synchronously
rdar://172386678
https://bugs.webkit.org/show_bug.cgi?id=309792

Reviewed by Jean-Yves Avenard.

We align with chromium's approach and check synchronously the buffered amount, 
which is also specified in https://w3c.github.io/webrtc-pc/#datachannel-send 
step 6.
We use libwebrtc max buffer size.
To ensure blobs are sent while buffered, we add a way for NetworkSendQueue to 
let us know when the queue is empty. We then close the data channel at that 
time.

We make sure to clear the message queue in stop, since at that time, no datq 
should be sent.
We add nullptr checks in NetworkSendQueue::create write callbacks for 
additionaly safety.

Covered by rebased WPT tests.
We update webrtc/datachannel/bufferedAmount-afterClose.html as we no longer 
clear the queue when closing the data channel to allow blob sending.
In case peer connection gets closed while blob sending is in flux, sending of 
the blob might fail, which can trigger a console message.
We add dumpJSConsoleLogInStdErr to ensure that this does not disturb the test.

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



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

Reply via email to