Diff
Modified: trunk/Source/WebKit/ChangeLog (288295 => 288296)
--- trunk/Source/WebKit/ChangeLog 2022-01-20 16:59:30 UTC (rev 288295)
+++ trunk/Source/WebKit/ChangeLog 2022-01-20 17:04:24 UTC (rev 288296)
@@ -1,3 +1,22 @@
+2022-01-20 Youenn Fablet <you...@apple.com>
+
+ Disable fallback path to WebRTC platform sockets
+ https://bugs.webkit.org/show_bug.cgi?id=235402
+
+ Reviewed by Eric Carlson.
+
+ We should not fallback to the legacy WebRTC socket code path in Cocoa ports.
+ Instead, if we cannot create the corresponding sockets (in case of ssltcp candidates for instance),
+ we mark the socket as closed.
+ Minor refactoring to show that NetworkRTCUDPSocketCocoa code path should always be successful.
+
+ Manually tested on meet.google.com which can make use of ssltcp candidates.
+
+ * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+ * NetworkProcess/webrtc/NetworkRTCProvider.h:
+ * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
+ * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm:
+
2022-01-20 Elliott Williams <e...@apple.com>
Prevent empty folders being created during install builds
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp (288295 => 288296)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2022-01-20 16:59:30 UTC (rev 288295)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2022-01-20 17:04:24 UTC (rev 288296)
@@ -168,10 +168,9 @@
#if PLATFORM(COCOA)
if (m_platformUDPSocketsEnabled) {
- if (auto socket = NetworkRTCUDPSocketCocoa::createUDPSocket(identifier, *this, address.value, minPort, maxPort, m_ipcConnection.copyRef(), String(attributedBundleIdentifierFromPageIdentifier(pageIdentifier)), isFirstParty, isRelayDisabled, WTFMove(domain))) {
- addSocket(identifier, WTFMove(socket));
- return;
- }
+ auto socket = makeUnique<NetworkRTCUDPSocketCocoa>(identifier, *this, address.value, m_ipcConnection.copyRef(), String(attributedBundleIdentifierFromPageIdentifier(pageIdentifier)), isFirstParty, isRelayDisabled, WTFMove(domain));
+ addSocket(identifier, WTFMove(socket));
+ return;
}
#endif
@@ -187,7 +186,7 @@
return;
if (!m_isListeningSocketAuthorized) {
- m_connection->connection().send(Messages::LibWebRTCNetwork::SignalClose(identifier, 1), 0);
+ signalSocketIsClosed(identifier);
return;
}
@@ -211,10 +210,12 @@
#if PLATFORM(COCOA)
if (m_platformTCPSocketsEnabled) {
- if (auto socket = NetworkRTCTCPSocketCocoa::createClientTCPSocket(identifier, *this, remoteAddress.value, options, attributedBundleIdentifierFromPageIdentifier(pageIdentifier), isFirstParty, isRelayDisabled, domain, m_ipcConnection.copyRef())) {
+ auto socket = NetworkRTCTCPSocketCocoa::createClientTCPSocket(identifier, *this, remoteAddress.value, options, attributedBundleIdentifierFromPageIdentifier(pageIdentifier), isFirstParty, isRelayDisabled, domain, m_ipcConnection.copyRef());
+ if (socket)
addSocket(identifier, WTFMove(socket));
- return;
- }
+ else
+ signalSocketIsClosed(identifier);
+ return;
}
#endif
@@ -224,7 +225,7 @@
auto* session = m_connection->networkSession();
if (!session) {
- m_connection->connection().send(Messages::LibWebRTCNetwork::SignalClose(identifier, 1), 0);
+ signalSocketIsClosed(identifier);
return;
}
callOnRTCNetworkThread([this, identifier, localAddress = RTCNetwork::isolatedCopy(localAddress.value), remoteAddress = RTCNetwork::isolatedCopy(remoteAddress.value), proxyInfo = proxyInfoFromSession(remoteAddress, *session), userAgent = WTFMove(userAgent).isolatedCopy(), options]() mutable {
@@ -429,6 +430,11 @@
m_rtcNetworkThread.Post(RTC_FROM_HERE, this, 1, new NetworkMessageData(*this, WTFMove(callback)));
}
+void NetworkRTCProvider::signalSocketIsClosed(LibWebRTCSocketIdentifier identifier)
+{
+ m_connection->connection().send(Messages::LibWebRTCNetwork::SignalClose(identifier, 1), 0);
+}
+
#undef RTC_RELEASE_LOG
#undef RTC_RELEASE_LOG_ERROR
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h (288295 => 288296)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h 2022-01-20 16:59:30 UTC (rev 288295)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h 2022-01-20 17:04:24 UTC (rev 288296)
@@ -149,6 +149,7 @@
#if PLATFORM(COCOA)
const String& attributedBundleIdentifierFromPageIdentifier(WebPageProxyIdentifier);
#endif
+ void signalSocketIsClosed(WebCore::LibWebRTCSocketIdentifier);
static constexpr size_t maxSockets { 256 };
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm (288295 => 288296)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm 2022-01-20 16:59:30 UTC (rev 288295)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm 2022-01-20 17:04:24 UTC (rev 288296)
@@ -53,9 +53,7 @@
std::unique_ptr<NetworkRTCProvider::Socket> NetworkRTCTCPSocketCocoa::createClientTCPSocket(LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& remoteAddress, int tcpOptions, const String& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain, Ref<IPC::Connection>&& connection)
{
- // FIXME: We should migrate ssltcp candidates, maybe support OPT_TLS_INSECURE as well.
- if ((tcpOptions & rtc::PacketSocketFactory::OPT_TLS_FAKE) || (tcpOptions & rtc::PacketSocketFactory::OPT_TLS_INSECURE))
- return nullptr;
+ // FIXME: We should support ssltcp candidates, maybe support OPT_TLS_INSECURE as well.
return makeUnique<NetworkRTCTCPSocketCocoa>(identifier, rtcProvider, remoteAddress, tcpOptions, attributedBundleIdentifier, isFirstParty, isRelayDisabled, domain, WTFMove(connection));
}
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm (288295 => 288296)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm 2022-01-20 16:59:30 UTC (rev 288295)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm 2022-01-20 17:04:24 UTC (rev 288296)
@@ -102,11 +102,6 @@
return queue;
}
-std::unique_ptr<NetworkRTCProvider::Socket> NetworkRTCUDPSocketCocoa::createUDPSocket(WebCore::LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& address, uint16_t minPort, uint16_t maxPort, Ref<IPC::Connection>&& connection, String&& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain)
-{
- return makeUnique<NetworkRTCUDPSocketCocoa>(identifier, rtcProvider, address, WTFMove(connection), WTFMove(attributedBundleIdentifier), isFirstParty, isRelayDisabled, domain);
-}
-
NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa(WebCore::LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& address, Ref<IPC::Connection>&& connection, String&& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain)
: m_rtcProvider(rtcProvider)
, m_identifier(identifier)