Modified: trunk/Source/WebKit/ChangeLog (260060 => 260061)
--- trunk/Source/WebKit/ChangeLog 2020-04-14 07:06:48 UTC (rev 260060)
+++ trunk/Source/WebKit/ChangeLog 2020-04-14 07:40:23 UTC (rev 260061)
@@ -1,3 +1,17 @@
+2020-04-14 Youenn Fablet <you...@apple.com>
+
+ Add logging in case of WebRTC socket error
+ https://bugs.webkit.org/show_bug.cgi?id=210428
+
+ Reviewed by Eric Carlson.
+
+ Add some release logging in case of error when sending, setting option or closing a socket.
+
+ * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
+ (WebKit::LibWebRTCSocketClient::sendTo):
+ (WebKit::LibWebRTCSocketClient::close):
+ (WebKit::LibWebRTCSocketClient::setOption):
+
2020-04-13 David Kilzer <ddkil...@apple.com>
Replace use of Checked<size_t, RecordOverflow> with CheckedSize
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp (260060 => 260061)
--- trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp 2020-04-14 07:06:48 UTC (rev 260060)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/LibWebRTCSocketClient.cpp 2020-04-14 07:40:23 UTC (rev 260061)
@@ -70,13 +70,18 @@
void LibWebRTCSocketClient::sendTo(const WebCore::SharedBuffer& buffer, const rtc::SocketAddress& socketAddress, const rtc::PacketOptions& options)
{
- m_socket->SendTo(reinterpret_cast<const uint8_t*>(buffer.data()), buffer.size(), socketAddress, options);
+ auto result = m_socket->SendTo(reinterpret_cast<const uint8_t*>(buffer.data()), buffer.size(), socketAddress, options);
+ UNUSED_PARAM(result);
+ RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::sendTo failed with error %d", m_socket->GetError());
}
void LibWebRTCSocketClient::close()
{
ASSERT(m_socket);
- m_socket->Close();
+ auto result = m_socket->Close();
+ UNUSED_PARAM(result);
+ RELEASE_LOG_ERROR_IF(result, Network, "LibWebRTCSocketClient::close failed with error %d", m_socket->GetError());
+
m_rtcProvider.takeSocket(m_identifier);
}
@@ -83,7 +88,9 @@
void LibWebRTCSocketClient::setOption(int option, int value)
{
ASSERT(m_socket);
- m_socket->SetOption(static_cast<rtc::Socket::Option>(option), value);
+ 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());
}
void LibWebRTCSocketClient::signalReadPacket(rtc::AsyncPacketSocket* socket, const char* value, size_t length, const rtc::SocketAddress& address, const rtc::PacketTime& packetTime)