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

Unified Diff: content/renderer/media/webrtc/rtc_stats.cc

Issue 2359103002: WebRTCStatsReport::copyHandle and getStats added (Closed)
Patch Set: Created 4 years, 3 months 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: content/renderer/media/webrtc/rtc_stats.cc
diff --git a/content/renderer/media/webrtc/rtc_stats.cc b/content/renderer/media/webrtc/rtc_stats.cc
index d79b817adc78143b1407d76d89f72612e5fc1b04..29d95c3bd96e0e31b5f0f09be100a09ecacaa10e 100644
--- a/content/renderer/media/webrtc/rtc_stats.cc
+++ b/content/renderer/media/webrtc/rtc_stats.cc
@@ -20,6 +20,20 @@ RTCStatsReport::RTCStatsReport(
RTCStatsReport::~RTCStatsReport() {
}
+std::unique_ptr<blink::WebRTCStatsReport> RTCStatsReport::copyHandle() const {
+ return std::unique_ptr<blink::WebRTCStatsReport>(
+ new RTCStatsReport(stats_report_));
+}
+
+std::unique_ptr<blink::WebRTCStats> RTCStatsReport::getStats(
+ blink::WebString id) const {
+ const webrtc::RTCStats* stats = stats_report_->Get(id.utf8());
+ if (!stats)
+ return std::unique_ptr<blink::WebRTCStats>();
+ return std::unique_ptr<blink::WebRTCStats>(
+ new RTCStats(stats_report_, stats));
+}
+
std::unique_ptr<blink::WebRTCStats> RTCStatsReport::next() {
if (it_ == end_)
return std::unique_ptr<blink::WebRTCStats>();

Powered by Google App Engine
This is Rietveld 408576698