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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 channel_report->AddInt(StatsReport::kStatsValueNameComponent, | 723 channel_report->AddInt(StatsReport::kStatsValueNameComponent, |
724 channel_iter.component); | 724 channel_iter.component); |
725 if (local_cert_report_id.get()) { | 725 if (local_cert_report_id.get()) { |
726 channel_report->AddId(StatsReport::kStatsValueNameLocalCertificateId, | 726 channel_report->AddId(StatsReport::kStatsValueNameLocalCertificateId, |
727 local_cert_report_id); | 727 local_cert_report_id); |
728 } | 728 } |
729 if (remote_cert_report_id.get()) { | 729 if (remote_cert_report_id.get()) { |
730 channel_report->AddId(StatsReport::kStatsValueNameRemoteCertificateId, | 730 channel_report->AddId(StatsReport::kStatsValueNameRemoteCertificateId, |
731 remote_cert_report_id); | 731 remote_cert_report_id); |
732 } | 732 } |
733 int srtp_crypto_suite = channel_iter.srtp_crypto_suite; | 733 const std::string& srtp_cipher = channel_iter.srtp_cipher; |
734 if (srtp_crypto_suite != rtc::SRTP_INVALID_CRYPTO_SUITE && | 734 if (!srtp_cipher.empty()) { |
735 rtc::SrtpCryptoSuiteToName(srtp_crypto_suite).length()) { | 735 channel_report->AddString(StatsReport::kStatsValueNameSrtpCipher, |
736 channel_report->AddString( | 736 srtp_cipher); |
737 StatsReport::kStatsValueNameSrtpCipher, | |
738 rtc::SrtpCryptoSuiteToName(srtp_crypto_suite)); | |
739 } | 737 } |
740 int ssl_cipher_suite = channel_iter.ssl_cipher_suite; | 738 int ssl_cipher = channel_iter.ssl_cipher; |
741 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL && | 739 if (ssl_cipher && |
742 rtc::SSLStreamAdapter::SslCipherSuiteToName(ssl_cipher_suite) | 740 rtc::SSLStreamAdapter::GetSslCipherSuiteName(ssl_cipher).length()) { |
743 .length()) { | |
744 channel_report->AddString( | 741 channel_report->AddString( |
745 StatsReport::kStatsValueNameDtlsCipher, | 742 StatsReport::kStatsValueNameDtlsCipher, |
746 rtc::SSLStreamAdapter::SslCipherSuiteToName(ssl_cipher_suite)); | 743 rtc::SSLStreamAdapter::GetSslCipherSuiteName(ssl_cipher)); |
747 } | 744 } |
748 | 745 |
749 int connection_id = 0; | 746 int connection_id = 0; |
750 for (const cricket::ConnectionInfo& info : | 747 for (const cricket::ConnectionInfo& info : |
751 channel_iter.connection_infos) { | 748 channel_iter.connection_infos) { |
752 StatsReport* connection_report = AddConnectionInfoReport( | 749 StatsReport* connection_report = AddConnectionInfoReport( |
753 transport_iter.first, channel_iter.component, connection_id++, | 750 transport_iter.first, channel_iter.component, connection_id++, |
754 channel_report->id(), info); | 751 channel_report->id(), info); |
755 if (info.best_connection) { | 752 if (info.best_connection) { |
756 channel_report->AddId( | 753 channel_report->AddId( |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 StatsReport* report = entry.second; | 936 StatsReport* report = entry.second; |
940 report->set_timestamp(stats_gathering_started_); | 937 report->set_timestamp(stats_gathering_started_); |
941 } | 938 } |
942 } | 939 } |
943 | 940 |
944 void StatsCollector::ClearUpdateStatsCacheForTest() { | 941 void StatsCollector::ClearUpdateStatsCacheForTest() { |
945 stats_gathering_started_ = 0; | 942 stats_gathering_started_ = 0; |
946 } | 943 } |
947 | 944 |
948 } // namespace webrtc | 945 } // namespace webrtc |
OLD | NEW |