Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: webrtc/api/statscollector.cc

Issue 2470023004: Return false if PeerConnection::GetStats() is called on invalid tracks (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/api/peerconnection.cc ('K') | « webrtc/api/statscollector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/statscollector.cc
diff --git a/webrtc/api/statscollector.cc b/webrtc/api/statscollector.cc
index a40835c77e257cac26fe7a0c5b8132c561b00972..126751be3e6d188f22c0f4abab8d475bb5c7ac5a 100644
--- a/webrtc/api/statscollector.cc
+++ b/webrtc/api/statscollector.cc
@@ -549,6 +549,13 @@ StatsReport* StatsCollector::PrepareReport(
return report;
}
+bool StatsCollector::IsValidTrack(MediaStreamTrackInterface* track) {
+ // The track is allowed to be a nullptr.
+ return !track ||
+ reports_.Find(StatsReport::NewTypedId(
+ StatsReport::kStatsReportTypeTrack, track->id())) != nullptr;
+}
+
StatsReport* StatsCollector::AddCertificateReports(
const rtc::SSLCertificate* cert) {
RTC_DCHECK(pc_->session()->signaling_thread()->IsCurrent());
« webrtc/api/peerconnection.cc ('K') | « webrtc/api/statscollector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698