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

Unified Diff: webrtc/api/rtcstatscollector.h

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: Addressed comments Created 4 years 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
Index: webrtc/api/rtcstatscollector.h
diff --git a/webrtc/api/rtcstatscollector.h b/webrtc/api/rtcstatscollector.h
index c32d65f2460a83447946b70430b5bf1bc05b5074..3cf2b85311399992d3f5ad6b21cc16e735a3eb1e 100644
--- a/webrtc/api/rtcstatscollector.h
+++ b/webrtc/api/rtcstatscollector.h
@@ -70,6 +70,10 @@ class RTCStatsCollector : public virtual rtc::RefCountInterface,
// calling |GetStatsReport| guarantees fresh stats.
void ClearCachedStatsReport();
+ // If there is a |GetStatsReport| requests in-flight, waits until it has been
+ // completed. Must be called on the signaling thread.
+ void WaitForPendingRequest();
+
protected:
RTCStatsCollector(PeerConnection* pc, int64_t cache_lifetime_us);

Powered by Google App Engine
This is Rietveld 408576698