Changeset 232943 in webkit


Ignore:
Timestamp:
Jun 18, 2018 1:48:07 PM (6 years ago)
Author:
youenn@apple.com
Message:

Expose RTCPeerConnectionIceEventInit constructor
https://bugs.webkit.org/show_bug.cgi?id=186770

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc/RTCPeerConnectionIceEvent-constructor-expected.txt:

Updated expectation as per patch.

  • web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:

Rebasing this file, changes are unrelated but test is marked as flaky.

Source/WebCore:

Add event constructor as per specification.
Add support for the url attribute.
For that purpose, we need to pipe that information from LibWebRTCMediaEndpoint
up to RTCPeerConnectionIceEvent.

Covered by rebased test.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::fireICECandidateEvent):
(WebCore::PeerConnectionBackend::disableICECandidateFiltering):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
(WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):

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

(WebCore::RTCPeerConnectionIceEvent::create):
(WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):

  • Modules/mediastream/RTCPeerConnectionIceEvent.h:

(WebCore::RTCPeerConnectionIceEvent::url const):

  • Modules/mediastream/RTCPeerConnectionIceEvent.idl:
  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):

  • bindings/js/WebCoreBuiltinNames.h:
  • dom/EventNames.in:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r232903 r232943  
     12018-06-18  Youenn Fablet  <youenn@apple.com>
     2
     3        Expose RTCPeerConnectionIceEventInit constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=186770
     5
     6        Reviewed by Alex Christensen.
     7
     8        * web-platform-tests/webrtc/RTCPeerConnectionIceEvent-constructor-expected.txt:
     9        Updated expectation as per patch.
     10        * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:
     11        Rebasing this file, changes are unrelated but test is marked as flaky.
     12
    1132018-06-16  Brendan McLoughlin  <brendan@bocoup.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnectionIceEvent-constructor-expected.txt

    r218181 r232943  
    11
    2 FAIL RTCPeerConnectionIceEvent with no arguments throws TypeError assert_throws: function "() => {
    3     new RTCPeerConnectionIceEvent();
    4   }" threw object "ReferenceError: Can't find variable: RTCPeerConnectionIceEvent" ("ReferenceError") expected object "TypeError" ("TypeError")
    5 FAIL RTCPeerConnectionIceEvent with no eventInitDict (default) Can't find variable: RTCPeerConnectionIceEvent
    6 FAIL RTCPeerConnectionIceEvent with empty object as eventInitDict (default) Can't find variable: RTCPeerConnectionIceEvent
    7 FAIL RTCPeerConnectionIceEvent.candidate is null when constructed with { candidate: null } Can't find variable: RTCPeerConnectionIceEvent
    8 FAIL RTCPeerConnectionIceEvent.candidate is null when constructed with { candidate: undefined } Can't find variable: RTCPeerConnectionIceEvent
    9 FAIL RTCPeerConnectionIceEvent with RTCIceCandidate Can't find variable: RTCPeerConnectionIceEvent
    10 FAIL RTCPeerConnectionIceEvent with non RTCIceCandidate object throws assert_throws: function "() => new RTCPeerConnectionIceEvent("type", { candidate: plain })" threw object "ReferenceError: Can't find variable: RTCPeerConnectionIceEvent" ("ReferenceError") expected object "TypeError" ("TypeError")
    11 FAIL RTCPeerConnectionIceEvent bubbles and cancelable Can't find variable: RTCPeerConnectionIceEvent
     2PASS RTCPeerConnectionIceEvent with no arguments throws TypeError
     3PASS RTCPeerConnectionIceEvent with no eventInitDict (default)
     4PASS RTCPeerConnectionIceEvent with empty object as eventInitDict (default)
     5PASS RTCPeerConnectionIceEvent.candidate is null when constructed with { candidate: null }
     6PASS RTCPeerConnectionIceEvent.candidate is null when constructed with { candidate: undefined }
     7PASS RTCPeerConnectionIceEvent with RTCIceCandidate
     8PASS RTCPeerConnectionIceEvent with non RTCIceCandidate object throws
     9PASS RTCPeerConnectionIceEvent bubbles and cancelable
    1210
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt

    r222307 r232943  
     1CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.createOffer on instances of RTCPeerConnection
     2CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.createAnswer on instances of RTCPeerConnection
     3CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.addIceCandidate on instances of RTCPeerConnection
     4CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.getStats on instances of RTCPeerConnection
     5CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
     6CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
     7CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Not enough arguments
    18Description
    29
    310This test verifies the availability of the RTCPeerConnection interface.
    411
     12
     13Harness Error (FAIL), message = Not enough arguments
    514
    615PASS EventTarget interface: existence and properties of interface object
     
    918PASS EventTarget interface: existence and properties of interface prototype object
    1019PASS EventTarget interface: existence and properties of interface prototype object's "constructor" property
     20PASS EventTarget interface: existence and properties of interface prototype object's @@unscopables property
    1121PASS RTCPeerConnection interface: existence and properties of interface object
    1222PASS RTCPeerConnection interface object length
     
    1424PASS RTCPeerConnection interface: existence and properties of interface prototype object
    1525PASS RTCPeerConnection interface: existence and properties of interface prototype object's "constructor" property
     26PASS RTCPeerConnection interface: existence and properties of interface prototype object's @@unscopables property
    1627PASS RTCPeerConnection interface: operation createOffer(RTCOfferOptions)
     28PASS Unscopable handled correctly for createOffer(RTCOfferOptions) on RTCPeerConnection
    1729PASS RTCPeerConnection interface: operation createAnswer(RTCAnswerOptions)
     30PASS Unscopable handled correctly for createAnswer(RTCAnswerOptions) on RTCPeerConnection
    1831FAIL RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription) assert_equals: property has wrong .length expected 1 but got 0
     32PASS Unscopable handled correctly for setLocalDescription(RTCSessionDescription) on RTCPeerConnection
    1933PASS RTCPeerConnection interface: attribute localDescription
     34PASS Unscopable handled correctly for localDescription property on RTCPeerConnection
    2035PASS RTCPeerConnection interface: attribute currentLocalDescription
     36PASS Unscopable handled correctly for currentLocalDescription property on RTCPeerConnection
    2137PASS RTCPeerConnection interface: attribute pendingLocalDescription
     38PASS Unscopable handled correctly for pendingLocalDescription property on RTCPeerConnection
    2239FAIL RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription) assert_equals: property has wrong .length expected 1 but got 0
     40PASS Unscopable handled correctly for setRemoteDescription(RTCSessionDescription) on RTCPeerConnection
    2341PASS RTCPeerConnection interface: attribute remoteDescription
     42PASS Unscopable handled correctly for remoteDescription property on RTCPeerConnection
    2443PASS RTCPeerConnection interface: attribute currentRemoteDescription
     44PASS Unscopable handled correctly for currentRemoteDescription property on RTCPeerConnection
    2545PASS RTCPeerConnection interface: attribute pendingRemoteDescription
     46PASS Unscopable handled correctly for pendingRemoteDescription property on RTCPeerConnection
    2647PASS RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate)
     48PASS Unscopable handled correctly for addIceCandidate(RTCIceCandidate) on RTCPeerConnection
    2749PASS RTCPeerConnection interface: attribute signalingState
     50PASS Unscopable handled correctly for signalingState property on RTCPeerConnection
    2851PASS RTCPeerConnection interface: attribute iceGatheringState
     52PASS Unscopable handled correctly for iceGatheringState property on RTCPeerConnection
    2953PASS RTCPeerConnection interface: attribute iceConnectionState
     54PASS Unscopable handled correctly for iceConnectionState property on RTCPeerConnection
    3055FAIL RTCPeerConnection interface: attribute canTrickleIceCandidates assert_true: The prototype object must have a property "canTrickleIceCandidates" expected true got false
     56PASS Unscopable handled correctly for canTrickleIceCandidates property on RTCPeerConnection
    3157PASS RTCPeerConnection interface: operation getConfiguration()
     58PASS Unscopable handled correctly for getConfiguration() on RTCPeerConnection
    3259PASS RTCPeerConnection interface: operation setConfiguration(RTCConfiguration)
     60PASS Unscopable handled correctly for setConfiguration(RTCConfiguration) on RTCPeerConnection
    3361PASS RTCPeerConnection interface: operation close()
     62PASS Unscopable handled correctly for close() on RTCPeerConnection
    3463PASS RTCPeerConnection interface: attribute onnegotiationneeded
     64PASS Unscopable handled correctly for onnegotiationneeded property on RTCPeerConnection
    3565PASS RTCPeerConnection interface: attribute onicecandidate
     66PASS Unscopable handled correctly for onicecandidate property on RTCPeerConnection
    3667PASS RTCPeerConnection interface: attribute onsignalingstatechange
     68PASS Unscopable handled correctly for onsignalingstatechange property on RTCPeerConnection
    3769PASS RTCPeerConnection interface: attribute oniceconnectionstatechange
     70PASS Unscopable handled correctly for oniceconnectionstatechange property on RTCPeerConnection
    3871PASS RTCPeerConnection interface: attribute onicegatheringstatechange
     72PASS Unscopable handled correctly for onicegatheringstatechange property on RTCPeerConnection
    3973FAIL RTCPeerConnection interface: operation createOffer(RTCSessionDescriptionCallback, RTCPeerConnectionErrorCallback, RTCOfferOptions) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
    4074            fn.apply(obj, args);
    4175        }" did not throw
     76PASS Unscopable handled correctly for createOffer(RTCSessionDescriptionCallback, RTCPeerConnectionErrorCallback, RTCOfferOptions) on RTCPeerConnection
    4277FAIL RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription, VoidFunction, RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 1 but got 0
     78PASS Unscopable handled correctly for setLocalDescription(RTCSessionDescription, VoidFunction, RTCPeerConnectionErrorCallback) on RTCPeerConnection
    4379FAIL RTCPeerConnection interface: operation createAnswer(RTCSessionDescriptionCallback, RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
    4480            fn.apply(obj, args);
    4581        }" did not throw
     82PASS Unscopable handled correctly for createAnswer(RTCSessionDescriptionCallback, RTCPeerConnectionErrorCallback) on RTCPeerConnection
    4683FAIL RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription, VoidFunction, RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 1 but got 0
     84PASS Unscopable handled correctly for setRemoteDescription(RTCSessionDescription, VoidFunction, RTCPeerConnectionErrorCallback) on RTCPeerConnection
    4785FAIL RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate, VoidFunction, RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
    4886            fn.apply(obj, args);
    4987        }" did not throw
     88PASS Unscopable handled correctly for addIceCandidate(RTCIceCandidate, VoidFunction, RTCPeerConnectionErrorCallback) on RTCPeerConnection
    5089FAIL RTCPeerConnection interface: operation getStats(MediaStreamTrack, RTCStatsCallback, RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
    5190            fn.apply(obj, args);
    5291        }" did not throw
     92PASS Unscopable handled correctly for getStats(MediaStreamTrack, RTCStatsCallback, RTCPeerConnectionErrorCallback) on RTCPeerConnection
    5393FAIL RTCPeerConnection interface: operation generateCertificate(AlgorithmIdentifier) assert_own_property: interface object missing static operation expected property "generateCertificate" missing
     94PASS Unscopable handled correctly for generateCertificate(AlgorithmIdentifier) on RTCPeerConnection
    5495PASS RTCPeerConnection interface: operation getSenders()
     96PASS Unscopable handled correctly for getSenders() on RTCPeerConnection
    5597PASS RTCPeerConnection interface: operation getReceivers()
     98PASS Unscopable handled correctly for getReceivers() on RTCPeerConnection
    5699PASS RTCPeerConnection interface: operation addTrack(MediaStreamTrack, MediaStream)
     100PASS Unscopable handled correctly for addTrack(MediaStreamTrack, MediaStream) on RTCPeerConnection
    57101PASS RTCPeerConnection interface: operation removeTrack(RTCRtpSender)
     102PASS Unscopable handled correctly for removeTrack(RTCRtpSender) on RTCPeerConnection
    58103PASS RTCPeerConnection interface: attribute ontrack
     104PASS Unscopable handled correctly for ontrack property on RTCPeerConnection
    59105PASS RTCPeerConnection interface: operation createDataChannel(DOMString, RTCDataChannelInit)
     106PASS Unscopable handled correctly for createDataChannel(DOMString, RTCDataChannelInit) on RTCPeerConnection
    60107PASS RTCPeerConnection interface: attribute ondatachannel
     108PASS Unscopable handled correctly for ondatachannel property on RTCPeerConnection
    61109FAIL RTCPeerConnection interface: attribute dtmf assert_true: The prototype object must have a property "dtmf" expected true got false
     110PASS Unscopable handled correctly for dtmf property on RTCPeerConnection
    62111PASS RTCPeerConnection interface: operation getStats(MediaStreamTrack)
     112PASS Unscopable handled correctly for getStats(MediaStreamTrack) on RTCPeerConnection
    63113FAIL RTCPeerConnection interface: operation setIdentityProvider(DOMString, DOMString, DOMString) assert_own_property: interface prototype object missing non-static operation expected property "setIdentityProvider" missing
     114PASS Unscopable handled correctly for setIdentityProvider(DOMString, DOMString, DOMString) on RTCPeerConnection
    64115FAIL RTCPeerConnection interface: operation getIdentityAssertion() assert_own_property: interface prototype object missing non-static operation expected property "getIdentityAssertion" missing
     116PASS Unscopable handled correctly for getIdentityAssertion() on RTCPeerConnection
    65117FAIL RTCPeerConnection interface: attribute peerIdentity assert_true: The prototype object must have a property "peerIdentity" expected true got false
     118PASS Unscopable handled correctly for peerIdentity property on RTCPeerConnection
    66119FAIL RTCPeerConnection interface: attribute idpLoginUrl assert_true: The prototype object must have a property "idpLoginUrl" expected true got false
     120PASS Unscopable handled correctly for idpLoginUrl property on RTCPeerConnection
    67121PASS RTCPeerConnection must be primary interface of pc
    68122PASS Stringification of pc
  • trunk/Source/WebCore/ChangeLog

    r232942 r232943  
     12018-06-18  Youenn Fablet  <youenn@apple.com>
     2
     3        Expose RTCPeerConnectionIceEventInit constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=186770
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add event constructor as per specification.
     9        Add support for the url attribute.
     10        For that purpose, we need to pipe that information from LibWebRTCMediaEndpoint
     11        up to RTCPeerConnectionIceEvent.
     12
     13        Covered by rebased test.
     14
     15        * Modules/mediastream/PeerConnectionBackend.cpp:
     16        (WebCore::PeerConnectionBackend::fireICECandidateEvent):
     17        (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
     18        (WebCore::PeerConnectionBackend::newICECandidate):
     19        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
     20        (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
     21        * Modules/mediastream/PeerConnectionBackend.h:
     22        * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
     23        (WebCore::RTCPeerConnectionIceEvent::create):
     24        (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
     25        * Modules/mediastream/RTCPeerConnectionIceEvent.h:
     26        (WebCore::RTCPeerConnectionIceEvent::url const):
     27        * Modules/mediastream/RTCPeerConnectionIceEvent.idl:
     28        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
     29        (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
     30        * bindings/js/WebCoreBuiltinNames.h:
     31        * dom/EventNames.in:
     32
    1332018-06-18  Simon Fraser  <simon.fraser@apple.com>
    234
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

    r231796 r232943  
    353353}
    354354
    355 void PeerConnectionBackend::fireICECandidateEvent(RefPtr<RTCIceCandidate>&& candidate)
    356 {
    357     ASSERT(isMainThread());
    358 
    359     m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, WTFMove(candidate)));
     355void PeerConnectionBackend::fireICECandidateEvent(RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
     356{
     357    ASSERT(isMainThread());
     358
     359    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, WTFMove(candidate), WTFMove(serverURL)));
    360360}
    361361
     
    369369    m_shouldFilterICECandidates = false;
    370370    for (auto& pendingICECandidate : m_pendingICECandidates)
    371         fireICECandidateEvent(RTCIceCandidate::create(WTFMove(pendingICECandidate.sdp), WTFMove(pendingICECandidate.mid), pendingICECandidate.sdpMLineIndex));
     371        fireICECandidateEvent(RTCIceCandidate::create(WTFMove(pendingICECandidate.sdp), WTFMove(pendingICECandidate.mid), pendingICECandidate.sdpMLineIndex), WTFMove(pendingICECandidate.serverURL));
    372372    m_pendingICECandidates.clear();
    373373}
     
    425425}
    426426
    427 void PeerConnectionBackend::newICECandidate(String&& sdp, String&& mid, unsigned short sdpMLineIndex)
     427void PeerConnectionBackend::newICECandidate(String&& sdp, String&& mid, unsigned short sdpMLineIndex, String&& serverURL)
    428428{
    429429    ALWAYS_LOG(LOGIDENTIFIER, "Gathered ice candidate:", sdp);
     
    431431
    432432    if (!m_shouldFilterICECandidates) {
    433         fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), sdpMLineIndex));
     433        fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL));
    434434        return;
    435435    }
    436436    if (sdp.find(" host ", 0) != notFound) {
    437437        // FIXME: We might need to clear all pending candidates when setting again local description.
    438         m_pendingICECandidates.append(PendingICECandidate { String { sdp }, WTFMove(mid), sdpMLineIndex});
     438        m_pendingICECandidates.append(PendingICECandidate { String { sdp }, WTFMove(mid), sdpMLineIndex, WTFMove(serverURL) });
    439439        if (RuntimeEnabledFeatures::sharedFeatures().mdnsICECandidatesEnabled()) {
    440440            auto ipAddress = extractIPAddres(sdp);
     
    445445        return;
    446446    }
    447     fireICECandidateEvent(RTCIceCandidate::create(filterICECandidate(WTFMove(sdp)), WTFMove(mid), sdpMLineIndex));
     447    fireICECandidateEvent(RTCIceCandidate::create(filterICECandidate(WTFMove(sdp)), WTFMove(mid), sdpMLineIndex), WTFMove(serverURL));
    448448}
    449449
     
    457457        return;
    458458
    459     m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, nullptr));
     459    m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, nullptr, { }));
    460460    m_peerConnection.updateIceGatheringState(RTCIceGatheringState::Complete);
    461461    m_pendingICECandidates.clear();
     
    488488            auto sdp = candidate.sdp;
    489489            sdp.replace(ipAddress, name);
    490             fireICECandidateEvent(RTCIceCandidate::create(String(sdp), String(candidate.mid), candidate.sdpMLineIndex));
     490            fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(candidate.mid), candidate.sdpMLineIndex), WTFMove(candidate.serverURL));
    491491            candidates.append(&candidate);
    492492        }
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h

    r230290 r232943  
    114114    virtual void emulatePlatformEvent(const String& action) = 0;
    115115
    116     void newICECandidate(String&& sdp, String&& mid, unsigned short sdpMLineIndex);
     116    void newICECandidate(String&& sdp, String&& mid, unsigned short sdpMLineIndex, String&& serverURL);
    117117    void disableICECandidateFiltering();
    118118    void enableICECandidateFiltering();
     
    132132
    133133protected:
    134     void fireICECandidateEvent(RefPtr<RTCIceCandidate>&&);
     134    void fireICECandidateEvent(RefPtr<RTCIceCandidate>&&, String&& url);
    135135    void doneGatheringCandidates();
    136136
     
    180180        String mid;
    181181        unsigned short sdpMLineIndex;
     182        String serverURL;
    182183    };
    183184    Vector<PendingICECandidate> m_pendingICECandidates;
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.cpp

    r223728 r232943  
    3333namespace WebCore {
    3434
    35 Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate)
     35Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
    3636{
    37     return adoptRef(*new RTCPeerConnectionIceEvent(canBubble, cancelable, WTFMove(candidate)));
     37    return adoptRef(*new RTCPeerConnectionIceEvent(eventNames().icecandidateEvent, canBubble, cancelable, WTFMove(candidate), WTFMove(serverURL)));
    3838}
    3939
    40 RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate)
    41     : Event(eventNames().icecandidateEvent, canBubble, cancelable)
     40Ref<RTCPeerConnectionIceEvent> RTCPeerConnectionIceEvent::create(const AtomicString& type, Init&& init)
     41{
     42    return adoptRef(*new RTCPeerConnectionIceEvent(type, init.bubbles, init.cancelable, WTFMove(init.candidate), WTFMove(init.url)));
     43}
     44
     45RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&& candidate, String&& serverURL)
     46    : Event(type, canBubble, cancelable)
    4247    , m_candidate(WTFMove(candidate))
     48    , m_url(WTFMove(serverURL))
    4349{
    4450}
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.h

    r214330 r232943  
    3737    virtual ~RTCPeerConnectionIceEvent();
    3838
    39     static Ref<RTCPeerConnectionIceEvent> create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&);
     39    struct Init : EventInit {
     40        RefPtr<RTCIceCandidate> candidate;
     41        String url;
     42    };
     43
     44    static Ref<RTCPeerConnectionIceEvent> create(const AtomicString& type, Init&&);
     45    static Ref<RTCPeerConnectionIceEvent> create(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
    4046
    4147    RTCIceCandidate* candidate() const;
     48    const String& url() const { return m_url; }
    4249
    4350    virtual EventInterface eventInterface() const;
    4451
    4552private:
    46     RTCPeerConnectionIceEvent(bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&);
     53    RTCPeerConnectionIceEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCIceCandidate>&&, String&& serverURL);
    4754
    4855    RefPtr<RTCIceCandidate> m_candidate;
     56    String m_url;
    4957};
    5058
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceEvent.idl

    r214330 r232943  
    2424 */
    2525
    26 // FIXME 169662: missing Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict)
     26dictionary RTCPeerConnectionIceEventInit : EventInit {
     27    RTCIceCandidate? candidate;
     28    DOMString? url;
     29};
     30
    2731[
    28     NoInterfaceObject,
    2932    Conditional=WEB_RTC,
     33    Constructor(DOMString type, optional RTCPeerConnectionIceEventInit eventInitDict),
    3034    EnabledAtRuntime=PeerConnection
    3135] interface RTCPeerConnectionIceEvent : Event {
    3236    readonly attribute RTCIceCandidate? candidate;
    33     // FIXME 169662: missing url
     37    readonly attribute DOMString? url;
    3438};
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp

    r231512 r232943  
    868868    auto sdpMLineIndex = safeCast<unsigned short>(rtcCandidate->sdp_mline_index());
    869869
    870     callOnMainThread([protectedThis = makeRef(*this), mid = fromStdString(rtcCandidate->sdp_mid()), sdp = fromStdString(sdp), sdpMLineIndex]() mutable {
    871         if (protectedThis->isStopped())
    872             return;
    873         protectedThis->m_peerConnectionBackend.newICECandidate(WTFMove(sdp), WTFMove(mid), sdpMLineIndex);
     870    callOnMainThread([protectedThis = makeRef(*this), mid = fromStdString(rtcCandidate->sdp_mid()), sdp = fromStdString(sdp), sdpMLineIndex, url = fromStdString(rtcCandidate->server_url())]() mutable {
     871        if (protectedThis->isStopped())
     872            return;
     873        protectedThis->m_peerConnectionBackend.newICECandidate(WTFMove(sdp), WTFMove(mid), sdpMLineIndex, WTFMove(url));
    874874    });
    875875}
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r231709 r232943  
    128128    macro(RTCIceTransport) \
    129129    macro(RTCPeerConnection) \
     130    macro(RTCPeerConnectionIceEvent) \
    130131    macro(RTCRtpReceiver) \
    131132    macro(RTCRtpSender) \
  • trunk/Source/WebCore/dom/EventNames.in

    r229112 r232943  
    5454RTCDataChannelEvent conditional=WEB_RTC
    5555RTCDTMFToneChangeEvent conditional=WEB_RTC_DTMF
     56RTCPeerConnectionIceEvent conditional=WEB_RTC
    5657RTCTrackEvent conditional=WEB_RTC
    5758SpeechSynthesisEvent conditional=SPEECH_SYNTHESIS
Note: See TracChangeset for help on using the changeset viewer.