Changeset 281298 in webkit


Ignore:
Timestamp:
Aug 20, 2021 12:55:13 AM (11 months ago)
Author:
youenn@apple.com
Message:

Add support for RTCPeerConnection.canTrickleIceCandidates
https://bugs.webkit.org/show_bug.cgi?id=229287

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt:
  • web-platform-tests/webrtc/idlharness.https.window-expected.txt:

Source/WebCore:

Add support for https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-cantrickleicecandidates.
Return null in case connection is closed or setRemoteDescription was never called successfully.
Add binding code to get the value from webrtc backend.
Covered by rebased tests.

  • Modules/mediastream/PeerConnectionBackend.h:
  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::RTCPeerConnection::canTrickleIceCandidates const):

  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/RTCPeerConnection.idl:
  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::canTrickleIceCandidates const):

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:

(WebCore::LibWebRTCPeerConnectionBackend::canTrickleIceCandidates const):

  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

LayoutTests:

  • webrtc/rtcpeerconnection-error-messages-expected.txt:
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r281296 r281298  
     12021-08-20  Youenn Fablet  <youenn@apple.com>
     2
     3        Add support for RTCPeerConnection.canTrickleIceCandidates
     4        https://bugs.webkit.org/show_bug.cgi?id=229287
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/rtcpeerconnection-error-messages-expected.txt:
     9
    1102021-08-19  Tim Nguyen  <ntim@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281295 r281298  
     12021-08-20  Youenn Fablet  <youenn@apple.com>
     2
     3        Add support for RTCPeerConnection.canTrickleIceCandidates
     4        https://bugs.webkit.org/show_bug.cgi?id=229287
     5
     6        Reviewed by Eric Carlson.
     7
     8        * web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt:
     9        * web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt:
     10        * web-platform-tests/webrtc/idlharness.https.window-expected.txt:
     11
    1122021-08-19  Antti Koivisto  <antti@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt

    r216537 r281298  
    11
    2 FAIL canTrickleIceCandidates property is null prior to setRemoteDescription assert_equals: canTrickleIceCandidates property is null expected (object) null but got (undefined) undefined
    3 FAIL canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle assert_true: canTrickleIceCandidates property is true after setRemoteDescription expected true got undefined
    4 FAIL canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle assert_false: canTrickleIceCandidates property is false after setRemoteDescription expected false got undefined
     2PASS canTrickleIceCandidates property is null prior to setRemoteDescription
     3PASS canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle
     4PASS canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt

    r267649 r281298  
    2121PASS iceConnectionState initial value
    2222PASS connectionState initial value
    23 FAIL canTrickleIceCandidates initial value assert_equals: expected (object) null but got (undefined) undefined
     23PASS canTrickleIceCandidates initial value
    2424
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/idlharness.https.window-expected.txt

    r281225 r281298  
    3838PASS RTCPeerConnection interface: attribute iceConnectionState
    3939PASS RTCPeerConnection interface: attribute connectionState
    40 FAIL RTCPeerConnection interface: attribute canTrickleIceCandidates assert_true: The prototype object must have a property "canTrickleIceCandidates" expected true got false
     40PASS RTCPeerConnection interface: attribute canTrickleIceCandidates
    4141PASS RTCPeerConnection interface: operation restartIce()
    4242PASS RTCPeerConnection interface: operation getConfiguration()
     
    8989PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "iceConnectionState" with the proper type
    9090PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "connectionState" with the proper type
    91 FAIL RTCPeerConnection interface: new RTCPeerConnection() must inherit property "canTrickleIceCandidates" with the proper type assert_inherits: property "canTrickleIceCandidates" not found in prototype chain
     91PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "canTrickleIceCandidates" with the proper type
    9292PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "restartIce()" with the proper type
    9393PASS RTCPeerConnection interface: new RTCPeerConnection() must inherit property "getConfiguration()" with the proper type
  • trunk/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt

    r270101 r281298  
    99TypeError: The RTCPeerConnection.iceConnectionState getter can only be used on instances of RTCPeerConnection
    1010TypeError: The RTCPeerConnection.connectionState getter can only be used on instances of RTCPeerConnection
    11 [object RTCPeerConnection] has no property named canTrickleIceCandidates
     11TypeError: The RTCPeerConnection.canTrickleIceCandidates getter can only be used on instances of RTCPeerConnection
    1212[object RTCPeerConnection] has no property named defaultIceServers
    1313TypeError: Can only call RTCPeerConnection.getConfiguration on instances of RTCPeerConnection
  • trunk/Source/WebCore/ChangeLog

    r281296 r281298  
     12021-08-20  Youenn Fablet  <youenn@apple.com>
     2
     3        Add support for RTCPeerConnection.canTrickleIceCandidates
     4        https://bugs.webkit.org/show_bug.cgi?id=229287
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add support for https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-cantrickleicecandidates.
     9        Return null in case connection is closed or setRemoteDescription was never called successfully.
     10        Add binding code to get the value from webrtc backend.
     11        Covered by rebased tests.
     12
     13        * Modules/mediastream/PeerConnectionBackend.h:
     14        * Modules/mediastream/RTCPeerConnection.cpp:
     15        (WebCore::RTCPeerConnection::canTrickleIceCandidates const):
     16        * Modules/mediastream/RTCPeerConnection.h:
     17        * Modules/mediastream/RTCPeerConnection.idl:
     18        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     19        (WebCore::LibWebRTCMediaEndpoint::canTrickleIceCandidates const):
     20        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
     21        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
     22        (WebCore::LibWebRTCPeerConnectionBackend::canTrickleIceCandidates const):
     23        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
     24
    1252021-08-19  Tim Nguyen  <ntim@apple.com>
    226
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h

    r281225 r281298  
    135135    void enableICECandidateFiltering();
    136136
     137    virtual std::optional<bool> canTrickleIceCandidates() const = 0;
     138
    137139    virtual void applyRotationForOutgoingVideoSources() { }
    138140
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r281231 r281298  
    335335}
    336336
     337std::optional<bool> RTCPeerConnection::canTrickleIceCandidates() const
     338{
     339    if (isClosed() || !remoteDescription())
     340        return { };
     341    return m_backend-> canTrickleIceCandidates();
     342}
     343
    337344// Implementation of https://w3c.github.io/webrtc-pc/#set-pc-configuration
    338345ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> RTCPeerConnection::iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet)
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r281231 r281298  
    127127    RTCIceConnectionState iceConnectionState() const { return m_iceConnectionState; }
    128128    RTCPeerConnectionState connectionState() const { return m_connectionState; }
     129    std::optional<bool> canTrickleIceCandidates() const;
    129130
    130131    void restartIce() { m_backend->restartIce(); }
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r276204 r281298  
    100100    readonly attribute RTCIceConnectionState iceConnectionState;
    101101    readonly attribute RTCPeerConnectionState connectionState;
    102     // FIXME 169644: missing canTrickleIceCandidates
    103     // FIXME 169644: missing defaultIceServers
     102    readonly attribute boolean? canTrickleIceCandidates;
    104103
    105104    undefined restartIce();
     
    141140    // 8.2 Statistics API
    142141    Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null);
    143 
    144 
    145     // 9.6 Identity Provider API
    146     // FIXME 169644: missing IdP
    147142};
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r279483 r281298  
    403403}
    404404
     405std::optional<bool> LibWebRTCMediaEndpoint::canTrickleIceCandidates() const
     406{
     407    if (!m_backend)
     408        return { };
     409    return m_backend->can_trickle_ice_candidates();
     410}
     411
    405412void LibWebRTCMediaEndpoint::newTransceiver(rtc::scoped_refptr<webrtc::RtpTransceiverInterface>&& rtcTransceiver)
    406413{
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h

    r279483 r281298  
    118118    void collectTransceivers();
    119119
     120    std::optional<bool> canTrickleIceCandidates() const;
     121
    120122    void suspend();
    121123    void resume();
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp

    r279483 r281298  
    465465}
    466466
     467std::optional<bool> LibWebRTCPeerConnectionBackend::canTrickleIceCandidates() const
     468{
     469    return m_endpoint->canTrickleIceCandidates();
     470}
     471
    467472} // namespace WebCore
    468473
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h

    r279483 r281298  
    8080    RefPtr<RTCSessionDescription> pendingRemoteDescription() const final;
    8181
     82    std::optional<bool> canTrickleIceCandidates() const final;
     83
    8284    void emulatePlatformEvent(const String&) final { }
    8385    void applyRotationForOutgoingVideoSources() final;
Note: See TracChangeset for help on using the changeset viewer.