Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 26e59b88d51c6906b7df685715b4b9c00ed88935
      
https://github.com/WebKit/WebKit/commit/26e59b88d51c6906b7df685715b4b9c00ed88935
  Author: Youenn Fablet <you...@apple.com>
  Date:   2025-08-28 (Thu, 28 Aug 2025)

  Changed paths:
    M Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
    M Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
    M Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
    M Source/WebCore/Modules/mediastream/RTCPeerConnection.h
    M 
Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp
    M Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
    M Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h
    M 
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp
    M 
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h

  Log Message:
  -----------
  LibWebRTCMediaEndpoint should create its libwebrtc backend at creation time
https://bugs.webkit.org/show_bug.cgi?id=297722
rdar://158856248

Reviewed by Jean-Yves Avenard.

Before the patch, the LibWebRTCMediaEndpoint setup would be like this:
- We create a LibWebRTCMediaEndpoint when creating the RTCPeerConnection.
- We create LibWebRTCMediaEndpoint's backend when applying the configuration 
given to RTCPeerConnection JS constructor.
- If LibWebRTCMediaEndpoint's backend creation fails, we would return early and 
the RTCPeerConnection JS constructor would throw.

This leaves LibWebRTCMediaEndpoint object with a nullptr backend for a short 
period of time, which makes the code difficult to reason about,
in particular whether to check for backend nullptr, or whether 
LibWebRTCMediaEndpoint is stopped (which is the point where the backend is 
currently back to nullptr_.

To make things simpler, we are now passing the configuration needed for 
LibWebRTCMediaEndpoint's backend creation as part of PeerConnectionBackend 
creation routine.
This allows LibWebRTCMediaEndpoint::create to try creating its backend.
If it fails, LibWebRTCMediaEndpoint::create will return nullptr and 
RTCPeerConnection JS constructor will throw as done previously.

This change requires a bunch of changes in RTCPeerConnection and 
LibWebRTCPeerConnectionBackend since we are not fully reusing the 
setConfiguration code path at initialization.

Covered by existing tests.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to