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

Unified Diff: webrtc/stats/rtcstatsreport.cc

Issue 2456463002: RTCOutboundRTPStreamStats added. (Closed)
Patch Set: Rebase and TODO for target_bitrate Created 4 years, 2 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
« no previous file with comments | « webrtc/stats/rtcstats_objects.cc ('k') | webrtc/stats/rtcstatsreport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/stats/rtcstatsreport.cc
diff --git a/webrtc/stats/rtcstatsreport.cc b/webrtc/stats/rtcstatsreport.cc
index 4be554daaec9e5d11c6fedc4d2d3e4da817a2b5b..9e2244cecf848b888416b4dbb5af9c4a8101dca1 100644
--- a/webrtc/stats/rtcstatsreport.cc
+++ b/webrtc/stats/rtcstatsreport.cc
@@ -10,6 +10,8 @@
#include "webrtc/api/stats/rtcstatsreport.h"
+#include <sstream>
+
namespace webrtc {
RTCStatsReport::ConstIterator::ConstIterator(
@@ -40,6 +42,10 @@ const RTCStats& RTCStatsReport::ConstIterator::operator*() const {
return *it_->second.get();
}
+const RTCStats* RTCStatsReport::ConstIterator::operator->() const {
+ return it_->second.get();
+}
+
bool RTCStatsReport::ConstIterator::operator==(
const RTCStatsReport::ConstIterator& other) const {
return it_ == other.it_;
@@ -50,12 +56,14 @@ bool RTCStatsReport::ConstIterator::operator!=(
return !(*this == other);
}
-rtc::scoped_refptr<RTCStatsReport> RTCStatsReport::Create() {
+rtc::scoped_refptr<RTCStatsReport> RTCStatsReport::Create(
+ uint64_t timestamp_us) {
return rtc::scoped_refptr<RTCStatsReport>(
- new rtc::RefCountedObject<RTCStatsReport>());
+ new rtc::RefCountedObject<RTCStatsReport>(timestamp_us));
}
-RTCStatsReport::RTCStatsReport() {
+RTCStatsReport::RTCStatsReport(uint64_t timestamp_us)
+ : timestamp_us_(timestamp_us) {
}
RTCStatsReport::~RTCStatsReport() {
@@ -92,4 +100,16 @@ RTCStatsReport::ConstIterator RTCStatsReport::end() const {
stats_.cend());
}
+std::string RTCStatsReport::ToString() const {
+ std::ostringstream oss;
+ ConstIterator it = begin();
+ if (it != end()) {
+ oss << it->ToString();
+ for (++it; it != end(); ++it) {
+ oss << '\n' << it->ToString();
+ }
+ }
+ return oss.str();
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/stats/rtcstats_objects.cc ('k') | webrtc/stats/rtcstatsreport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698