Deliver cached stats reports asynchronously.
This has the following benefits:
* Stats reports are always delivered asynchronously. This means the API
client doesn't need to worry about *possibly* getting a synchronous
callback depending on when the last report was generated.
* Stats callbacks will always be invoked in the same order that the
GetStats calls were made, even in cases where a callback recursively
calls GetStats again.
Bug: webrtc:8973
Change-Id: I94ca4b5dc5c21a8f2df42adfcddf357f40a32025
Reviewed-on: https://webrtc-review.googlesource.com/60473
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22348}
diff --git a/pc/rtcstatscollector.h b/pc/rtcstatscollector.h
index 2ff4c49..be5980b 100644
--- a/pc/rtcstatscollector.h
+++ b/pc/rtcstatscollector.h
@@ -94,7 +94,9 @@
};
void AddPartialResults_s(rtc::scoped_refptr<RTCStatsReport> partial_report);
- void DeliverCachedReport();
+ void DeliverCachedReport(
+ rtc::scoped_refptr<const RTCStatsReport> cached_report,
+ std::vector<rtc::scoped_refptr<RTCStatsCollectorCallback>> callbacks);
// Produces |RTCCertificateStats|.
void ProduceCertificateStats_n(