Commit 7aeb7149 authored by tommi's avatar tommi Committed by Commit bot

Update CastStatsObserver to use the new OnComplete method.

The old method has now been deprecated so I need to TBR this to unblock a roll of WebRTC.

TBR=wez@chromium.org,aiguha@chromium.org

Review URL: https://codereview.chromium.org/804983002

Cr-Commit-Position: refs/heads/master@{#308351}
parent e1f85039
...@@ -134,18 +134,14 @@ class CastStatsObserver : public webrtc::StatsObserver { ...@@ -134,18 +134,14 @@ class CastStatsObserver : public webrtc::StatsObserver {
return new rtc::RefCountedObject<CastStatsObserver>(); return new rtc::RefCountedObject<CastStatsObserver>();
} }
void OnComplete(const std::vector<webrtc::StatsReport>& reports) override { void OnComplete(const webrtc::StatsReports& reports) override {
typedef webrtc::StatsReport::Values::iterator ValuesIterator;
VLOG(1) << "Received " << reports.size() << " new StatsReports."; VLOG(1) << "Received " << reports.size() << " new StatsReports.";
int index; int index = 0;
std::vector<webrtc::StatsReport>::const_iterator it; for (const auto* report : reports) {
for (it = reports.begin(), index = 0; it != reports.end(); ++it, ++index) { VLOG(1) << "Report " << index++ << ":";
webrtc::StatsReport::Values v = it->values; for (const auto& v : report->values) {
VLOG(1) << "Report " << index << ":"; VLOG(1) << "Stat: " << v.display_name() << "=" << v.value << ".";
for (ValuesIterator vIt = v.begin(); vIt != v.end(); ++vIt) {
VLOG(1) << "Stat: " << vIt->name << "=" << vIt->value << ".";
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment