Title: [274633] releases/WebKitGTK/webkit-2.30
Revision
274633
Author
[email protected]
Date
2021-03-18 04:04:09 -0700 (Thu, 18 Mar 2021)

Log Message

Merge r270101 - Add support for RTCPeerConnection.onicecandidateerror event
https://bugs.webkit.org/show_bug.cgi?id=169644

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/idlharness.https.window-expected.txt:

Source/WebCore:

Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs.
For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary.

Covered by updated webrtc/stun-server-filtering.html test.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::iceServersFromConfiguration):
(WebCore::iceServersFromConfiguration): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added.
(WebCore::RTCPeerConnectionIceErrorEvent::create):
(WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent):
(WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const):
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added.
* Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.h:
* dom/EventNames.in:

LayoutTests:

* webrtc/rtcpeerconnection-error-messages-expected.txt:
* webrtc/stun-server-filtering.html:

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog	2021-03-18 11:04:09 UTC (rev 274633)
@@ -1,3 +1,13 @@
+2020-11-20  Youenn Fablet  <[email protected]>
+
+        Add support for RTCPeerConnection.onicecandidateerror event
+        https://bugs.webkit.org/show_bug.cgi?id=169644
+
+        Reviewed by Alex Christensen.
+
+        * webrtc/rtcpeerconnection-error-messages-expected.txt:
+        * webrtc/stun-server-filtering.html:
+
 2020-12-11  Fujii Hironori  <[email protected]>
 
         [TextureMapper] REGRESION(r269570): mask layer doesn't clip descendent layers

Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/imported/w3c/ChangeLog	2021-03-18 11:04:09 UTC (rev 274633)
@@ -1,3 +1,12 @@
+2020-11-20  Youenn Fablet  <[email protected]>
+
+        Add support for RTCPeerConnection.onicecandidateerror event
+        https://bugs.webkit.org/show_bug.cgi?id=169644
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/webrtc/idlharness.https.window-expected.txt:
+
 2020-11-05  Youenn Fablet  <[email protected]>
 
         Consider blocking ports 5060 and 5061

Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/rtcpeerconnection-error-messages-expected.txt	2021-03-18 11:04:09 UTC (rev 274633)
@@ -15,7 +15,7 @@
 TypeError: Can only call RTCPeerConnection.close on instances of RTCPeerConnection
 TypeError: The RTCPeerConnection.onnegotiationneeded getter can only be used on instances of RTCPeerConnection
 TypeError: The RTCPeerConnection.onicecandidate getter can only be used on instances of RTCPeerConnection
-[object RTCPeerConnection] has no property named onicecandidateerror
+TypeError: The RTCPeerConnection.onicecandidateerror getter can only be used on instances of RTCPeerConnection
 TypeError: The RTCPeerConnection.onsignalingstatechange getter can only be used on instances of RTCPeerConnection
 TypeError: The RTCPeerConnection.oniceconnectionstatechange getter can only be used on instances of RTCPeerConnection
 TypeError: The RTCPeerConnection.onicegatheringstatechange getter can only be used on instances of RTCPeerConnection

Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/stun-server-filtering.html (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/stun-server-filtering.html	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/webrtc/stun-server-filtering.html	2021-03-18 11:04:09 UTC (rev 274633)
@@ -2,19 +2,29 @@
 <script src=''></script>
 <script src=''></script>
 <script>
-test((test) => {
+promise_test(async (test) => {
     let pc = new RTCPeerConnection({iceServers:[{urls:['stun:foo.com', 'stun:blabla.local']}]});
+    let promise = new Promise(resolve => pc._onicecandidateerror_ = resolve);
     let configuration = pc.getConfiguration();
 
     assert_equals(configuration.iceServers[0].urls.length, 1);
     assert_equals(configuration.iceServers[0].urls[0], 'stun:foo.com');
+
+    const event = await promise;
+    assert_equals(event.url, 'stun:blabla.local');
+    assert_equals(event.errorCode, 701);
 }, "RTCPeerConnection and local STUN server");
 
-test((test) => {
+promise_test(async (test) => {
     let pc = new RTCPeerConnection({iceServers:[{username: 'test', credential: 'test', urls:['turn:foo.com', 'turn:blabla.local']}]});
+    let promise = new Promise(resolve => pc._onicecandidateerror_ = resolve);
     let configuration = pc.getConfiguration();
 
     assert_equals(configuration.iceServers[0].urls.length, 1);
     assert_equals(configuration.iceServers[0].urls[0], 'turn:foo.com');
+
+    const event = await promise;
+    assert_equals(event.url, 'turn:blabla.local');
+    assert_equals(event.errorCode, 701);
 }, "RTCPeerConnection and local TURN server");
 </script>

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/CMakeLists.txt (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/CMakeLists.txt	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/CMakeLists.txt	2021-03-18 11:04:09 UTC (rev 274633)
@@ -370,6 +370,7 @@
     Modules/mediastream/RTCOfferAnswerOptions.idl
     Modules/mediastream/RTCOfferOptions.idl
     Modules/mediastream/RTCPeerConnection.idl
+    Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl
     Modules/mediastream/RTCPeerConnectionIceEvent.idl
     Modules/mediastream/RTCPeerConnectionState.idl
     Modules/mediastream/RTCPriorityType.idl

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog	2021-03-18 11:04:09 UTC (rev 274633)
@@ -1,3 +1,36 @@
+2020-11-20  Youenn Fablet  <[email protected]>
+
+        Add support for RTCPeerConnection.onicecandidateerror event
+        https://bugs.webkit.org/show_bug.cgi?id=169644
+
+        Reviewed by Alex Christensen.
+
+        Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs.
+        For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary.
+
+        Covered by updated webrtc/stun-server-filtering.html test.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::iceServersFromConfiguration):
+        (WebCore::iceServersFromConfiguration): Deleted.
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl:
+        * Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added.
+        (WebCore::RTCPeerConnectionIceErrorEvent::create):
+        (WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent):
+        (WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const):
+        * Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added.
+        * Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added.
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.h:
+        * dom/EventNames.in:
+
 2020-09-18  Chris Dumez  <[email protected]>
 
         Crash under WebCore::shouldResetFocusNavigationStartingNode()

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-input.xcfilelist (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-input.xcfilelist	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-input.xcfilelist	2021-03-18 11:04:09 UTC (rev 274633)
@@ -200,6 +200,7 @@
 $(PROJECT_DIR)/Modules/mediastream/RTCOfferOptions.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnection.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnection.js
+$(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionIceEvent.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionInternals.js
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnectionState.idl

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-output.xcfilelist (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-output.xcfilelist	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources-output.xcfilelist	2021-03-18 11:04:09 UTC (rev 274633)
@@ -1430,6 +1430,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferOptions.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnection.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnection.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceErrorEvent.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceErrorEvent.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceEvent.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionIceEvent.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCPeerConnectionState.cpp

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources.make (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources.make	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/DerivedSources.make	2021-03-18 11:04:09 UTC (rev 274633)
@@ -300,6 +300,7 @@
     $(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
     $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
     $(WebCore)/Modules/mediastream/RTCPeerConnectionIceEvent.idl \
+    $(WebCore)/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl \
     $(WebCore)/Modules/mediastream/RTCPeerConnectionState.idl \
     $(WebCore)/Modules/mediastream/RTCPriorityType.idl \
     $(WebCore)/Modules/mediastream/RTCRtpCapabilities.idl \

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2021-03-18 11:04:09 UTC (rev 274633)
@@ -51,6 +51,7 @@
 #include "RTCController.h"
 #include "RTCDataChannel.h"
 #include "RTCIceCandidate.h"
+#include "RTCPeerConnectionIceErrorEvent.h"
 #include "RTCPeerConnectionIceEvent.h"
 #include "RTCSessionDescription.h"
 #include "Settings.h"
@@ -279,7 +280,7 @@
 }
 
 // Implementation of https://w3c.github.io/webrtc-pc/#set-pc-configuration
-static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet)
+ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> RTCPeerConnection::iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet)
 {
     if (existingConfiguration && newConfiguration.bundlePolicy != existingConfiguration->bundlePolicy)
         return Exception { InvalidModificationError, "BundlePolicy does not match existing policy" };
@@ -301,8 +302,13 @@
                 urls = WTFMove(vector);
             });
 
-            urls.removeAllMatching([](auto& url) {
-                return URL { URL { }, url }.path().endsWithIgnoringASCIICase(".local");
+            urls.removeAllMatching([&](auto& urlString) {
+                URL url { URL { }, urlString };
+                if (url.path().endsWithIgnoringASCIICase(".local") || !portAllowed(url)) {
+                    queueTaskToDispatchEvent(*this, TaskSource::MediaElement, RTCPeerConnectionIceErrorEvent::create(Event::CanBubble::No, Event::IsCancelable::No, { }, { }, WTFMove(urlString), 701, "URL is not allowed"_s));
+                    return true;
+                }
+                return false;
             });
 
             auto serverURLs = WTF::map(urls, [](auto& url) -> URL {

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2021-03-18 11:04:09 UTC (rev 274633)
@@ -217,6 +217,8 @@
 
     ExceptionOr<Vector<MediaEndpointConfiguration::CertificatePEM>> certificatesFromConfiguration(const RTCConfiguration&);
 
+    ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet);
+
     bool m_isStopped { false };
     RTCSignalingState m_signalingState { RTCSignalingState::Stable };
     RTCIceGatheringState m_iceGatheringState { RTCIceGatheringState::New };

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl	2021-03-18 11:04:09 UTC (rev 274633)
@@ -116,7 +116,7 @@
     attribute EventHandler oniceconnectionstatechange;
     attribute EventHandler onicegatheringstatechange;
     attribute EventHandler onconnectionstatechange;
-    // FIXME 169644: missing onfingerprintfailure and onicecandidateerror
+    attribute EventHandler onicecandidateerror;
 
     // Private API used to implement the overloaded operations above. Queued functions are called by runQueuedOperation().
     // See RTCPeerConnectionInternals.js.

Added: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp (0 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp	2021-03-18 11:04:09 UTC (rev 274633)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RTCPeerConnectionIceErrorEvent.h"
+
+#if ENABLE(WEB_RTC)
+
+#include "EventNames.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(RTCPeerConnectionIceErrorEvent);
+
+Ref<RTCPeerConnectionIceErrorEvent> RTCPeerConnectionIceErrorEvent::create(CanBubble canBubble, IsCancelable isCancelable, String&& address, Optional<uint16_t> port, String&& url, uint16_t errorCode, String&& errorText)
+{
+    return adoptRef(*new RTCPeerConnectionIceErrorEvent(eventNames().icecandidateerrorEvent, canBubble, isCancelable, WTFMove(address), port, WTFMove(url), errorCode, WTFMove(errorText)));
+}
+
+Ref<RTCPeerConnectionIceErrorEvent> RTCPeerConnectionIceErrorEvent::create(const AtomString& type, Init&& init)
+{
+    return adoptRef(*new RTCPeerConnectionIceErrorEvent(type, init.bubbles ? CanBubble::Yes : CanBubble::No,
+        init.cancelable ? IsCancelable::Yes : IsCancelable::No, WTFMove(init.address), init.port, WTFMove(init.url), WTFMove(init.errorCode), WTFMove(init.errorText)));
+}
+
+RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent(const AtomString& type, CanBubble canBubble, IsCancelable cancelable, String&& address, Optional<uint16_t> port, String&& url, uint16_t errorCode, String&& errorText)
+    : Event(type, canBubble, cancelable)
+    , m_address(WTFMove(address))
+    , m_port(port)
+    , m_url(WTFMove(url))
+    , m_errorCode(errorCode)
+    , m_errorText(WTFMove(errorText))
+{
+}
+
+RTCPeerConnectionIceErrorEvent::~RTCPeerConnectionIceErrorEvent() = default;
+
+EventInterface RTCPeerConnectionIceErrorEvent::eventInterface() const
+{
+    return RTCPeerConnectionIceErrorEventInterfaceType;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)

Added: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.h (0 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.h	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.h	2021-03-18 11:04:09 UTC (rev 274633)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+#include "Event.h"
+#include <wtf/Optional.h>
+#include <wtf/text/AtomString.h>
+
+namespace WebCore {
+class RTCIceCandidate;
+
+class RTCPeerConnectionIceErrorEvent final : public Event {
+    WTF_MAKE_ISO_ALLOCATED(RTCPeerConnectionIceErrorEvent);
+public:
+    virtual ~RTCPeerConnectionIceErrorEvent();
+
+    struct Init : EventInit {
+        String address;
+        Optional<uint16_t> port;
+        String url;
+        uint16_t errorCode { 0 };
+        String errorText;
+    };
+
+    static Ref<RTCPeerConnectionIceErrorEvent> create(const AtomString& type, Init&&);
+    static Ref<RTCPeerConnectionIceErrorEvent> create(CanBubble, IsCancelable, String&& address, Optional<uint16_t> port, String&& url, uint16_t errorCode, String&& errorText);
+
+    const String& address() const { return m_address; }
+    Optional<uint16_t> port() const { return m_port; }
+    const String& url() const { return m_url; }
+    uint16_t errorCode() const { return m_errorCode; }
+    const String& errorText() const { return m_errorText; }
+
+    virtual EventInterface eventInterface() const;
+
+private:
+    RTCPeerConnectionIceErrorEvent(const AtomString& type, CanBubble, IsCancelable, String&& address, Optional<uint16_t> port, String&& url, uint16_t errorCode, String&& errorText);
+
+    String m_address;
+    Optional<uint16_t> m_port;
+    String m_url;
+    uint16_t m_errorCode { 0 };
+    String m_errorText;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)

Added: releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl (0 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl	2021-03-18 11:04:09 UTC (rev 274633)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary RTCPeerConnectionIceErrorEventInit : EventInit {
+    DOMString? address;
+    unsigned short? port;
+    DOMString url;
+    required unsigned short errorCode;
+    USVString errorText;
+};
+
+[
+    Conditional=WEB_RTC,
+    EnabledAtRuntime=PeerConnection,
+    Exposed=Window
+] interface RTCPeerConnectionIceErrorEvent : Event {
+    constructor(DOMString type, RTCPeerConnectionIceErrorEventInit eventInitDict);
+
+    readonly attribute DOMString? address;
+    readonly attribute unsigned short? port;
+    readonly attribute DOMString url;
+    readonly attribute unsigned short errorCode;
+    readonly attribute USVString errorText;
+};

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/Sources.txt (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/Sources.txt	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/Sources.txt	2021-03-18 11:04:09 UTC (rev 274633)
@@ -161,6 +161,7 @@
 Modules/mediastream/RTCIceTransport.cpp
 Modules/mediastream/RTCPeerConnection.cpp
 Modules/mediastream/RTCPeerConnectionIceEvent.cpp
+Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp
 Modules/mediastream/RTCRtpReceiver.cpp
 Modules/mediastream/RTCRtpSender.cpp
 Modules/mediastream/RTCRtpTransceiver.cpp
@@ -3231,6 +3232,7 @@
 JSRTCOfferOptions.cpp
 JSRTCPeerConnection.cpp
 JSRTCPeerConnectionIceEvent.cpp
+JSRTCPeerConnectionIceErrorEvent.cpp
 JSRTCPeerConnectionState.cpp
 JSRTCPriorityType.cpp
 JSRTCRtpCapabilities.cpp

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2021-03-18 11:04:09 UTC (rev 274633)
@@ -208,6 +208,7 @@
     macro(RTCIceTransport) \
     macro(RTCPeerConnection) \
     macro(RTCPeerConnectionIceEvent) \
+    macro(RTCPeerConnectionIceErrorEvent) \
     macro(RTCRtpReceiver) \
     macro(RTCRtpSender) \
     macro(RTCRtpTransceiver) \

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.h (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.h	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.h	2021-03-18 11:04:09 UTC (rev 274633)
@@ -144,6 +144,7 @@
     macro(gotpointercapture) \
     macro(hashchange) \
     macro(icecandidate) \
+    macro(icecandidateerror) \
     macro(iceconnectionstatechange) \
     macro(icegatheringstatechange) \
     macro(inactive) \

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.in (274632 => 274633)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.in	2021-03-18 11:03:56 UTC (rev 274632)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/dom/EventNames.in	2021-03-18 11:04:09 UTC (rev 274633)
@@ -57,10 +57,10 @@
 MerchantValidationEvent conditional=PAYMENT_REQUEST
 PaymentMethodChangeEvent conditional=PAYMENT_REQUEST
 PaymentRequestUpdateEvent conditional=PAYMENT_REQUEST
+RTCPeerConnectionIceErrorEvent conditional=WEB_RTC
 RTCPeerConnectionIceEvent conditional=WEB_RTC
 RTCDataChannelEvent conditional=WEB_RTC
 RTCDTMFToneChangeEvent conditional=WEB_RTC
-RTCPeerConnectionIceEvent conditional=WEB_RTC
 RTCTrackEvent conditional=WEB_RTC
 SpeechSynthesisEvent conditional=SPEECH_SYNTHESIS
 WebGLContextEvent conditional=WEBGL
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to