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

Unified Diff: webrtc/api/rtcstatscollector.h

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: DCHECK in destructor added 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
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtcstatscollector.h
diff --git a/webrtc/api/rtcstatscollector.h b/webrtc/api/rtcstatscollector.h
index c32d65f2460a83447946b70430b5bf1bc05b5074..6823385a9b9249a0aff4ba932c2dab269274694a 100644
--- a/webrtc/api/rtcstatscollector.h
+++ b/webrtc/api/rtcstatscollector.h
@@ -70,8 +70,13 @@ 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);
+ ~RTCStatsCollector();
// Stats gathering on a particular thread. Calls |AddPartialResults| before
// returning. Virtual for the sake of testing.
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698