Diff
Modified: trunk/Source/WebKit/ChangeLog (282209 => 282210)
--- trunk/Source/WebKit/ChangeLog 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/ChangeLog 2021-09-09 12:16:04 UTC (rev 282210)
@@ -1,3 +1,36 @@
+2021-09-09 Youenn Fablet <[email protected]>
+
+ Categorize WebRTC TCP nw connections like done for WebRTC UDP nw connections
+ https://bugs.webkit.org/show_bug.cgi?id=229801
+
+ Reviewed by Eric Carlson.
+
+ Move NetworkRTCUDPSocketCocoa tracker related code to its own routine in NetworkRTCUtilitiesCocoa.
+ Make use of that routine in NetworkRTCTCPSocketCocoa.
+ To do so, we need to pass more information when creating a client TCP socket from WebProcess to NetworkProcess.
+ Manually tested.
+
+ * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+ (WebKit::NetworkRTCProvider::createClientTCPSocket):
+ * NetworkProcess/webrtc/NetworkRTCProvider.h:
+ * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
+ * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h:
+ * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm:
+ (WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket):
+ (WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa):
+ * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm:
+ (WebKit::NetworkRTCUDPSocketCocoaConnections::configureParameters):
+ (WebKit::isKnownTracker): Deleted.
+ * NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.h:
+ * NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.mm:
+ (WebKit::setNWParametersTrackerOptions):
+ (WebKit::isKnownTracker):
+ * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
+ (WebKit::RTCSocketFactory::CreateClientTcpSocket):
+ * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
+ (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
+ * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
+
2021-09-08 Ryosuke Niwa <[email protected]>
Deploy CheckedRef on FocusController
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.cpp 2021-09-09 12:16:04 UTC (rev 282210)
@@ -202,13 +202,13 @@
}
#endif
-void NetworkRTCProvider::createClientTCPSocket(LibWebRTCSocketIdentifier identifier, const RTCNetwork::SocketAddress& localAddress, const RTCNetwork::SocketAddress& remoteAddress, String&& userAgent, int options, WebPageProxyIdentifier pageIdentifier, bool isRelayDisabled)
+void NetworkRTCProvider::createClientTCPSocket(LibWebRTCSocketIdentifier identifier, const RTCNetwork::SocketAddress& localAddress, const RTCNetwork::SocketAddress& remoteAddress, String&& userAgent, int options, WebPageProxyIdentifier pageIdentifier, bool isFirstParty, bool isRelayDisabled, WebCore::RegistrableDomain&& domain)
{
ASSERT(m_rtcNetworkThread.IsCurrent());
#if PLATFORM(COCOA)
if (m_platformTCPSocketsEnabled) {
- if (auto socket = NetworkRTCTCPSocketCocoa::createClientTCPSocket(identifier, *this, remoteAddress.value, options, attributedBundleIdentifierFromPageIdentifier(pageIdentifier), isRelayDisabled, m_ipcConnection.copyRef())) {
+ if (auto socket = NetworkRTCTCPSocketCocoa::createClientTCPSocket(identifier, *this, remoteAddress.value, options, attributedBundleIdentifierFromPageIdentifier(pageIdentifier), isFirstParty, isRelayDisabled, domain, m_ipcConnection.copyRef())) {
addSocket(identifier, WTFMove(socket));
return;
}
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.h 2021-09-09 12:16:04 UTC (rev 282210)
@@ -116,7 +116,7 @@
void startListeningForIPC();
void createUDPSocket(WebCore::LibWebRTCSocketIdentifier, const RTCNetwork::SocketAddress&, uint16_t, uint16_t, WebPageProxyIdentifier, bool isFirstParty, bool isRelayDisabled, WebCore::RegistrableDomain&&);
- void createClientTCPSocket(WebCore::LibWebRTCSocketIdentifier, const RTCNetwork::SocketAddress&, const RTCNetwork::SocketAddress&, String&& userAgent, int, WebPageProxyIdentifier, bool isRelayDisabled);
+ void createClientTCPSocket(WebCore::LibWebRTCSocketIdentifier, const RTCNetwork::SocketAddress&, const RTCNetwork::SocketAddress&, String&& userAgent, int, WebPageProxyIdentifier, bool isFirstParty, bool isRelayDisabled, WebCore::RegistrableDomain&&);
void createServerTCPSocket(WebCore::LibWebRTCSocketIdentifier, const RTCNetwork::SocketAddress&, uint16_t minPort, uint16_t maxPort, int);
void wrapNewTCPConnection(WebCore::LibWebRTCSocketIdentifier identifier, WebCore::LibWebRTCSocketIdentifier newConnectionSocketIdentifier);
void sendToSocket(WebCore::LibWebRTCSocketIdentifier, const IPC::DataReference&, RTCNetwork::SocketAddress&&, RTCPacketOptions&&);
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.messages.in (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.messages.in 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCProvider.messages.in 2021-09-09 12:16:04 UTC (rev 282210)
@@ -25,7 +25,7 @@
messages -> NetworkRTCProvider {
CreateUDPSocket(WebCore::LibWebRTCSocketIdentifier identifier, WebKit::RTCNetwork::SocketAddress localAddress, uint16_t minPort, uint16_t maxPort, WebKit::WebPageProxyIdentifier pageIdentifier, bool isFirstParty, bool isRelayDisabled, WebCore::RegistrableDomain domain)
CreateServerTCPSocket(WebCore::LibWebRTCSocketIdentifier identifier, WebKit::RTCNetwork::SocketAddress localAddress, uint16_t minPort, uint16_t maxPort, int options)
- CreateClientTCPSocket(WebCore::LibWebRTCSocketIdentifier identifier, WebKit::RTCNetwork::SocketAddress localAddress, WebKit::RTCNetwork::SocketAddress remoteAddress, String userAgent, int options, WebKit::WebPageProxyIdentifier pageIdentifier, bool isRelayDisabled)
+ CreateClientTCPSocket(WebCore::LibWebRTCSocketIdentifier identifier, WebKit::RTCNetwork::SocketAddress localAddress, WebKit::RTCNetwork::SocketAddress remoteAddress, String userAgent, int options, WebKit::WebPageProxyIdentifier pageIdentifier, bool isFirstParty, bool isRelayDisabled, WebCore::RegistrableDomain domain)
WrapNewTCPConnection(WebCore::LibWebRTCSocketIdentifier identifier, WebCore::LibWebRTCSocketIdentifier newConnectionSocketIdentifier)
void SetPlatformTCPSocketsEnabled(bool enabled)
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h 2021-09-09 12:16:04 UTC (rev 282210)
@@ -39,9 +39,9 @@
class NetworkRTCTCPSocketCocoa final : public NetworkRTCProvider::Socket {
WTF_MAKE_FAST_ALLOCATED;
public:
- static std::unique_ptr<NetworkRTCProvider::Socket> createClientTCPSocket(WebCore::LibWebRTCSocketIdentifier, NetworkRTCProvider&, const rtc::SocketAddress&, int options, const String& attributedBundleIdentifier, bool isRelayDisabled, Ref<IPC::Connection>&&);
+ static std::unique_ptr<NetworkRTCProvider::Socket> createClientTCPSocket(WebCore::LibWebRTCSocketIdentifier, NetworkRTCProvider&, const rtc::SocketAddress&, int options, const String& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain&, Ref<IPC::Connection>&&);
- NetworkRTCTCPSocketCocoa(WebCore::LibWebRTCSocketIdentifier, NetworkRTCProvider&, const rtc::SocketAddress&, int options, const String& attributedBundleIdentifier, bool isRelayDisabled, Ref<IPC::Connection>&&);
+ NetworkRTCTCPSocketCocoa(WebCore::LibWebRTCSocketIdentifier, NetworkRTCProvider&, const rtc::SocketAddress&, int options, const String& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain&, Ref<IPC::Connection>&&);
private:
// NetworkRTCProvider::Socket.
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm 2021-09-09 12:16:04 UTC (rev 282210)
@@ -51,12 +51,12 @@
return queue;
}
-std::unique_ptr<NetworkRTCProvider::Socket> NetworkRTCTCPSocketCocoa::createClientTCPSocket(LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& remoteAddress, int tcpOptions, const String& attributedBundleIdentifier, bool isRelayDisabled, Ref<IPC::Connection>&& connection)
+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;
- return makeUnique<NetworkRTCTCPSocketCocoa>(identifier, rtcProvider, remoteAddress, tcpOptions, attributedBundleIdentifier, isRelayDisabled, WTFMove(connection));
+ return makeUnique<NetworkRTCTCPSocketCocoa>(identifier, rtcProvider, remoteAddress, tcpOptions, attributedBundleIdentifier, isFirstParty, isRelayDisabled, domain, WTFMove(connection));
}
static inline void processIncomingData(RetainPtr<nw_connection_t>&& nwConnection, Function<Vector<uint8_t>(Vector<uint8_t>&&)>&& processData, Vector<uint8_t>&& buffer = { })
@@ -81,7 +81,7 @@
}).get());
}
-NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa(LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& remoteAddress, int options, const String& attributedBundleIdentifier, bool isRelayDisabled, Ref<IPC::Connection>&& connection)
+NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa(LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& remoteAddress, int options, const String& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain, Ref<IPC::Connection>&& connection)
: m_identifier(identifier)
, m_rtcProvider(rtcProvider)
, m_connection(WTFMove(connection))
@@ -98,10 +98,8 @@
}));
setNWParametersApplicationIdentifiers(tcpTLS.get(), rtcProvider.applicationBundleIdentifier(), rtcProvider.sourceApplicationAuditToken(), attributedBundleIdentifier);
+ setNWParametersTrackerOptions(tcpTLS.get(), isRelayDisabled, isFirstParty, isKnownTracker(domain));
- if (isRelayDisabled)
- nw_parameters_set_account_id(tcpTLS.get(), "com.apple.safari.peertopeer");
-
m_nwConnection = adoptNS(nw_connection_create(host.get(), tcpTLS.get()));
nw_connection_set_queue(m_nwConnection.get(), tcpSocketQueue());
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm 2021-09-09 12:16:04 UTC (rev 282210)
@@ -32,7 +32,6 @@
#include "LibWebRTCNetworkMessages.h"
#include "Logging.h"
#include "NWParametersSPI.h"
-#include <WebCore/RegistrableDomain.h>
#include <WebCore/STUNMessageParsing.h>
#include <dispatch/dispatch.h>
#include <wtf/BlockPtr.h>
@@ -40,12 +39,6 @@
#include <wtf/ThreadSafeRefCounted.h>
#if HAVE(NWPARAMETERS_TRACKER_API)
-SOFT_LINK_LIBRARY(libnetworkextension)
-SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerDisposition_t)
-SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerAppInfoRef)
-SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerDomainContextRef)
-SOFT_LINK(libnetworkextension, NEHelperTrackerGetDisposition, NEHelperTrackerDisposition_t*, (NEHelperTrackerAppInfoRef *app_info_ref, CFArrayRef domains, NEHelperTrackerDomainContextRef *trackerDomainContextRef, CFIndex *trackerDomainIndex), (app_info_ref, domains, trackerDomainContextRef, trackerDomainIndex))
-
SOFT_LINK_LIBRARY_OPTIONAL(libnetwork)
SOFT_LINK_OPTIONAL(libnetwork, nw_parameters_allow_sharing_port_with_listener, void, __cdecl, (nw_parameters_t, nw_listener_t))
#endif
@@ -72,10 +65,8 @@
WebCore::LibWebRTCSocketIdentifier m_identifier;
Ref<IPC::Connection> m_connection;
-#if HAVE(NWPARAMETERS_TRACKER_API)
bool m_isFirstParty { false };
bool m_isKnownTracker { false };
-#endif
bool m_shouldBypassRelay { false };
CString m_sourceApplicationBundleIdentifier;
@@ -149,23 +140,11 @@
return rtc::SocketAddress { nw_endpoint_get_hostname(endpoint.get()), nw_endpoint_get_port(endpoint.get()) };
}
-#if HAVE(NWPARAMETERS_TRACKER_API)
-static bool isKnownTracker(const WebCore::RegistrableDomain& domain)
-{
- NSArray<NSString *> *domains = @[domain.string()];
- NEHelperTrackerDomainContextRef *context = nil;
- CFIndex index = 0;
- return !!NEHelperTrackerGetDisposition(nullptr, (CFArrayRef)domains, context, &index);
-}
-#endif
-
NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections(WebCore::LibWebRTCSocketIdentifier identifier, NetworkRTCProvider& rtcProvider, const rtc::SocketAddress& address, Ref<IPC::Connection>&& connection, String&& attributedBundleIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain)
: m_identifier(identifier)
, m_connection(WTFMove(connection))
-#if HAVE(NWPARAMETERS_TRACKER_API)
, m_isFirstParty(isFirstParty)
, m_isKnownTracker(isKnownTracker(domain))
-#endif
, m_shouldBypassRelay(isRelayDisabled)
, m_sourceApplicationBundleIdentifier(rtcProvider.applicationBundleIdentifier())
, m_sourceApplicationAuditToken(rtcProvider.sourceApplicationAuditToken())
@@ -237,14 +216,8 @@
auto options = adoptNS(nw_protocol_stack_copy_internet_protocol(protocolStack.get()));
nw_ip_options_set_version(options.get(), version);
- if (m_shouldBypassRelay)
- nw_parameters_set_account_id(parameters, "com.apple.safari.peertopeer");
-#if HAVE(NWPARAMETERS_TRACKER_API)
- nw_parameters_set_is_third_party_web_content(parameters, !m_isFirstParty);
- nw_parameters_set_is_known_tracker(parameters, m_isKnownTracker);
-#endif
-
setNWParametersApplicationIdentifiers(parameters, m_sourceApplicationBundleIdentifier.data(), m_sourceApplicationAuditToken, m_attributedBundleIdentifier);
+ setNWParametersTrackerOptions(parameters, m_shouldBypassRelay, m_isFirstParty, m_isKnownTracker);
nw_parameters_set_reuse_local_address(parameters, true);
}
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.h (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.h 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.h 2021-09-09 12:16:04 UTC (rev 282210)
@@ -31,9 +31,15 @@
#include <optional>
#include <wtf/Forward.h>
+namespace WebCore {
+class RegistrableDomain;
+}
+
namespace WebKit {
void setNWParametersApplicationIdentifiers(nw_parameters_t, const char* sourceApplicationBundleIdentifier, std::optional<audit_token_t>, const String& attributedBundleIdentifier);
+void setNWParametersTrackerOptions(nw_parameters_t, bool shouldBypassRelay, bool isFirstParty, bool isKnownTracker);
+bool isKnownTracker(const WebCore::RegistrableDomain&);
} // namespace WebKit
Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.mm (282209 => 282210)
--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.mm 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.mm 2021-09-09 12:16:04 UTC (rev 282210)
@@ -28,10 +28,17 @@
#if USE(LIBWEBRTC)
+#import <WebCore/RegistrableDomain.h>
#import <wtf/SoftLinking.h>
#import <wtf/text/WTFString.h>
#if HAVE(NWPARAMETERS_TRACKER_API)
+SOFT_LINK_LIBRARY(libnetworkextension)
+SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerDisposition_t)
+SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerAppInfoRef)
+SOFT_LINK_CLASS(libnetworkextension, NEHelperTrackerDomainContextRef)
+SOFT_LINK(libnetworkextension, NEHelperTrackerGetDisposition, NEHelperTrackerDisposition_t*, (NEHelperTrackerAppInfoRef *app_info_ref, CFArrayRef domains, NEHelperTrackerDomainContextRef *trackerDomainContextRef, CFIndex *trackerDomainIndex), (app_info_ref, domains, trackerDomainContextRef, trackerDomainIndex))
+
SOFT_LINK_LIBRARY_OPTIONAL(libnetwork)
SOFT_LINK_OPTIONAL(libnetwork, nw_parameters_set_attributed_bundle_identifier, void, __cdecl, (nw_parameters_t, const char*))
#endif
@@ -51,6 +58,28 @@
#endif
}
+void setNWParametersTrackerOptions(nw_parameters_t parameters, bool shouldBypassRelay, bool isFirstParty, bool isKnownTracker)
+{
+ if (shouldBypassRelay)
+ nw_parameters_set_account_id(parameters, "com.apple.safari.peertopeer");
+#if HAVE(NWPARAMETERS_TRACKER_API)
+ nw_parameters_set_is_third_party_web_content(parameters, !isFirstParty);
+ nw_parameters_set_is_known_tracker(parameters, isKnownTracker);
+#endif
+}
+
+bool isKnownTracker(const WebCore::RegistrableDomain& domain)
+{
+#if HAVE(NWPARAMETERS_TRACKER_API)
+ NSArray<NSString *> *domains = @[domain.string()];
+ NEHelperTrackerDomainContextRef *context = nil;
+ CFIndex index = 0;
+ return !!NEHelperTrackerGetDisposition(nullptr, (CFArrayRef)domains, context, &index);
+#else
+ return false;
+#endif
+}
+
} // namespace WebKit
#endif // USE(LIBWEBRTC)
Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp (282209 => 282210)
--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCProvider.cpp 2021-09-09 12:16:04 UTC (rev 282210)
@@ -125,7 +125,7 @@
rtc::AsyncPacketSocket* RTCSocketFactory::CreateClientTcpSocket(const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, const rtc::ProxyInfo&, const std::string&, const rtc::PacketSocketTcpOptions& options)
{
- return WebProcess::singleton().libWebRTCNetwork().socketFactory().createClientTcpSocket(this, localAddress, remoteAddress, String { m_userAgent }, options, m_pageIdentifier, m_isRelayDisabled);
+ return WebProcess::singleton().libWebRTCNetwork().socketFactory().createClientTcpSocket(this, localAddress, remoteAddress, String { m_userAgent }, options, m_pageIdentifier, m_isFirstParty, m_isRelayDisabled, m_domain);
}
rtc::AsyncResolverInterface* RTCSocketFactory::CreateAsyncResolver()
Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp (282209 => 282210)
--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp 2021-09-09 12:16:04 UTC (rev 282210)
@@ -104,7 +104,7 @@
return socket.release();
}
-rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, const rtc::PacketSocketTcpOptions& options, WebPageProxyIdentifier pageIdentifier, bool isRelayDisabled)
+rtc::AsyncPacketSocket* LibWebRTCSocketFactory::createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, const rtc::PacketSocketTcpOptions& options, WebPageProxyIdentifier pageIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain& domain)
{
ASSERT(!WTF::isMainRunLoop());
@@ -113,13 +113,13 @@
// FIXME: We only transfer options.opts but should also handle other members.
if (m_connection)
- m_connection->send(Messages::NetworkRTCProvider::CreateClientTCPSocket(socket->identifier(), RTCNetwork::SocketAddress(prepareSocketAddress(localAddress, m_disableNonLocalhostConnections)), RTCNetwork::SocketAddress(prepareSocketAddress(remoteAddress, m_disableNonLocalhostConnections)), userAgent, options.opts, pageIdentifier, isRelayDisabled), 0);
+ m_connection->send(Messages::NetworkRTCProvider::CreateClientTCPSocket(socket->identifier(), RTCNetwork::SocketAddress(prepareSocketAddress(localAddress, m_disableNonLocalhostConnections)), RTCNetwork::SocketAddress(prepareSocketAddress(remoteAddress, m_disableNonLocalhostConnections)), userAgent, options.opts, pageIdentifier, isFirstParty, isRelayDisabled, domain), 0);
else {
callOnMainRunLoop([] {
WebProcess::singleton().ensureNetworkProcessConnection();
});
- m_pendingMessageTasks.append([identifier = socket->identifier(), localAddress = RTCNetwork::SocketAddress(prepareSocketAddress(localAddress, m_disableNonLocalhostConnections)), remoteAddress = RTCNetwork::SocketAddress(prepareSocketAddress(remoteAddress, m_disableNonLocalhostConnections)), userAgent, opts = options.opts, pageIdentifier, isRelayDisabled](auto& connection) {
- connection.send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, localAddress, remoteAddress, userAgent, opts, pageIdentifier, isRelayDisabled), 0);
+ m_pendingMessageTasks.append([identifier = socket->identifier(), localAddress = RTCNetwork::SocketAddress(prepareSocketAddress(localAddress, m_disableNonLocalhostConnections)), remoteAddress = RTCNetwork::SocketAddress(prepareSocketAddress(remoteAddress, m_disableNonLocalhostConnections)), userAgent, opts = options.opts, pageIdentifier, isFirstParty, isRelayDisabled, domain](auto& connection) {
+ connection.send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, localAddress, remoteAddress, userAgent, opts, pageIdentifier, isFirstParty, isRelayDisabled, domain), 0);
});
}
Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h (282209 => 282210)
--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h 2021-09-09 11:38:34 UTC (rev 282209)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.h 2021-09-09 12:16:04 UTC (rev 282210)
@@ -54,7 +54,7 @@
void forSocketInGroup(const void* socketGroup, const Function<void(LibWebRTCSocket&)>&);
rtc::AsyncPacketSocket* createUdpSocket(const void* socketGroup, const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort, WebPageProxyIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain&);
rtc::AsyncPacketSocket* createServerTcpSocket(const void* socketGroup, const rtc::SocketAddress&, uint16_t minPort, uint16_t maxPort, int options);
- rtc::AsyncPacketSocket* createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, const rtc::PacketSocketTcpOptions&, WebPageProxyIdentifier, bool isRelayDisabled);
+ rtc::AsyncPacketSocket* createClientTcpSocket(const void* socketGroup, const rtc::SocketAddress& localAddress, const rtc::SocketAddress& remoteAddress, String&& userAgent, const rtc::PacketSocketTcpOptions&, WebPageProxyIdentifier, bool isFirstParty, bool isRelayDisabled, const WebCore::RegistrableDomain&);
rtc::AsyncPacketSocket* createNewConnectionSocket(LibWebRTCSocket&, WebCore::LibWebRTCSocketIdentifier newConnectionSocketIdentifier, const rtc::SocketAddress&);
LibWebRTCResolver* resolver(LibWebRTCResolverIdentifier identifier) { return m_resolvers.get(identifier); }