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

Unified Diff: talk/app/webrtc/statscollector.cc

Issue 1358413003: Revert of TransportController refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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 | « talk/app/webrtc/peerconnection.cc ('k') | talk/app/webrtc/statscollector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/statscollector.cc
diff --git a/talk/app/webrtc/statscollector.cc b/talk/app/webrtc/statscollector.cc
index 021234709dc2983af631f81db01df8db4ac18de5..76ac76d7d2b953ff556039151373733d388bff2d 100644
--- a/talk/app/webrtc/statscollector.cc
+++ b/talk/app/webrtc/statscollector.cc
@@ -697,18 +697,24 @@
// expose them in stats reports. All channels in a transport share the
// same local and remote certificates.
//
+ // Note that Transport::GetCertificate and Transport::GetRemoteCertificate
+ // invoke method calls on the worker thread and block this thread, but
+ // messages are still processed on this thread, which may blow way the
+ // existing transports. So we cannot reuse |transport| after these calls.
StatsReport::Id local_cert_report_id, remote_cert_report_id;
+
+ cricket::Transport* transport =
+ session_->GetTransport(transport_iter.second.content_name);
rtc::scoped_refptr<rtc::RTCCertificate> certificate;
- if (session_->GetLocalCertificate(transport_iter.second.transport_name,
- &certificate)) {
+ if (transport && transport->GetCertificate(&certificate)) {
StatsReport* r = AddCertificateReports(&(certificate->ssl_certificate()));
if (r)
local_cert_report_id = r->id();
}
+ transport = session_->GetTransport(transport_iter.second.content_name);
rtc::scoped_ptr<rtc::SSLCertificate> cert;
- if (session_->GetRemoteSSLCertificate(transport_iter.second.transport_name,
- cert.accept())) {
+ if (transport && transport->GetRemoteSSLCertificate(cert.accept())) {
StatsReport* r = AddCertificateReports(cert.get());
if (r)
remote_cert_report_id = r->id();
@@ -716,7 +722,7 @@
for (const auto& channel_iter : transport_iter.second.channel_stats) {
StatsReport::Id id(StatsReport::NewComponentId(
- transport_iter.second.transport_name, channel_iter.component));
+ transport_iter.second.content_name, channel_iter.component));
StatsReport* channel_report = reports_.ReplaceOrAddNew(id);
channel_report->set_timestamp(stats_gathering_started_);
channel_report->AddInt(StatsReport::kStatsValueNameComponent,
@@ -933,6 +939,7 @@
StatsReport* report = entry.second;
report->set_timestamp(stats_gathering_started_);
}
+
}
void StatsCollector::ClearUpdateStatsCacheForTest() {
« no previous file with comments | « talk/app/webrtc/peerconnection.cc ('k') | talk/app/webrtc/statscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698