Title: [216066] trunk/Source/WebCore
Revision
216066
Author
commit-qu...@webkit.org
Date
2017-05-02 01:55:43 -0700 (Tue, 02 May 2017)

Log Message

Adding logging to RTCPeerConnection to allow WebRTC application debugging
https://bugs.webkit.org/show_bug.cgi?id=171531

Patch by Youenn Fablet <you...@apple.com> on 2017-05-02
Reviewed by Jon Lee.

No change of behavior.
This allows easier debugging of webrtc-enabled web pages.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::newICECandidate):
(WebCore::PeerConnectionBackend::doneGatheringCandidates):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::queuedCreateOffer):
(WebCore::RTCPeerConnection::queuedCreateAnswer):
(WebCore::RTCPeerConnection::queuedSetLocalDescription):
(WebCore::RTCPeerConnection::queuedSetRemoteDescription):
(WebCore::RTCPeerConnection::queuedAddIceCandidate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (216065 => 216066)


--- trunk/Source/WebCore/ChangeLog	2017-05-02 08:48:10 UTC (rev 216065)
+++ trunk/Source/WebCore/ChangeLog	2017-05-02 08:55:43 UTC (rev 216066)
@@ -1,3 +1,33 @@
+2017-05-02  Youenn Fablet  <you...@apple.com>
+
+        Adding logging to RTCPeerConnection to allow WebRTC application debugging
+        https://bugs.webkit.org/show_bug.cgi?id=171531
+
+        Reviewed by Jon Lee.
+
+        No change of behavior.
+        This allows easier debugging of webrtc-enabled web pages.
+
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::PeerConnectionBackend::createOfferSucceeded):
+        (WebCore::PeerConnectionBackend::createOfferFailed):
+        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
+        (WebCore::PeerConnectionBackend::createAnswerFailed):
+        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
+        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
+        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
+        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
+        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
+        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
+        (WebCore::PeerConnectionBackend::newICECandidate):
+        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::queuedCreateOffer):
+        (WebCore::RTCPeerConnection::queuedCreateAnswer):
+        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
+        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
+        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
+
 2017-04-12  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Crash at WebCore::ResourceHandle::clearClient() when streaming live video from dailymotion

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (216065 => 216066)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2017-05-02 08:48:10 UTC (rev 216065)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2017-05-02 08:55:43 UTC (rev 216066)
@@ -36,6 +36,7 @@
 
 #include "EventNames.h"
 #include "JSRTCSessionDescription.h"
+#include "Logging.h"
 #include "RTCIceCandidate.h"
 #include "RTCPeerConnection.h"
 #include "RTCPeerConnectionIceEvent.h"
@@ -55,6 +56,7 @@
 void PeerConnectionBackend::createOfferSucceeded(String&& sdp)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Creating offer succeeded:\n%s\n", sdp.utf8().data());
 
     if (m_peerConnection.isClosed())
         return;
@@ -67,6 +69,7 @@
 void PeerConnectionBackend::createOfferFailed(Exception&& exception)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Creating offer failed:\n%s\n", exception.message().utf8().data());
 
     if (m_peerConnection.isClosed())
         return;
@@ -88,7 +91,8 @@
 void PeerConnectionBackend::createAnswerSucceeded(String&& sdp)
 {
     ASSERT(isMainThread());
-
+    LOG(WebRTC, "Creating answer succeeded:\n%s\n", sdp.utf8().data());
+    
     if (m_peerConnection.isClosed())
         return;
 
@@ -100,6 +104,7 @@
 void PeerConnectionBackend::createAnswerFailed(Exception&& exception)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Creating answer failed:\n%s\n", exception.message().utf8().data());
 
     if (m_peerConnection.isClosed())
         return;
@@ -144,6 +149,7 @@
 void PeerConnectionBackend::setLocalDescriptionSucceeded()
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Setting local description succeeded\n");
 
     if (m_peerConnection.isClosed())
         return;
@@ -157,6 +163,7 @@
 void PeerConnectionBackend::setLocalDescriptionFailed(Exception&& exception)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Setting local description failed:\n%s\n", exception.message().utf8().data());
 
     if (m_peerConnection.isClosed())
         return;
@@ -202,6 +209,7 @@
 void PeerConnectionBackend::setRemoteDescriptionSucceeded()
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Setting remote description succeeded\n");
 
     if (m_peerConnection.isClosed())
         return;
@@ -215,6 +223,7 @@
 void PeerConnectionBackend::setRemoteDescriptionFailed(Exception&& exception)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Setting remote description failed:\n%s\n", exception.message().utf8().data());
 
     if (m_peerConnection.isClosed())
         return;
@@ -246,6 +255,7 @@
 void PeerConnectionBackend::addIceCandidateSucceeded()
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Adding ice candidate succeeded\n");
 
     if (m_peerConnection.isClosed())
         return;
@@ -260,6 +270,8 @@
 void PeerConnectionBackend::addIceCandidateFailed(Exception&& exception)
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Adding ice candidate failed:\n%s\n", exception.message().utf8().data());
+
     if (m_peerConnection.isClosed())
         return;
 
@@ -322,6 +334,8 @@
 
 void PeerConnectionBackend::newICECandidate(String&& sdp, String&& mid)
 {
+    LOG(WebRTC, "Gathered ice candidate:\n%s\n", sdp.utf8().data());
+
     if (!m_shouldFilterICECandidates) {
         fireICECandidateEvent(RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), 0));
         return;
@@ -336,6 +350,7 @@
 void PeerConnectionBackend::doneGatheringCandidates()
 {
     ASSERT(isMainThread());
+    LOG(WebRTC, "Finished ice candidate gathering\n");
 
     m_peerConnection.fireEvent(RTCPeerConnectionIceEvent::create(false, false, nullptr));
     m_peerConnection.updateIceGatheringState(RTCIceGatheringState::Complete);

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (216065 => 216066)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-05-02 08:48:10 UTC (rev 216065)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-05-02 08:55:43 UTC (rev 216066)
@@ -40,6 +40,7 @@
 #include "Event.h"
 #include "EventNames.h"
 #include "Frame.h"
+#include "Logging.h"
 #include "MediaEndpointConfiguration.h"
 #include "MediaStream.h"
 #include "MediaStreamTrack.h"
@@ -213,6 +214,7 @@
 
 void RTCPeerConnection::queuedCreateOffer(RTCOfferOptions&& options, SessionDescriptionPromise&& promise)
 {
+    LOG(WebRTC, "Creating offer\n");
     if (isClosed()) {
         promise.reject(INVALID_STATE_ERR);
         return;
@@ -223,6 +225,7 @@
 
 void RTCPeerConnection::queuedCreateAnswer(RTCAnswerOptions&& options, SessionDescriptionPromise&& promise)
 {
+    LOG(WebRTC, "Creating answer\n");
     if (isClosed()) {
         promise.reject(INVALID_STATE_ERR);
         return;
@@ -233,6 +236,7 @@
 
 void RTCPeerConnection::queuedSetLocalDescription(RTCSessionDescription& description, DOMPromise<void>&& promise)
 {
+    LOG(WebRTC, "Setting local description:\n%s\n", description.sdp().utf8().data());
     if (isClosed()) {
         promise.reject(INVALID_STATE_ERR);
         return;
@@ -258,11 +262,12 @@
 
 void RTCPeerConnection::queuedSetRemoteDescription(RTCSessionDescription& description, DOMPromise<void>&& promise)
 {
+    LOG(WebRTC, "Setting remote description:\n%s\n", description.sdp().utf8().data());
+
     if (isClosed()) {
         promise.reject(INVALID_STATE_ERR);
         return;
     }
-
     m_backend->setRemoteDescription(description, WTFMove(promise));
 }
 
@@ -283,6 +288,8 @@
 
 void RTCPeerConnection::queuedAddIceCandidate(RTCIceCandidate* rtcCandidate, DOMPromise<void>&& promise)
 {
+    LOG(WebRTC, "Received ice candidate:\n%s\n", rtcCandidate ? rtcCandidate->candidate().utf8().data() : "null");
+
     if (isClosed()) {
         promise.reject(INVALID_STATE_ERR);
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to