Title: [270304] trunk
Revision
270304
Author
[email protected]
Date
2020-12-01 09:31:49 -0800 (Tue, 01 Dec 2020)

Log Message

REGRESSION(STP116): wpt.live/webrtc/RTCRtpTransceiver.https.html crashes on load
https://bugs.webkit.org/show_bug.cgi?id=219259

Reviewed by Eric Carlson.

Source/WebCore:

Make use of StopStandard instead of the old StopInternal method.
Covered by rebased tests.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addInternalTransceiver):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::setConnection):
(WebCore::RTCRtpTransceiver::stop):
* Modules/mediastream/RTCRtpTransceiver.h:
* Modules/mediastream/RTCRtpTransceiver.idl:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::LibWebRTCRtpTransceiverBackend::stop):

LayoutTests:

* TestExpectations: mark test as flaky, as identified by EWS and in results.webkit.org since resyncing WPT tests.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (270303 => 270304)


--- trunk/LayoutTests/ChangeLog	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/LayoutTests/ChangeLog	2020-12-01 17:31:49 UTC (rev 270304)
@@ -1,3 +1,12 @@
+2020-12-01  Youenn Fablet  <[email protected]>
+
+        REGRESSION(STP116): wpt.live/webrtc/RTCRtpTransceiver.https.html crashes on load
+        https://bugs.webkit.org/show_bug.cgi?id=219259
+
+        Reviewed by Eric Carlson.
+
+        * TestExpectations: mark test as flaky, as identified by EWS and in results.webkit.org since resyncing WPT tests.
+
 2020-12-01  Lauro Moura  <[email protected]>
 
         [GLIB] Skip http/wpt/webrtc/sframe-transform.html

Modified: trunk/LayoutTests/TestExpectations (270303 => 270304)


--- trunk/LayoutTests/TestExpectations	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/LayoutTests/TestExpectations	2020-12-01 17:31:49 UTC (rev 270304)
@@ -1963,6 +1963,7 @@
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-timing.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/webrtc/protocol/split.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce-onnegotiationneeded.https.html [ Pass Failure ]
+imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-candidate-in-sdp.https.html [ Pass Failure ]
 
 # Skip timing out test
 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-tracks.https.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (270303 => 270304)


--- trunk/Source/WebCore/ChangeLog	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/ChangeLog	2020-12-01 17:31:49 UTC (rev 270304)
@@ -1,5 +1,26 @@
 2020-12-01  Youenn Fablet  <[email protected]>
 
+        REGRESSION(STP116): wpt.live/webrtc/RTCRtpTransceiver.https.html crashes on load
+        https://bugs.webkit.org/show_bug.cgi?id=219259
+
+        Reviewed by Eric Carlson.
+
+        Make use of StopStandard instead of the old StopInternal method.
+        Covered by rebased tests.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::addInternalTransceiver):
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCRtpTransceiver.cpp:
+        (WebCore::RTCRtpTransceiver::setConnection):
+        (WebCore::RTCRtpTransceiver::stop):
+        * Modules/mediastream/RTCRtpTransceiver.h:
+        * Modules/mediastream/RTCRtpTransceiver.idl:
+        * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
+        (WebCore::LibWebRTCRtpTransceiverBackend::stop):
+
+2020-12-01  Youenn Fablet  <[email protected]>
+
         DedicatedWorkerGlobalScope should clear m_rtcRtpTransformerConstructorMap before destructor
         https://bugs.webkit.org/show_bug.cgi?id=219389
 

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2020-12-01 17:31:49 UTC (rev 270304)
@@ -596,9 +596,9 @@
     return hasEventListeners();
 }
 
-void RTCPeerConnection::addTransceiver(Ref<RTCRtpTransceiver>&& transceiver)
+void RTCPeerConnection::addInternalTransceiver(Ref<RTCRtpTransceiver>&& transceiver)
 {
-    INFO_LOG(LOGIDENTIFIER);
+    transceiver->setConnection(*this);
     m_transceiverSet->append(WTFMove(transceiver));
 }
 

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2020-12-01 17:31:49 UTC (rev 270304)
@@ -132,7 +132,7 @@
     bool isClosed() const { return m_connectionState == RTCPeerConnectionState::Closed; }
     bool isStopped() const { return m_isStopped; }
 
-    void addInternalTransceiver(Ref<RTCRtpTransceiver>&& transceiver) { m_transceiverSet->append(WTFMove(transceiver)); }
+    void addInternalTransceiver(Ref<RTCRtpTransceiver>&&);
 
     // 5.1 RTCPeerConnection extensions
     Vector<std::reference_wrapper<RTCRtpSender>> getSenders() const;
@@ -164,7 +164,6 @@
     WEBCORE_EXPORT void emulatePlatformEvent(const String& action);
 
     // API used by PeerConnectionBackend and relatives
-    void addTransceiver(Ref<RTCRtpTransceiver>&&);
     void setSignalingState(RTCSignalingState);
     void updateIceGatheringState(RTCIceGatheringState);
     void updateIceConnectionState(RTCIceConnectionState);

Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp	2020-12-01 17:31:49 UTC (rev 270304)
@@ -34,6 +34,7 @@
 
 #if ENABLE(WEB_RTC)
 
+#include "RTCPeerConnection.h"
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/NeverDestroyed.h>
 
@@ -98,15 +99,28 @@
         m_direction = RTCRtpTransceiverDirection::Inactive;
 }
 
-void RTCRtpTransceiver::stop()
+void RTCRtpTransceiver::setConnection(RTCPeerConnection& connection)
 {
+    ASSERT(!m_connection);
+    m_connection = makeWeakPtr(connection);
+}
+
+ExceptionOr<void> RTCRtpTransceiver::stop()
+{
+    if (!m_connection || m_connection->isClosed())
+        return Exception { InvalidStateError, "RTCPeerConnection is closed"_s };
+
     if (m_stopped)
-        return;
+        return { };
+
     m_stopped = true;
     m_receiver->stop();
     m_sender->stop();
     if (m_backend)
         m_backend->stop();
+
+    m_connection->scheduleNegotiationNeededEvent();
+    return { };
 }
 
 ExceptionOr<void> RTCRtpTransceiver::setCodecPreferences(const Vector<RTCRtpCodecCapability>& codecs)

Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h	2020-12-01 17:31:49 UTC (rev 270304)
@@ -45,6 +45,7 @@
 
 namespace WebCore {
 
+class RTCPeerConnection;
 struct RTCRtpCodecCapability;
 
 class RTCRtpTransceiver final : public RefCounted<RTCRtpTransceiver>, public ScriptWrappable {
@@ -66,7 +67,7 @@
     RTCRtpReceiver& receiver() { return m_receiver.get(); }
 
     bool stopped() const;
-    void stop();
+    ExceptionOr<void> stop();
     ExceptionOr<void> setCodecPreferences(const Vector<RTCRtpCodecCapability>&);
 
     // FIXME: Temporary solution to keep track of ICE states for this transceiver. Later, each
@@ -75,6 +76,7 @@
     RTCIceTransport& iceTransport() { return m_iceTransport.get(); }
 
     RTCRtpTransceiverBackend* backend() { return m_backend.get(); }
+    void setConnection(RTCPeerConnection&);
 
 private:
     RTCRtpTransceiver(Ref<RTCRtpSender>&&, Ref<RTCRtpReceiver>&&, std::unique_ptr<RTCRtpTransceiverBackend>&&);
@@ -88,6 +90,7 @@
 
     Ref<RTCIceTransport> m_iceTransport;
     std::unique_ptr<RTCRtpTransceiverBackend> m_backend;
+    WeakPtr<RTCPeerConnection> m_connection;
 };
 
 class RtpTransceiverSet {

Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl	2020-12-01 17:31:49 UTC (rev 270304)
@@ -42,6 +42,6 @@
     readonly attribute boolean stopped;
     attribute RtpTransceiverDirection direction;
     readonly attribute RTCRtpTransceiverDirection? currentDirection;
-    undefined stop();
+    [MayThrowException] undefined stop();
     [MayThrowException] undefined setCodecPreferences(sequence<RTCRtpCodecCapability> codecs);
 };

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp (270303 => 270304)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp	2020-12-01 17:30:19 UTC (rev 270303)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp	2020-12-01 17:31:49 UTC (rev 270304)
@@ -73,8 +73,7 @@
 
 void LibWebRTCRtpTransceiverBackend::stop()
 {
-    // FIXME: Use StopStandard.
-    m_rtcTransceiver->StopInternal();
+    m_rtcTransceiver->StopStandard();
 }
 
 bool LibWebRTCRtpTransceiverBackend::stopped() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to