⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 281981 in webkit


Ignore:
Timestamp:
Sep 3, 2021, 2:40:55 AM (5 years ago)
Author:
youenn@apple.com
Message:

Migrate to latest libwebrtc AddIceCandidate
​https://bugs.webkit.org/show_bug.cgi?id=229700

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare-linear.https-expected.txt:
  • web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare.https-expected.txt:

Source/WebCore:

AddIceCandidate can now take a callback to return a RTCError which provides necessary information to reject the promise as needed.
Update binding code accordingly.
This allows to use a lambda that takes the promise instead of having the promise as a member of PeerConnectionBackend.
Covered by updated and rebased tests.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::addIceCandidate):
(WebCore::PeerConnectionBackend::stop):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded): Deleted.
(WebCore::PeerConnectionBackend::addIceCandidateFailed): Deleted.

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

(WebCore::LibWebRTCMediaEndpoint::addIceCandidate):

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

(WebCore::LibWebRTCMediaEndpoint::addIceCandidate): Deleted.

  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:

(WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
(WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):

  • Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
  • testing/MockLibWebRTCPeerConnection.h:

LayoutTests:

  • TestExpectations: mark failing test as flaky as an exception sometimes happen.
  • fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
  • fast/mediastream/RTCPeerConnection-addIceCandidate.html:

Update the test to match implementation, which makes it consistent with other browsers.

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r281980 r281981  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Migrate to latest libwebrtc AddIceCandidate
     4        https://bugs.webkit.org/show_bug.cgi?id=229700
     5
     6        Reviewed by Eric Carlson.
     7
     8        * TestExpectations: mark failing test as flaky as an exception sometimes happen.
     9        * fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
     10        * fast/mediastream/RTCPeerConnection-addIceCandidate.html:
     11        Update the test to match implementation, which makes it consistent with other browsers.
     12
    1132021-09-03  Said Abou-Hallawa  <said@apple.com>
    214
  • trunk/LayoutTests/TestExpectations

    r281975 r281981  
    21862186imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce-onnegotiationneeded.https.html [ Pass Failure ]
    21872187imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-candidate-in-sdp.https.html [ Pass Failure ]
     2188imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare.https.html [ Pass Failure ]
     2189imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare-linear.https.html [ Pass Failure ]
    21882190
    21892191# Skip timing out test
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt

    r266468 r281981  
    1414PASS sdpMid is not null
    1515PASS sdpMid is not badSdpMid
    16 FAIL promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid})) fulfilled unexpectedly.
    17 FAIL promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: badSdpMLineIndex})) fulfilled unexpectedly.
     16PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid})) rejected with OperationError: Error processing ICE candidate
     17PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError: Error processing ICE candidate
    1818*** A (bad) sdpMid takes precedesce over valid sdpMLineIndex
    19 FAIL promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid, sdpMLineIndex: sdpMLineIndex})) fulfilled unexpectedly.
     19PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid, sdpMLineIndex: sdpMLineIndex})) rejected with OperationError: Error processing ICE candidate
    2020*** Test bad candidate content with valid sdpMid
    2121PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMid: sdpMid})) rejected with OperationError: Expect line: candidate:<candidate-str>
    … …  
    2626
    2727*** Test some OK input
    28 PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid}) fulfilled with undefined
     28PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid}) rejected with OperationError: Error processing ICE candidate
    2929PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex}) fulfilled with undefined
    3030PASS promise pc.addIceCandidate(undefined) fulfilled with undefined
    3131PASS promise pc.addIceCandidate(null) fulfilled with undefined
    3232PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex})) fulfilled with undefined
    33 *** A valid sdpMid takes precedesce over a bad sdpMLineIndex
    34 PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex})) fulfilled with undefined
     33PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError: Error processing ICE candidate
    3534PASS End of test promise chain
    3635PASS successfullyParsed is true
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate.html

    r214527 r281981  
    8282                debug("<br>*** Test some OK input");
    8383                // Testing passing a RTCIceCandidateInit
    84                 return promiseShouldResolve("pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid})");
     84                return promiseShouldReject("pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid})");
    8585            })
    8686            .then(function () {
    … …  
    9898            })
    9999            .then(function () {
    100                 debug("*** A valid sdpMid takes precedesce over a bad sdpMLineIndex");
    101                 return promiseShouldResolve("pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex}))");
     100                return promiseShouldReject("pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex}))");
    102101            })
    103102            .then(function () {
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281975 r281981  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Migrate to latest libwebrtc AddIceCandidate
     4        https://bugs.webkit.org/show_bug.cgi?id=229700
     5
     6        Reviewed by Eric Carlson.
     7
     8        * web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt:
     9        * web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
     10        * web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare-linear.https-expected.txt:
     11        * web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare.https-expected.txt:
     12
    1132021-09-02  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt

    r270252 r281981  
    11
    2 FAIL Add ICE candidate before setting remote description should reject with InvalidStateError assert_unreached: Should have rejected: undefined Reached unreachable code
     2FAIL Add ICE candidate before setting remote description should reject with InvalidStateError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Error processing ICE candidate" that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
    33FAIL addIceCandidate({"candidate":"","sdpMid":null,"sdpMLineIndex":null}) should work, and add a=end-of-candidates to both m-sections assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
    44FAIL addIceCandidate(undefined) should work, and add a=end-of-candidates to both m-sections assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
    … …  
    99FAIL addIceCandidate({usernameFragment: usernameFragment2, sdpMLineIndex: 1}) should work, and add a=end-of-candidates to the first m-section assert_true: expected true got false
    1010FAIL addIceCandidate({usernameFragment: "no such ufrag"}) should not work assert_unreached: Should have rejected: undefined Reached unreachable code
    11 FAIL Add ICE candidate after setting remote description should succeed assert_true: Expect candidate line to be found after media line m=audio expected true got false
     11PASS Add ICE candidate after setting remote description should succeed
    1212PASS Add ICE candidate with RTCIceCandidate should succeed
    1313PASS Add candidate with only valid sdpMid should succeed
    1414PASS Add candidate with only valid sdpMid and RTCIceCandidate should succeed
    1515PASS Add candidate with only valid sdpMLineIndex should succeed
    16 FAIL addIceCandidate with first sdpMid and sdpMLineIndex add candidate to first media stream assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
    17 FAIL addIceCandidate with second sdpMid and sdpMLineIndex should add candidate to second media stream assert_true: Expect candidate line to be found after media line m=video expected true got false
    18 FAIL Add candidate for first media stream with null usernameFragment should add candidate to first media stream assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
    19 FAIL Adding multiple candidates should add candidates to their corresponding media stream assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
     16PASS addIceCandidate with first sdpMid and sdpMLineIndex add candidate to first media stream
     17PASS addIceCandidate with second sdpMid and sdpMLineIndex should add candidate to second media stream
     18PASS Add candidate for first media stream with null usernameFragment should add candidate to first media stream
     19PASS Adding multiple candidates should add candidates to their corresponding media stream
    2020FAIL Add with empty candidate string (end of candidate) should succeed assert_true: Expect candidate line to be found between media lines m=audio and m=video expected true got false
    2121PASS Add candidate with both sdpMid and sdpMLineIndex manually set to null should reject with TypeError
    2222PASS Add candidate with only valid candidate string should reject with TypeError
    2323PASS Add candidate with invalid candidate string and both sdpMid and sdpMLineIndex null should reject with TypeError
    24 FAIL Add candidate with invalid sdpMid should reject with OperationError assert_unreached: Should have rejected: undefined Reached unreachable code
    25 FAIL Add candidate with invalid sdpMLineIndex should reject with OperationError assert_unreached: Should have rejected: undefined Reached unreachable code
     24PASS Add candidate with invalid sdpMid should reject with OperationError
     25PASS Add candidate with invalid sdpMLineIndex should reject with OperationError
    2626PASS Invalid sdpMLineIndex should be ignored if valid sdpMid is provided
    27 FAIL Add candidate for media stream 2 with null usernameFragment should succeed assert_true: Expect candidate line to be found after media line m=video expected true got false
     27PASS Add candidate for media stream 2 with null usernameFragment should succeed
    2828FAIL Add candidate with invalid usernameFragment should reject with OperationError assert_unreached: Should have rejected: undefined Reached unreachable code
    2929PASS Add candidate with invalid candidate string should reject with OperationError
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt

    r281631 r281981  
    2626PASS sender.getStats does NOT use the operations chain
    2727PASS receiver.getStats does NOT use the operations chain
    28 FAIL addIceCandidate chains onto SRD, fails before assert_equals: expected "InvalidStateError" but got "Error"
     28FAIL addIceCandidate chains onto SRD, fails before assert_equals: expected "InvalidStateError" but got "OperationError"
    2929FAIL Operations queue not vulnerable to recursion by chained negotiationneeded promise_test: Unhandled rejection with value: object "InvalidStateError: Remote description type 0 is incompatible with current signaling state 1"
    3030FAIL Pack operations queue with implicit offer and answer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare-linear.https-expected.txt

    r281631 r281981  
    11
    2 FAIL Perfect negotiation stress glare linear Remote description type 0 is incompatible with current signaling state 1
    3 FAIL Perfect negotiation stress glare linear with roles reversed assert_unreached: Error in iframe: InvalidStateError: Remote description type 0 is incompatible with current signaling state 1 Reached unreachable code
     2Harness Error (FAIL), message = Unhandled rejection: null is not an object (evaluating 'target.postMessage')
    43
     4FAIL Perfect negotiation stress glare linear Error processing ICE candidate
     5FAIL Perfect negotiation stress glare linear with roles reversed assert_unreached: Error in iframe: OperationError: Error processing ICE candidate Reached unreachable code
     6
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-perfect-negotiation-stress-glare.https-expected.txt

    r281631 r281981  
    11
    2 FAIL Perfect negotiation stress glare Remote description type 0 is incompatible with current signaling state 1
    3 FAIL Perfect negotiation stress glare with roles reversed assert_unreached: Error in iframe: InvalidStateError: Remote description type 0 is incompatible with current signaling state 1 Reached unreachable code
     2FAIL Perfect negotiation stress glare Error processing ICE candidate
     3FAIL Perfect negotiation stress glare with roles reversed assert_unreached: Error in iframe: OperationError: Error processing ICE candidate Reached unreachable code
    44
  • trunk/Source/WebCore/ChangeLog

    r281980 r281981  
     12021-09-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Migrate to latest libwebrtc AddIceCandidate
     4        https://bugs.webkit.org/show_bug.cgi?id=229700
     5
     6        Reviewed by Eric Carlson.
     7
     8        AddIceCandidate can now take a callback to return a RTCError which provides necessary information to reject the promise as needed.
     9        Update binding code accordingly.
     10        This allows to use a lambda that takes the promise instead of having the promise as a member of PeerConnectionBackend.
     11        Covered by updated and rebased tests.
     12
     13        * Modules/mediastream/PeerConnectionBackend.cpp:
     14        (WebCore::PeerConnectionBackend::addIceCandidate):
     15        (WebCore::PeerConnectionBackend::stop):
     16        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded): Deleted.
     17        (WebCore::PeerConnectionBackend::addIceCandidateFailed): Deleted.
     18        * Modules/mediastream/PeerConnectionBackend.h:
     19        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     20        (WebCore::LibWebRTCMediaEndpoint::addIceCandidate):
     21        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
     22        (WebCore::LibWebRTCMediaEndpoint::addIceCandidate): Deleted.
     23        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
     24        (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
     25        (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
     26        (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
     27        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
     28        * testing/MockLibWebRTCPeerConnection.h:
     29
    1302021-09-03  Said Abou-Hallawa  <said@apple.com>
    231
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

    r281926 r281981  
    349349    }
    350350
    351     m_addIceCandidatePromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
    352     doAddIceCandidate(*iceCandidate);
    353 }
    354 
    355 void PeerConnectionBackend::addIceCandidateSucceeded()
    356 {
    357     ASSERT(isMainThread());
    358     ALWAYS_LOG(LOGIDENTIFIER, "Adding ice candidate succeeded");
    359 
    360     ASSERT(m_addIceCandidatePromise);
    361     m_peerConnection.doTask([this, promise = WTFMove(m_addIceCandidatePromise)]() mutable {
    362         if (m_peerConnection.isClosed())
    363             return;
    364 
    365         promise->resolve();
    366     });
    367 }
    368 
    369 void PeerConnectionBackend::addIceCandidateFailed(Exception&& exception)
    370 {
    371     ASSERT(isMainThread());
    372     ALWAYS_LOG(LOGIDENTIFIER, "Adding ice candidate failed:", exception.message());
    373 
    374     ASSERT(m_addIceCandidatePromise);
    375     m_peerConnection.doTask([this, promise = WTFMove(m_addIceCandidatePromise), exception = WTFMove(exception)]() mutable {
    376         if (m_peerConnection.isClosed())
    377             return;
    378 
    379         promise->reject(WTFMove(exception));
     351    doAddIceCandidate(*iceCandidate, [weakThis = makeWeakPtr(this), promise = WTFMove(promise)](auto&& result) mutable {
     352        ASSERT(isMainThread());
     353        if (!weakThis)
     354            return;
     355        RELEASE_LOG_ERROR(WebRTC, "Adding ice candidate finished, success=%d", result.hasException());
     356        promise.settle(WTFMove(result));
    380357    });
    381358}
    … …  
    571548    m_offerAnswerPromise = nullptr;
    572549    m_setDescriptionPromise = nullptr;
    573     m_addIceCandidatePromise = nullptr;
    574550
    575551    m_pendingTrackEvents.clear();
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h

    r281926 r281981  
    223223    virtual void doSetLocalDescription(const RTCSessionDescription*) = 0;
    224224    virtual void doSetRemoteDescription(const RTCSessionDescription&) = 0;
    225     virtual void doAddIceCandidate(RTCIceCandidate&) = 0;
     225    virtual void doAddIceCandidate(RTCIceCandidate&, Function<void(ExceptionOr<void>&&)>&&) = 0;
    226226    virtual void endOfIceCandidates(DOMPromiseDeferred<void>&&);
    227227    virtual void doStop() = 0;
    … …  
    235235    std::unique_ptr<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
    236236    std::unique_ptr<DOMPromiseDeferred<void>> m_setDescriptionPromise;
    237     std::unique_ptr<DOMPromiseDeferred<void>> m_addIceCandidatePromise;
    238237
    239238    bool m_shouldFilterICECandidates { true };
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r281926 r281981  
    620620}
    621621
     622void LibWebRTCMediaEndpoint::addIceCandidate(std::unique_ptr<webrtc::IceCandidateInterface>&& candidate, std::function<void(webrtc::RTCError)>&& callback)
     623{
     624    m_backend->AddIceCandidate(WTFMove(candidate), WTFMove(callback));
     625}
     626
    622627void LibWebRTCMediaEndpoint::OnIceCandidate(const webrtc::IceCandidateInterface *rtcCandidate)
    623628{
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h

    r281926 r281981  
    9090    void getStats(webrtc::RtpSenderInterface&, Ref<DeferredPromise>&&);
    9191    std::unique_ptr<RTCDataChannelHandler> createDataChannel(const String&, const RTCDataChannelInit&);
    92     bool addIceCandidate(webrtc::IceCandidateInterface& candidate) { return m_backend->AddIceCandidate(&candidate); }
     92    void addIceCandidate(std::unique_ptr<webrtc::IceCandidateInterface>&&, std::function<void(webrtc::RTCError)>&&);
    9393
    9494    void close();
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp

    r281926 r281981  
    4848#include "RealtimeOutgoingVideoSource.h"
    4949#include "Settings.h"
     50#include <wtf/SharedTask.h>
    5051
    5152namespace WebCore {
    … …  
    236237{
    237238    m_endpoint->doSetLocalDescription(description);
    238     if (!m_isLocalDescriptionSet) {
    239         if (m_isRemoteDescriptionSet) {
    240             for (auto& candidate : m_pendingCandidates)
    241                 m_endpoint->addIceCandidate(*candidate);
    242             m_pendingCandidates.clear();
    243         }
    244         m_isLocalDescriptionSet = true;
    245     }
     239    m_isLocalDescriptionSet = true;
    246240}
    247241
    … …  
    249243{
    250244    m_endpoint->doSetRemoteDescription(description);
    251     if (!m_isRemoteDescriptionSet) {
    252         if (m_isLocalDescriptionSet) {
    253             for (auto& candidate : m_pendingCandidates)
    254                 m_endpoint->addIceCandidate(*candidate);
    255         }
    256         m_isRemoteDescriptionSet = true;
    257     }
     245    m_isRemoteDescriptionSet = true;
    258246}
    259247
    … …  
    283271}
    284272
    285 void LibWebRTCPeerConnectionBackend::doAddIceCandidate(RTCIceCandidate& candidate)
     273void LibWebRTCPeerConnectionBackend::doAddIceCandidate(RTCIceCandidate& candidate, Function<void(ExceptionOr<void>&&)>&& callback)
    286274{
    287275    webrtc::SdpParseError error;
    … …  
    290278
    291279    if (!rtcCandidate) {
    292         addIceCandidateFailed(Exception { OperationError, String::fromUTF8(error.description.data(), error.description.length()) });
     280        callback(Exception { OperationError, String::fromUTF8(error.description.data(), error.description.length()) });
    293281        return;
    294282    }
    295283
    296     // libwebrtc does not like that ice candidates are set before the description.
    297     if (!m_isLocalDescriptionSet || !m_isRemoteDescriptionSet)
    298         m_pendingCandidates.append(WTFMove(rtcCandidate));
    299     else if (!m_endpoint->addIceCandidate(*rtcCandidate.get())) {
    300         ASSERT_NOT_REACHED();
    301         addIceCandidateFailed(Exception { OperationError, "Failed to apply the received candidate"_s });
    302         return;
    303     }
    304     addIceCandidateSucceeded();
     284    m_endpoint->addIceCandidate(WTFMove(rtcCandidate), [task = createSharedTask<void(ExceptionOr<void>&&)>(WTFMove(callback))](auto&& error) mutable {
     285        callOnMainThread([task = WTFMove(task), error = WTFMove(error)] {
     286            if (!error.ok()) {
     287                task->run(toException(error));
     288                return;
     289            }
     290            task->run({ });
     291        });
     292    });
    305293}
    306294
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h

    r281926 r281981  
    6363    void doSetLocalDescription(const RTCSessionDescription*) final;
    6464    void doSetRemoteDescription(const RTCSessionDescription&) final;
    65     void doAddIceCandidate(RTCIceCandidate&) final;
     65    void doAddIceCandidate(RTCIceCandidate&, Function<void(ExceptionOr<void>&&)>&&) final;
    6666    void doStop() final;
    6767    std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final;
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h

    r281631 r281981  
    286286    const webrtc::SessionDescriptionInterface* remote_description() const override { return nullptr; }
    287287    bool AddIceCandidate(const webrtc::IceCandidateInterface*) override { return true; }
     288    void AddIceCandidate(std::unique_ptr<webrtc::IceCandidateInterface>, std::function<void(webrtc::RTCError)> callback) override { callback({ }); }
    288289    SignalingState signaling_state() override { return kStable; }
    289290    IceConnectionState ice_connection_state() override { return kIceConnectionNew; }
Note: See TracChangeset for help on using the changeset viewer.