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

Unified Diff: content/renderer/media/mock_peer_connection_impl.cc

Issue 415403002: Clean up code a bit in MockPeerConnectionImpl. This addresses an issue in non-clang builds on ubunt… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/mock_peer_connection_impl.cc
diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc
index 13bd548d6fd3106f10475e0cd7897a4f7279ef8a..7a09ea36126bb51b6c0cbd1e6059d2b98746ae2a 100644
--- a/content/renderer/media/mock_peer_connection_impl.cc
+++ b/content/renderer/media/mock_peer_connection_impl.cc
@@ -269,33 +269,35 @@ bool MockPeerConnectionImpl::GetStats(
return false;
DCHECK_EQ(kStatsOutputLevelStandard, level);
- std::vector<webrtc::StatsReport> reports(track ? 1 : 2);
- webrtc::StatsReport& report = reports[0];
- report.id = "1234";
- report.type = "ssrc";
- report.timestamp = 42;
- webrtc::StatsReport::Value value = {
- webrtc::StatsReport::kStatsValueNameFingerprint,
- "trackvalue"
- };
- report.values.push_back(value);
+ webrtc::StatsReport report1, report2;
+ report1.id = "1234";
+ report1.type = "ssrc";
+ report1.timestamp = 42;
+ report1.values.push_back(
+ webrtc::StatsReport::Value(
+ webrtc::StatsReport::kStatsValueNameFingerprint,
+ "trackvalue"));
+
+ std::vector<webrtc::StatsReport> reports;
+ reports.push_back(report1);
+
// If selector is given, we pass back one report.
// If selector is not given, we pass back two.
if (!track) {
- webrtc::StatsReport& report2 = reports[1];
report2.id = "nontrack";
report2.type = "generic";
report2.timestamp = 44;
- report2.values.push_back(value);
- webrtc::StatsReport::Value value2 = {
- webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm,
- "somevalue"
- };
- report2.values.push_back(value2);
+ report2.values.push_back(
+ webrtc::StatsReport::Value(
+ webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm,
+ "somevalue"));
+ reports.push_back(report2);
}
+
// Note that the callback is synchronous, not asynchronous; it will
// happen before the request call completes.
observer->OnComplete(reports);
+
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698