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

Unified Diff: webrtc/stats/rtcstatsreport.cc

Issue 2983243002: Make RTCStatsReport::ToString() return JSON-parseable string. (Closed)
Patch Set: Replace ToString with ToJson in test files. Created 3 years, 5 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_unittest.cc ('k') | no next file » | 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 566aef8772de09d18103123d8a9a17082e523bac..322d5369a75022004e2919268d79ee66649ace46 100644
--- a/webrtc/stats/rtcstatsreport.cc
+++ b/webrtc/stats/rtcstatsreport.cc
@@ -103,14 +103,15 @@ RTCStatsReport::ConstIterator RTCStatsReport::end() const {
stats_.cend());
}
-std::string RTCStatsReport::ToString() const {
+std::string RTCStatsReport::ToJson() const {
std::ostringstream oss;
ConstIterator it = begin();
if (it != end()) {
- oss << it->ToString();
+ oss << '[' << it->ToJson();
for (++it; it != end(); ++it) {
- oss << '\n' << it->ToString();
+ oss << "," << it->ToJson();
}
+ oss << ']';
}
return oss.str();
}
« no previous file with comments | « webrtc/stats/rtcstats_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698