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

Unified Diff: webrtc/api/rtcstatscollector.cc

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: 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
« webrtc/api/rtcstatscollector.h ('K') | « webrtc/api/rtcstatscollector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtcstatscollector.cc
diff --git a/webrtc/api/rtcstatscollector.cc b/webrtc/api/rtcstatscollector.cc
index a6d691c33339fd453ccf03175017e2422764e840..f4a1604f9df70e613aa226d02d8bf2f843b8007d 100644
--- a/webrtc/api/rtcstatscollector.cc
+++ b/webrtc/api/rtcstatscollector.cc
@@ -430,6 +430,17 @@ void RTCStatsCollector::ClearCachedStatsReport() {
cached_report_ = nullptr;
}
+void RTCStatsCollector::WaitForPendingRequest() {
+ RTC_DCHECK(signaling_thread_->IsCurrent());
+ if (num_pending_partial_reports_) {
+ rtc::Thread::Current()->ProcessMessages(0);
+ while (num_pending_partial_reports_) {
+ rtc::Thread::Current()->SleepMs(1);
hta-webrtc 2016/12/16 14:05:31 This is a busy-wait. Is it possible to wait on som
hbos 2016/12/16 14:34:52 We need to ProcessMessages (e.g. ProducePartialRes
+ rtc::Thread::Current()->ProcessMessages(0);
+ }
+ }
+}
+
void RTCStatsCollector::ProducePartialResultsOnSignalingThread(
int64_t timestamp_us) {
RTC_DCHECK(signaling_thread_->IsCurrent());
« webrtc/api/rtcstatscollector.h ('K') | « webrtc/api/rtcstatscollector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698