Changeset 236963 in webkit
- Timestamp:
- Oct 9, 2018, 8:44:34 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webrtc/candidate-stats-expected.txt (added)
-
LayoutTests/webrtc/candidate-stats.html (added)
-
LayoutTests/webrtc/routines.js (modified) (1 diff)
-
LayoutTests/webrtc/video-stats.html (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/ChangeLog (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp (modified) (1 diff)
-
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCStatsReport.h (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCStatsReport.idl (modified) (2 diffs)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236961 r236963 1 2018-10-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for IceCandidate stats 4 https://bugs.webkit.org/show_bug.cgi?id=190329 5 6 Reviewed by Eric Carlson. 7 8 * webrtc/candidate-stats-expected.txt: Added. 9 * webrtc/candidate-stats.html: Added. 10 * webrtc/routines.js: 11 * webrtc/video-stats.html: 12 1 13 2018-10-09 Philippe Normand <pnormand@igalia.com> 2 14 -
trunk/LayoutTests/webrtc/routines.js
r236821 r236963 212 212 }).join('\r\n'); 213 213 } 214 215 async function getTypedStats(connection, type) 216 { 217 const report = await connection.getStats(); 218 var stats; 219 report.forEach((statItem) => { 220 if (statItem.type === type) 221 stats = statItem; 222 }); 223 return stats; 224 } -
trunk/LayoutTests/webrtc/video-stats.html
r236346 r236963 138 138 139 139 let types = await getStatsType(firstConnection); 140 assert_array_equals(types, ["candidate-pair", "certificate", "codec", "inbound-rtp", " outbound-rtp", "track"]);140 assert_array_equals(types, ["candidate-pair", "certificate", "codec", "inbound-rtp", "local-candidate", "outbound-rtp", "remote-candidate", "track"]); 141 141 142 142 types = await getStatsType(secondConnection); 143 assert_array_equals(types, ["candidate-pair", "certificate", "codec", "inbound-rtp", " outbound-rtp", "track"]);143 assert_array_equals(types, ["candidate-pair", "certificate", "codec", "inbound-rtp", "local-candidate", "outbound-rtp", "remote-candidate", "track"]); 144 144 }, "Basic video stats"); 145 145 -
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r236898 r236963 1 2018-10-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for IceCandidate stats 4 https://bugs.webkit.org/show_bug.cgi?id=190329 5 6 Reviewed by Eric Carlson. 7 8 Export new stats kType values. 9 10 * Configurations/libwebrtc.iOS.exp: 11 * Configurations/libwebrtc.iOSsim.exp: 12 * Configurations/libwebrtc.mac.exp: 13 1 14 2018-10-06 Dan Bernstein <mitz@apple.com> 2 15 -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOS.exp
r236821 r236963 217 217 __ZN6webrtc9RtpSourceD1Ev 218 218 __ZN6webrtc11field_trial25InitFieldTrialsFromStringEPKc 219 __ZN6webrtc25RTCLocalIceCandidateStats5kTypeE 220 __ZN6webrtc26RTCRemoteIceCandidateStats5kTypeE -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.iOSsim.exp
r236821 r236963 218 218 __ZN6webrtc9RtpSourceD1Ev 219 219 __ZN6webrtc11field_trial25InitFieldTrialsFromStringEPKc 220 __ZN6webrtc25RTCLocalIceCandidateStats5kTypeE 221 __ZN6webrtc26RTCRemoteIceCandidateStats5kTypeE -
trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.mac.exp
r236821 r236963 218 218 __ZN6webrtc9RtpSourceD1Ev 219 219 __ZN6webrtc11field_trial25InitFieldTrialsFromStringEPKc 220 __ZN6webrtc25RTCLocalIceCandidateStats5kTypeE 221 __ZN6webrtc26RTCRemoteIceCandidateStats5kTypeE -
trunk/Source/WebCore/ChangeLog
r236961 r236963 1 2018-10-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for IceCandidate stats 4 https://bugs.webkit.org/show_bug.cgi?id=190329 5 6 Reviewed by Eric Carlson. 7 8 Convert IceCandidate stats gathered by libwebrtc. 9 Since networkType might be sensitive information, we currently do not expose it. 10 We do not expose address either if it is a host or prflx candidate. 11 12 Test: webrtc/candidate-stats.html 13 14 * Modules/mediastream/RTCStatsReport.h: 15 * Modules/mediastream/RTCStatsReport.idl: 16 * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: 17 (WebCore::iceCandidateState): 18 (WebCore::fillRTCIceCandidateStats): 19 (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): 20 1 21 2018-10-09 Philippe Normand <pnormand@igalia.com> 2 22 -
trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.h
r236346 r236963 178 178 }; 179 179 180 enum class IceCandidateType { Host, Srflx, Prflx, Relay }; 181 182 struct IceCandidateStats : Stats { 183 String transportId; 184 String address; 185 std::optional<int32_t> port; 186 String protocol; 187 std::optional<IceCandidateType> candidateType; 188 std::optional<int32_t> priority; 189 String url; 190 bool deleted { false }; 191 }; 192 180 193 struct CertificateStats : Stats { 181 194 CertificateStats() { type = RTCStatsReport::Type::Certificate; } -
trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.idl
r236346 r236963 166 166 }; 167 167 168 enum RTCIceCandidateType { 169 "host", 170 "srflx", 171 "prflx", 172 "relay" 173 }; 174 175 [ JSGenerateToJSObject ] 176 dictionary RTCIceCandidateStats : RTCStats { 177 DOMString transportId; 178 // FIXME: decide whether to expose networkType 179 // FIXME: Expose relayProtocol 180 DOMString address; 181 long port; 182 DOMString protocol; 183 RTCIceCandidateType candidateType; 184 long priority; 185 DOMString url; 186 boolean deleted = false; 187 }; 188 168 189 [ JSGenerateToJSObject ] 169 190 dictionary RTCCertificateStats : RTCStats { … … 195 216 // FIXME 169662: missing RTCTransportStats 196 217 // FIXME 169662: missing RTCIceCandidateStats 197 // FIXME 169662: missing RTCStatsIceCandidatePairState -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp
r236346 r236963 279 279 } 280 280 281 static inline std::optional<RTCStatsReport::IceCandidateType> iceCandidateState(const std::string& state) 282 { 283 if (state == "host") 284 return RTCStatsReport::IceCandidateType::Host; 285 if (state == "srflx") 286 return RTCStatsReport::IceCandidateType::Srflx; 287 if (state == "prflx") 288 return RTCStatsReport::IceCandidateType::Prflx; 289 if (state == "relay") 290 return RTCStatsReport::IceCandidateType::Relay; 291 292 return { }; 293 } 294 295 static inline void fillRTCIceCandidateStats(RTCStatsReport::IceCandidateStats& stats, const webrtc::RTCIceCandidateStats& rtcStats) 296 { 297 stats.type = rtcStats.type() == webrtc::RTCRemoteIceCandidateStats::kType ? RTCStatsReport::Type::RemoteCandidate : RTCStatsReport::Type::LocalCandidate; 298 299 fillRTCStats(stats, rtcStats); 300 301 if (rtcStats.transport_id.is_defined()) 302 stats.transportId = fromStdString(*rtcStats.transport_id); 303 if (rtcStats.ip.is_defined()) 304 stats.address = fromStdString(*rtcStats.ip); 305 if (rtcStats.port.is_defined()) 306 stats.port = *rtcStats.port; 307 if (rtcStats.protocol.is_defined()) 308 stats.protocol = fromStdString(*rtcStats.protocol); 309 310 if (rtcStats.candidate_type.is_defined()) 311 stats.candidateType = iceCandidateState(*rtcStats.candidate_type); 312 313 if (stats.candidateType == RTCStatsReport::IceCandidateType::Prflx) 314 stats.candidateType = { }; 315 if (stats.candidateType == RTCStatsReport::IceCandidateType::Prflx || stats.candidateType == RTCStatsReport::IceCandidateType::Host) 316 stats.address = { }; 317 318 if (rtcStats.priority.is_defined()) 319 stats.priority = *rtcStats.priority; 320 if (rtcStats.url.is_defined()) 321 stats.url = fromStdString(*rtcStats.url); 322 if (rtcStats.deleted.is_defined()) 323 stats.deleted = *rtcStats.deleted; 324 } 325 281 326 static inline void fillRTCCertificateStats(RTCStatsReport::CertificateStats& stats, const webrtc::RTCCertificateStats& rtcStats) 282 327 { … … 341 386 fillRTCIceCandidatePairStats(stats, static_cast<const webrtc::RTCIceCandidatePairStats&>(rtcStats)); 342 387 report->addStats<IDLDictionary<RTCStatsReport::IceCandidatePairStats>>(WTFMove(stats)); 388 } else if (rtcStats.type() == webrtc::RTCRemoteIceCandidateStats::kType || rtcStats.type() == webrtc::RTCLocalIceCandidateStats::kType) { 389 RTCStatsReport::IceCandidateStats stats; 390 fillRTCIceCandidateStats(stats, static_cast<const webrtc::RTCIceCandidateStats&>(rtcStats)); 391 report->addStats<IDLDictionary<RTCStatsReport::IceCandidateStats>>(WTFMove(stats)); 343 392 } else if (rtcStats.type() == webrtc::RTCCertificateStats::kType) { 344 393 RTCStatsReport::CertificateStats stats;
Note:
See TracChangeset
for help on using the changeset viewer.