Title: [258545] trunk
- Revision
- 258545
- Author
- [email protected]
- Date
- 2020-03-17 03:50:32 -0700 (Tue, 17 Mar 2020)
Log Message
Safari doesn't insert mDNS candidates to SDP
https://bugs.webkit.org/show_bug.cgi?id=209050
<rdar://problem/60419936>
Reviewed by Eric Carlson.
Source/WebCore:
Instead of removing host candidate lines in SDP, replace the host IP address by the corresponding mDNS name.
Covered by updated test.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::extractIPAddress):
(WebCore::PeerConnectionBackend::filterSDP const):
(WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
* Modules/mediastream/PeerConnectionBackend.h:
LayoutTests:
* webrtc/datachannel/mdns-ice-candidates.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (258544 => 258545)
--- trunk/LayoutTests/ChangeLog 2020-03-17 10:42:05 UTC (rev 258544)
+++ trunk/LayoutTests/ChangeLog 2020-03-17 10:50:32 UTC (rev 258545)
@@ -1,3 +1,13 @@
+2020-03-17 youenn fablet <[email protected]>
+
+ Safari doesn't insert mDNS candidates to SDP
+ https://bugs.webkit.org/show_bug.cgi?id=209050
+ <rdar://problem/60419936>
+
+ Reviewed by Eric Carlson.
+
+ * webrtc/datachannel/mdns-ice-candidates.html:
+
2020-03-17 Alexey Shvayka <[email protected]>
Sync web-platform-tests/css/css-cascade from upstream
Modified: trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html (258544 => 258545)
--- trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html 2020-03-17 10:42:05 UTC (rev 258544)
+++ trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html 2020-03-17 10:50:32 UTC (rev 258545)
@@ -50,9 +50,11 @@
channel.send("four");
}
-promise_test((test) => {
- return new Promise((resolve, reject) => {
+let connection;
+promise_test(async (test) => {
+ await new Promise((resolve, reject) => {
createConnections((localConnection) => {
+ connection = localConnection;
localConnection.createDataChannel('sendDataChannel');
}, () => {
}, {
@@ -66,6 +68,8 @@
});
setTimeout(() => { reject("Test timed out"); }, 5000);
});
+
+ assert_true(connection.localDescription.sdp.includes(".local "));
}, "Getting some MDNS candidates");
var finishTest;
Modified: trunk/Source/WebCore/ChangeLog (258544 => 258545)
--- trunk/Source/WebCore/ChangeLog 2020-03-17 10:42:05 UTC (rev 258544)
+++ trunk/Source/WebCore/ChangeLog 2020-03-17 10:50:32 UTC (rev 258545)
@@ -1,3 +1,20 @@
+2020-03-17 youenn fablet <[email protected]>
+
+ Safari doesn't insert mDNS candidates to SDP
+ https://bugs.webkit.org/show_bug.cgi?id=209050
+ <rdar://problem/60419936>
+
+ Reviewed by Eric Carlson.
+
+ Instead of removing host candidate lines in SDP, replace the host IP address by the corresponding mDNS name.
+ Covered by updated test.
+
+ * Modules/mediastream/PeerConnectionBackend.cpp:
+ (WebCore::extractIPAddress):
+ (WebCore::PeerConnectionBackend::filterSDP const):
+ (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
+ * Modules/mediastream/PeerConnectionBackend.h:
+
2020-03-17 Philippe Normand <[email protected]>
[GStreamer][MSE] Playback rate update support
Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (258544 => 258545)
--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp 2020-03-17 10:42:05 UTC (rev 258544)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp 2020-03-17 10:50:32 UTC (rev 258545)
@@ -303,7 +303,7 @@
m_pendingTrackEvents.append(WTFMove(event));
}
-static String extractIPAddress(const String& sdp)
+static String extractIPAddress(StringView sdp)
{
unsigned counter = 0;
for (auto item : StringView { sdp }.split(' ')) {
@@ -438,7 +438,7 @@
return WTFMove(sdp);
StringBuilder filteredSDP;
- sdp.split('\n', [&filteredSDP](StringView line) {
+ sdp.split('\n', [this, &filteredSDP](StringView line) {
if (line.startsWith("c=IN IP4"))
filteredSDP.append("c=IN IP4 0.0.0.0\r");
else if (line.startsWith("c=IN IP6"))
@@ -447,8 +447,16 @@
filteredSDP.append(line);
else if (line.find(" host ", 11) == notFound)
filteredSDP.append(filterICECandidate(line.toString()));
- else
+ else {
+ auto ipAddress = extractIPAddress(line);
+ auto mdnsName = m_ipAddressToMDNSNameMap.get(ipAddress);
+ if (!mdnsName.isEmpty()) {
+ auto sdp = line.toString();
+ sdp.replace(ipAddress, mdnsName);
+ filteredSDP.append(sdp);
+ }
return;
+ }
filteredSDP.append('\n');
});
return filteredSDP.toString();
@@ -520,6 +528,7 @@
void PeerConnectionBackend::finishedRegisteringMDNSName(const String& ipAddress, const String& name)
{
+ m_ipAddressToMDNSNameMap.add(ipAddress, name);
Vector<PendingICECandidate*> candidates;
for (auto& candidate : m_pendingICECandidates) {
if (candidate.sdp.find(ipAddress) != notFound) {
Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (258544 => 258545)
--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h 2020-03-17 10:42:05 UTC (rev 258544)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h 2020-03-17 10:50:32 UTC (rev 258545)
@@ -243,6 +243,7 @@
Vector<PendingTrackEvent> m_pendingTrackEvents;
+ HashMap<String, String> m_ipAddressToMDNSNameMap;
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes