Skip to content

Commit 36e1373

Browse files
youennfphiln
authored andcommitted
Remove obsolete webrtc stats
https://bugs.webkit.org/show_bug.cgi?id=256645 rdar://109206360 Reviewed by Eric Carlson. These stats are now removed from the spec, let's remove them from WebKit. * LayoutTests/webrtc/candidate-stats.html: * Source/WebCore/Modules/mediastream/RTCStatsReport.h: * Source/WebCore/Modules/mediastream/RTCStatsReport.idl: * Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp: (WebCore::fillRTCRTPStreamStats): (WebCore::fillRTCCandidateStats): * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRtpStreamStats): (WebCore::fillRTCIceCandidatePairStats): Canonical link: https://commits.webkit.org/264013@main
1 parent 22eaad3 commit 36e1373

5 files changed

Lines changed: 5 additions & 24 deletions

File tree

LayoutTests/webrtc/candidate-stats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
assert_true(!stats.address, "address is not exposed");
2727
assert_true(!stats.networkType, "networkType is not exposed");
2828

29-
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","deleted","port","priority","protocol","transportId"], "local");
29+
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","port","priority","protocol","transportId"], "local");
3030

3131
stats = await getTypedStats(firstConnection, "remote-candidate");
3232

3333
// For now, we do not want to expose address or networkType.
3434
assert_true(!stats.address, "address is not exposed");
3535
assert_true(!stats.networkType, "networkType is not exposed");
3636

37-
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","deleted","port","priority","protocol","transportId"], "remote");
37+
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","port","priority","protocol","transportId"], "remote");
3838
}, "ICE candidate data channel stats");
3939
</script>
4040
</body>

Source/WebCore/Modules/mediastream/RTCStatsReport.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class RTCStatsReport : public RefCounted<RTCStatsReport> {
6262
struct RtpStreamStats : Stats {
6363
uint32_t ssrc { 0 };
6464
String kind;
65-
String mediaType;
6665
String transportId;
6766
String codecId;
6867
};
@@ -257,7 +256,6 @@ class RTCStatsReport : public RefCounted<RTCStatsReport> {
257256
String localCandidateId;
258257
String remoteCandidateId;
259258
IceCandidatePairState state;
260-
std::optional<uint64_t> priority;
261259
std::optional<bool> nominated;
262260
std::optional<bool> writable;
263261
std::optional<bool> readable;
@@ -287,7 +285,6 @@ class RTCStatsReport : public RefCounted<RTCStatsReport> {
287285
std::optional<RTCIceCandidateType> candidateType;
288286
std::optional<int32_t> priority;
289287
String url;
290-
bool deleted { false };
291288
};
292289

293290
struct CertificateStats : Stats {

Source/WebCore/Modules/mediastream/RTCStatsReport.idl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ dictionary RTCStats {
6060
dictionary RTCRtpStreamStats : RTCStats {
6161
required unsigned long ssrc;
6262
required DOMString kind;
63-
// We should obsolete this field
64-
required DOMString mediaType;
6563
DOMString transportId;
6664
DOMString codecId;
6765
};
@@ -258,7 +256,6 @@ dictionary RTCIceCandidatePairStats : RTCStats {
258256
DOMString localCandidateId;
259257
DOMString remoteCandidateId;
260258
RTCStatsIceCandidatePairState state;
261-
unsigned long long priority;
262259
boolean nominated;
263260
boolean writable;
264261
boolean readable;
@@ -286,7 +283,6 @@ dictionary RTCIceCandidateStats : RTCStats {
286283
RTCIceCandidateType candidateType;
287284
long priority;
288285
DOMString url;
289-
boolean deleted = false;
290286
};
291287

292288
[ JSGenerateToJSObject ]
@@ -366,5 +362,3 @@ dictionary RTCVideoSourceStats : RTCMediaSourceStats {
366362
unsigned long frames;
367363
double framesPerSecond;
368364
};
369-
370-
// FIXME 169662: missing RTCMediaStreamStats

Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ static inline void fillRTCRTPStreamStats(RTCStatsReport::RtpStreamStats& stats,
5757
if (gst_structure_get_uint(structure, "ssrc", &value))
5858
stats.ssrc = value;
5959

60-
if (const char* kind = gst_structure_get_string(structure, "kind")) {
60+
if (const char* kind = gst_structure_get_string(structure, "kind"))
6161
stats.kind = String::fromLatin1(kind);
62-
stats.mediaType = stats.kind;
63-
}
6462
}
6563

6664
static inline void fillRTCCodecStats(RTCStatsReport::CodecStats& stats, const GstStructure* structure)
@@ -275,10 +273,6 @@ static inline void fillRTCCandidateStats(RTCStatsReport::IceCandidateStats& stat
275273

276274
auto candidateType = String::fromLatin1(gst_structure_get_string(structure, "candidate-type"));
277275
stats.candidateType = iceCandidateType(candidateType);
278-
279-
uint64_t priority;
280-
if (gst_structure_get_uint64(structure, "priority", &priority))
281-
stats.priority = priority;
282276
}
283277

284278
static inline void fillRTCCandidatePairStats(RTCStatsReport::IceCandidatePairStats& stats, const GstStructure* structure)

Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ static inline void fillRtpStreamStats(RTCStatsReport::RtpStreamStats& stats, con
6666
stats.transportId = fromStdString(*rtcStats.transport_id);
6767
if (rtcStats.codec_id.is_defined())
6868
stats.codecId = fromStdString(*rtcStats.codec_id);
69-
if (rtcStats.media_type.is_defined()) {
70-
stats.mediaType = fromStdString(*rtcStats.media_type);
71-
stats.kind = stats.mediaType;
72-
}
69+
if (rtcStats.media_type.is_defined())
70+
stats.kind = fromStdString(*rtcStats.kind);
7371
}
7472

7573
static inline void fillReceivedRtpStreamStats(RTCStatsReport::ReceivedRtpStreamStats& stats, const webrtc::RTCReceivedRtpStreamStats& rtcStats)
@@ -366,8 +364,6 @@ static inline void fillRTCIceCandidatePairStats(RTCStatsReport::IceCandidatePair
366364
if (rtcStats.state.is_defined())
367365
stats.state = iceCandidatePairState(*rtcStats.state);
368366

369-
if (rtcStats.priority.is_defined())
370-
stats.priority = *rtcStats.priority;
371367
if (rtcStats.nominated.is_defined())
372368
stats.nominated = *rtcStats.nominated;
373369
if (rtcStats.writable.is_defined())

0 commit comments

Comments
 (0)