Title: [208703] trunk/Source/WebCore
Revision
208703
Author
commit-qu...@webkit.org
Date
2016-11-14 13:05:42 -0800 (Mon, 14 Nov 2016)

Log Message

Move updateSignalingState to PeerConnectionBackend
https://bugs.webkit.org/show_bug.cgi?id=164719

Patch by Youenn Fablet <you...@apple.com> on 2016-11-14
Reviewed by Eric Carlson.

No change of behavior.

Refactoring MediaEndpointPeerConnection signaling state update to PeerConnectionBackend.
It is not specific to MediaEndpointPeerConnection and can be reused for other backends.

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
(WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::updateSignalingState):
* Modules/mediastream/PeerConnectionBackend.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208702 => 208703)


--- trunk/Source/WebCore/ChangeLog	2016-11-14 21:02:20 UTC (rev 208702)
+++ trunk/Source/WebCore/ChangeLog	2016-11-14 21:05:42 UTC (rev 208703)
@@ -1,3 +1,22 @@
+2016-11-14  Youenn Fablet  <you...@apple.com>
+
+        Move updateSignalingState to PeerConnectionBackend
+        https://bugs.webkit.org/show_bug.cgi?id=164719
+
+        Reviewed by Eric Carlson.
+
+        No change of behavior.
+
+        Refactoring MediaEndpointPeerConnection signaling state update to PeerConnectionBackend.
+        It is not specific to MediaEndpointPeerConnection and can be reused for other backends.
+
+        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
+        (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
+        (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::PeerConnectionBackend::updateSignalingState):
+        * Modules/mediastream/PeerConnectionBackend.h:
+
 2016-11-14  Dean Jackson  <d...@apple.com>
 
         Handle filter() image type in new CSS Parser

Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (208702 => 208703)


--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp	2016-11-14 21:02:20 UTC (rev 208702)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp	2016-11-14 21:05:42 UTC (rev 208703)
@@ -409,10 +409,7 @@
         break;
     }
 
-    if (newSignalingState != m_peerConnection.internalSignalingState()) {
-        m_peerConnection.setSignalingState(newSignalingState);
-        m_peerConnection.fireEvent(Event::create(eventNames().signalingstatechangeEvent, false, false));
-    }
+    updateSignalingState(newSignalingState);
 
     if (m_peerConnection.internalIceGatheringState() == IceGatheringState::New && mediaDescriptions.size())
         m_peerConnection.updateIceGatheringState(IceGatheringState::Gathering);
@@ -578,11 +575,7 @@
         break;
     }
 
-    if (newSignalingState != m_peerConnection.internalSignalingState()) {
-        m_peerConnection.setSignalingState(newSignalingState);
-        m_peerConnection.fireEvent(Event::create(eventNames().signalingstatechangeEvent, false, false));
-    }
-
+    updateSignalingState(newSignalingState);
     setRemoteDescriptionSucceeded();
 }
 

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (208702 => 208703)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2016-11-14 21:02:20 UTC (rev 208702)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2016-11-14 21:05:42 UTC (rev 208703)
@@ -34,6 +34,7 @@
 
 #if ENABLE(WEB_RTC)
 
+#include "EventNames.h"
 #include "JSRTCSessionDescription.h"
 #include "RTCIceCandidate.h"
 #include "RTCIceCandidateEvent.h"
@@ -276,6 +277,16 @@
     m_peerConnection.updateIceGatheringState(PeerConnectionStates::IceGatheringState::Complete);
 }
 
+void PeerConnectionBackend::updateSignalingState(PeerConnectionStates::SignalingState newSignalingState)
+{
+    ASSERT(isMainThread());
+
+    if (newSignalingState != m_peerConnection.internalSignalingState()) {
+        m_peerConnection.setSignalingState(newSignalingState);
+        m_peerConnection.fireEvent(Event::create(eventNames().signalingstatechangeEvent, false, false));
+    }
+}
+
 void PeerConnectionBackend::stop()
 {
     m_offerAnswerPromise = Nullopt;

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (208702 => 208703)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2016-11-14 21:02:20 UTC (rev 208702)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2016-11-14 21:05:42 UTC (rev 208703)
@@ -110,6 +110,8 @@
     void fireICECandidateEvent(RefPtr<RTCIceCandidate>&&);
     void doneGatheringCandidates();
 
+    void updateSignalingState(PeerConnectionStates::SignalingState);
+
     void createOfferSucceeded(String&&);
     void createOfferFailed(Exception&&);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to