OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 // the proxy map directly from the session stats. | 685 // the proxy map directly from the session stats. |
686 // As is, if GetStats() failed, we could be using old (incorrect?) proxy | 686 // As is, if GetStats() failed, we could be using old (incorrect?) proxy |
687 // data. | 687 // data. |
688 proxy_to_transport_ = stats.proxy_to_transport; | 688 proxy_to_transport_ = stats.proxy_to_transport; |
689 | 689 |
690 for (const auto& transport_iter : stats.transport_stats) { | 690 for (const auto& transport_iter : stats.transport_stats) { |
691 // Attempt to get a copy of the certificates from the transport and | 691 // Attempt to get a copy of the certificates from the transport and |
692 // expose them in stats reports. All channels in a transport share the | 692 // expose them in stats reports. All channels in a transport share the |
693 // same local and remote certificates. | 693 // same local and remote certificates. |
694 // | 694 // |
695 // Note that Transport::GetIdentity and Transport::GetRemoteCertificate | |
696 // invoke method calls on the worker thread and block this thread, but | |
697 // messages are still processed on this thread, which may blow way the | |
698 // existing transports. So we cannot reuse |transport| after these calls. | |
699 StatsReport::Id local_cert_report_id, remote_cert_report_id; | 695 StatsReport::Id local_cert_report_id, remote_cert_report_id; |
700 | |
701 cricket::Transport* transport = | |
702 session_->GetTransport(transport_iter.second.content_name); | |
703 rtc::scoped_ptr<rtc::SSLIdentity> identity; | 696 rtc::scoped_ptr<rtc::SSLIdentity> identity; |
704 if (transport && transport->GetIdentity(identity.accept())) { | 697 if (session_->GetIdentity(transport_iter.second.content_name, |
698 identity.accept())) { | |
705 StatsReport* r = AddCertificateReports(&(identity->certificate())); | 699 StatsReport* r = AddCertificateReports(&(identity->certificate())); |
706 if (r) | 700 if (r) |
707 local_cert_report_id = r->id(); | 701 local_cert_report_id = r->id(); |
708 } | 702 } |
709 | 703 |
710 transport = session_->GetTransport(transport_iter.second.content_name); | |
711 rtc::scoped_ptr<rtc::SSLCertificate> cert; | 704 rtc::scoped_ptr<rtc::SSLCertificate> cert; |
712 if (transport && transport->GetRemoteCertificate(cert.accept())) { | 705 if (session_->GetRemoteCertificate(transport_iter.second.content_name, |
706 cert.accept())) { | |
pthatcher1
2015/08/10 20:40:16
Would it make more sense for GetIdentity and GetRe
Taylor Brandstetter
2015/08/11 01:20:06
They ARE methods on the TransportController. But t
pthatcher1
2015/08/18 22:32:46
Ah, so the transport_iter.second.content_name is t
| |
713 StatsReport* r = AddCertificateReports(cert.get()); | 707 StatsReport* r = AddCertificateReports(cert.get()); |
714 if (r) | 708 if (r) |
715 remote_cert_report_id = r->id(); | 709 remote_cert_report_id = r->id(); |
716 } | 710 } |
717 | 711 |
718 for (const auto& channel_iter : transport_iter.second.channel_stats) { | 712 for (const auto& channel_iter : transport_iter.second.channel_stats) { |
719 StatsReport::Id id(StatsReport::NewComponentId( | 713 StatsReport::Id id(StatsReport::NewComponentId( |
720 transport_iter.second.content_name, channel_iter.component)); | 714 transport_iter.second.content_name, channel_iter.component)); |
721 StatsReport* channel_report = reports_.ReplaceOrAddNew(id); | 715 StatsReport* channel_report = reports_.ReplaceOrAddNew(id); |
722 channel_report->set_timestamp(stats_gathering_started_); | 716 channel_report->set_timestamp(stats_gathering_started_); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 | 921 |
928 void StatsCollector::UpdateTrackReports() { | 922 void StatsCollector::UpdateTrackReports() { |
929 DCHECK(session_->signaling_thread()->IsCurrent()); | 923 DCHECK(session_->signaling_thread()->IsCurrent()); |
930 | 924 |
931 rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls; | 925 rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls; |
932 | 926 |
933 for (const auto& entry : track_ids_) { | 927 for (const auto& entry : track_ids_) { |
934 StatsReport* report = entry.second; | 928 StatsReport* report = entry.second; |
935 report->set_timestamp(stats_gathering_started_); | 929 report->set_timestamp(stats_gathering_started_); |
936 } | 930 } |
937 | |
938 } | 931 } |
939 | 932 |
940 void StatsCollector::ClearUpdateStatsCacheForTest() { | 933 void StatsCollector::ClearUpdateStatsCacheForTest() { |
941 stats_gathering_started_ = 0; | 934 stats_gathering_started_ = 0; |
942 } | 935 } |
943 | 936 |
944 } // namespace webrtc | 937 } // namespace webrtc |
OLD | NEW |