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 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 } | 2150 } |
2151 } | 2151 } |
2152 | 2152 |
2153 void WebRtcSession::ReportNegotiatedCiphers( | 2153 void WebRtcSession::ReportNegotiatedCiphers( |
2154 const cricket::TransportStats& stats) { | 2154 const cricket::TransportStats& stats) { |
2155 RTC_DCHECK(metrics_observer_ != NULL); | 2155 RTC_DCHECK(metrics_observer_ != NULL); |
2156 if (!dtls_enabled_ || stats.channel_stats.empty()) { | 2156 if (!dtls_enabled_ || stats.channel_stats.empty()) { |
2157 return; | 2157 return; |
2158 } | 2158 } |
2159 | 2159 |
2160 const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher; | 2160 int srtp_crypto_suite = stats.channel_stats[0].srtp_cipher; |
2161 int ssl_cipher = stats.channel_stats[0].ssl_cipher; | 2161 int ssl_cipher_suite = stats.channel_stats[0].ssl_cipher; |
2162 if (srtp_cipher.empty() && !ssl_cipher) { | 2162 if (!srtp_crypto_suite && !ssl_cipher_suite) { |
2163 return; | 2163 return; |
2164 } | 2164 } |
2165 | 2165 |
2166 PeerConnectionEnumCounterType srtp_counter_type; | 2166 PeerConnectionEnumCounterType srtp_counter_type; |
2167 PeerConnectionEnumCounterType ssl_counter_type; | 2167 PeerConnectionEnumCounterType ssl_counter_type; |
2168 if (stats.transport_name == cricket::CN_AUDIO) { | 2168 if (stats.transport_name == cricket::CN_AUDIO) { |
2169 srtp_counter_type = kEnumCounterAudioSrtpCipher; | 2169 srtp_counter_type = kEnumCounterAudioSrtpCipher; |
2170 ssl_counter_type = kEnumCounterAudioSslCipher; | 2170 ssl_counter_type = kEnumCounterAudioSslCipher; |
2171 } else if (stats.transport_name == cricket::CN_VIDEO) { | 2171 } else if (stats.transport_name == cricket::CN_VIDEO) { |
2172 srtp_counter_type = kEnumCounterVideoSrtpCipher; | 2172 srtp_counter_type = kEnumCounterVideoSrtpCipher; |
2173 ssl_counter_type = kEnumCounterVideoSslCipher; | 2173 ssl_counter_type = kEnumCounterVideoSslCipher; |
2174 } else if (stats.transport_name == cricket::CN_DATA) { | 2174 } else if (stats.transport_name == cricket::CN_DATA) { |
2175 srtp_counter_type = kEnumCounterDataSrtpCipher; | 2175 srtp_counter_type = kEnumCounterDataSrtpCipher; |
2176 ssl_counter_type = kEnumCounterDataSslCipher; | 2176 ssl_counter_type = kEnumCounterDataSslCipher; |
2177 } else { | 2177 } else { |
2178 RTC_NOTREACHED(); | 2178 RTC_NOTREACHED(); |
2179 return; | 2179 return; |
2180 } | 2180 } |
2181 | 2181 |
2182 if (!srtp_cipher.empty()) { | 2182 if (srtp_crypto_suite) { |
2183 metrics_observer_->IncrementSparseEnumCounter( | 2183 metrics_observer_->IncrementSparseEnumCounter(srtp_counter_type, |
2184 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher)); | 2184 srtp_crypto_suite); |
2185 } | 2185 } |
2186 if (ssl_cipher) { | 2186 if (ssl_cipher_suite) { |
2187 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); | 2187 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, |
| 2188 ssl_cipher_suite); |
2188 } | 2189 } |
2189 } | 2190 } |
2190 | 2191 |
2191 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2192 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2192 const rtc::SentPacket& sent_packet) { | 2193 const rtc::SentPacket& sent_packet) { |
2193 RTC_DCHECK(worker_thread()->IsCurrent()); | 2194 RTC_DCHECK(worker_thread()->IsCurrent()); |
2194 media_controller_->call_w()->OnSentPacket(sent_packet); | 2195 media_controller_->call_w()->OnSentPacket(sent_packet); |
2195 } | 2196 } |
2196 | 2197 |
2197 } // namespace webrtc | 2198 } // namespace webrtc |
OLD | NEW |