| 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 | 695 // Note that Transport::GetCertificate and Transport::GetRemoteCertificate |
| 696 // invoke method calls on the worker thread and block this thread, but | 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 | 697 // messages are still processed on this thread, which may blow way the |
| 698 // existing transports. So we cannot reuse |transport| after these calls. | 698 // existing transports. So we cannot reuse |transport| after these calls. |
| 699 StatsReport::Id local_cert_report_id, remote_cert_report_id; | 699 StatsReport::Id local_cert_report_id, remote_cert_report_id; |
| 700 | 700 |
| 701 cricket::Transport* transport = | 701 cricket::Transport* transport = |
| 702 session_->GetTransport(transport_iter.second.content_name); | 702 session_->GetTransport(transport_iter.second.content_name); |
| 703 rtc::scoped_ptr<rtc::SSLIdentity> identity; | 703 rtc::scoped_refptr<rtc::RTCCertificate> certificate; |
| 704 if (transport && transport->GetIdentity(identity.accept())) { | 704 if (transport && transport->GetCertificate(&certificate)) { |
| 705 StatsReport* r = AddCertificateReports(&(identity->certificate())); | 705 StatsReport* r = AddCertificateReports(&(certificate->ssl_certificate())); |
| 706 if (r) | 706 if (r) |
| 707 local_cert_report_id = r->id(); | 707 local_cert_report_id = r->id(); |
| 708 } | 708 } |
| 709 | 709 |
| 710 transport = session_->GetTransport(transport_iter.second.content_name); | 710 transport = session_->GetTransport(transport_iter.second.content_name); |
| 711 rtc::scoped_ptr<rtc::SSLCertificate> cert; | 711 rtc::scoped_ptr<rtc::SSLCertificate> cert; |
| 712 if (transport && transport->GetRemoteCertificate(cert.accept())) { | 712 if (transport && transport->GetRemoteCertificate(cert.accept())) { |
| 713 StatsReport* r = AddCertificateReports(cert.get()); | 713 StatsReport* r = AddCertificateReports(cert.get()); |
| 714 if (r) | 714 if (r) |
| 715 remote_cert_report_id = r->id(); | 715 remote_cert_report_id = r->id(); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 report->set_timestamp(stats_gathering_started_); | 935 report->set_timestamp(stats_gathering_started_); |
| 936 } | 936 } |
| 937 | 937 |
| 938 } | 938 } |
| 939 | 939 |
| 940 void StatsCollector::ClearUpdateStatsCacheForTest() { | 940 void StatsCollector::ClearUpdateStatsCacheForTest() { |
| 941 stats_gathering_started_ = 0; | 941 stats_gathering_started_ = 0; |
| 942 } | 942 } |
| 943 | 943 |
| 944 } // namespace webrtc | 944 } // namespace webrtc |
| OLD | NEW |