Title: [269150] trunk/Source/WebKit
Revision
269150
Author
[email protected]
Date
2020-10-29 09:20:31 -0700 (Thu, 29 Oct 2020)

Log Message

Improve LibWebRTCSocketClient logging
https://bugs.webkit.org/show_bug.cgi?id=218336

Reviewed by Eric Carlson.

Output webrtc socket identifier in case of error.
Fix the case of LibWebRTCSocketClient::sendTo that can log too much.

No observable change of behavior.

* NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
(WebKit::LibWebRTCSocketClient::sendTo):
(WebKit::LibWebRTCSocketClient::close):
(WebKit::LibWebRTCSocketClient::setOption):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (269149 => 269150)


--- trunk/Source/WebKit/ChangeLog	2020-10-29 15:51:07 UTC (rev 269149)
+++ trunk/Source/WebKit/ChangeLog	2020-10-29 16:20:31 UTC (rev 269150)
@@ -1,3 +1,20 @@
+2020-10-29  Youenn Fablet  <[email protected]>
+
+        Improve LibWebRTCSocketClient logging
+        https://bugs.webkit.org/show_bug.cgi?id=218336
+
+        Reviewed by Eric Carlson.
+
+        Output webrtc socket identifier in case of error.
+        Fix the case of LibWebRTCSocketClient::sendTo that can log too much.
+
+        No observable change of behavior.
+
+        * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
+        (WebKit::LibWebRTCSocketClient::sendTo):
+        (WebKit::LibWebRTCSocketClient::close):
+        (WebKit::LibWebRTCSocketClient::setOption):
+
 2020-10-29  Chris Lord  <[email protected]>
 
         [GTK] Smooth scrolling should not apply to continuous scrolling with sync scrolling

Modified: trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp (269149 => 269150)


--- trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp	2020-10-29 15:51:07 UTC (rev 269149)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp	2020-10-29 16:20:31 UTC (rev 269150)
@@ -72,9 +72,10 @@
 
 void LibWebRTCSocketClient::sendTo(const uint8_t* data, size_t size, const rtc::SocketAddress& socketAddress, const rtc::PacketOptions& options)
 {
-    auto result = m_socket->SendTo(data, size, socketAddress, options);
-    RELEASE_LOG_ERROR_IF(result && m_sendError != result, Network, "LibWebRTCSocketClient::sendTo failed with error %d", m_socket->GetError());
-    m_sendError = result;
+    m_socket->SendTo(data, size, socketAddress, options);
+    auto error = m_socket->GetError();
+    RELEASE_LOG_ERROR_IF(error && m_sendError != error, Network, "LibWebRTCSocketClient::sendTo (ID=%" PRIu64 ") failed with error %d", m_identifier.toUInt64(), error);
+    m_sendError = error;
 }
 
 void LibWebRTCSocketClient::close()
@@ -82,7 +83,7 @@
     ASSERT(m_socket);
     auto result = m_socket->Close();
     UNUSED_PARAM(result);
-    RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::close failed with error %d", m_socket->GetError());
+    RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::close (ID=%" PRIu64 ") failed with error %d", m_identifier.toUInt64(), m_socket->GetError());
 
     m_rtcProvider.takeSocket(m_identifier);
 }
@@ -92,7 +93,7 @@
     ASSERT(m_socket);
     auto result = m_socket->SetOption(static_cast<rtc::Socket::Option>(option), value);
     UNUSED_PARAM(result);
-    RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::setOption(%d, %d) failed with error %d", option, value, m_socket->GetError());
+    RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::setOption(%d, %d) (ID=%" PRIu64 ") failed with error %d", option, value, m_identifier.toUInt64(), m_socket->GetError());
 }
 
 void LibWebRTCSocketClient::signalReadPacket(rtc::AsyncPacketSocket* socket, const char* value, size_t length, const rtc::SocketAddress& address, const rtc::PacketTime& packetTime)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to