Commit 40cb6e8a authored by tommi@chromium.org's avatar tommi@chromium.org

Clean up code a bit in MockPeerConnectionImpl. This addresses an issue in...

Clean up code a bit in MockPeerConnectionImpl. This addresses an issue in non-clang builds on ubuntu 12.04 using gcc 4.6.4 which has been in there for a while now:

The error is as follows:

../../content/renderer/media/mock_peer_connection_impl.cc: In member function
'virtual bool content::MockPeerConnectionImpl::GetStats(webrtc::StatsObserver*,
webrtc::MediaStreamTrackInterface*,
webrtc::PeerConnectionInterface::StatsOutputLevel)':
../../content/renderer/media/mock_peer_connection_impl.cc:280:3: error: in C++98
'value' must be initialized by constructor, not by '{...}'
../../content/renderer/media/mock_peer_connection_impl.cc:293:5: error: in C++98
'value2' must be initialized by constructor, not by '{...}'

R=xians@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285547 0039d316-1c4b-4281-b951-d872f2087c98
parent ddfd5dea
......@@ -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 report1, report2;
report1.id = "1234";
report1.type = "ssrc";
report1.timestamp = 42;
report1.values.push_back(
webrtc::StatsReport::Value(
webrtc::StatsReport::kStatsValueNameFingerprint,
"trackvalue"
};
report.values.push_back(value);
"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 = {
report2.values.push_back(
webrtc::StatsReport::Value(
webrtc::StatsReport::kStatsValueNameFingerprintAlgorithm,
"somevalue"
};
report2.values.push_back(value2);
"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;
}
......
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