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 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2157 } | 2157 } |
2158 } | 2158 } |
2159 | 2159 |
2160 void WebRtcSession::ReportNegotiatedCiphers( | 2160 void WebRtcSession::ReportNegotiatedCiphers( |
2161 const cricket::TransportStats& stats) { | 2161 const cricket::TransportStats& stats) { |
2162 RTC_DCHECK(metrics_observer_ != NULL); | 2162 RTC_DCHECK(metrics_observer_ != NULL); |
2163 if (!dtls_enabled_ || stats.channel_stats.empty()) { | 2163 if (!dtls_enabled_ || stats.channel_stats.empty()) { |
2164 return; | 2164 return; |
2165 } | 2165 } |
2166 | 2166 |
2167 const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher; | 2167 int srtp_cipher = stats.channel_stats[0].srtp_cipher; |
2168 int ssl_cipher = stats.channel_stats[0].ssl_cipher; | 2168 int ssl_cipher = stats.channel_stats[0].ssl_cipher; |
pthatcher1
2015/11/11 19:59:40
And here to?
guoweis_webrtc
2015/11/17 01:21:15
Done.
| |
2169 if (srtp_cipher.empty() && !ssl_cipher) { | 2169 if (!srtp_cipher && !ssl_cipher) { |
2170 return; | 2170 return; |
2171 } | 2171 } |
2172 | 2172 |
2173 PeerConnectionEnumCounterType srtp_counter_type; | 2173 PeerConnectionEnumCounterType srtp_counter_type; |
2174 PeerConnectionEnumCounterType ssl_counter_type; | 2174 PeerConnectionEnumCounterType ssl_counter_type; |
2175 if (stats.transport_name == cricket::CN_AUDIO) { | 2175 if (stats.transport_name == cricket::CN_AUDIO) { |
2176 srtp_counter_type = kEnumCounterAudioSrtpCipher; | 2176 srtp_counter_type = kEnumCounterAudioSrtpCipher; |
2177 ssl_counter_type = kEnumCounterAudioSslCipher; | 2177 ssl_counter_type = kEnumCounterAudioSslCipher; |
2178 } else if (stats.transport_name == cricket::CN_VIDEO) { | 2178 } else if (stats.transport_name == cricket::CN_VIDEO) { |
2179 srtp_counter_type = kEnumCounterVideoSrtpCipher; | 2179 srtp_counter_type = kEnumCounterVideoSrtpCipher; |
2180 ssl_counter_type = kEnumCounterVideoSslCipher; | 2180 ssl_counter_type = kEnumCounterVideoSslCipher; |
2181 } else if (stats.transport_name == cricket::CN_DATA) { | 2181 } else if (stats.transport_name == cricket::CN_DATA) { |
2182 srtp_counter_type = kEnumCounterDataSrtpCipher; | 2182 srtp_counter_type = kEnumCounterDataSrtpCipher; |
2183 ssl_counter_type = kEnumCounterDataSslCipher; | 2183 ssl_counter_type = kEnumCounterDataSslCipher; |
2184 } else { | 2184 } else { |
2185 RTC_NOTREACHED(); | 2185 RTC_NOTREACHED(); |
2186 return; | 2186 return; |
2187 } | 2187 } |
2188 | 2188 |
2189 if (!srtp_cipher.empty()) { | 2189 if (srtp_cipher) { |
2190 metrics_observer_->IncrementSparseEnumCounter( | 2190 metrics_observer_->IncrementSparseEnumCounter(srtp_counter_type, |
2191 srtp_counter_type, rtc::GetSrtpCryptoSuiteFromName(srtp_cipher)); | 2191 srtp_cipher); |
2192 } | 2192 } |
2193 if (ssl_cipher) { | 2193 if (ssl_cipher) { |
2194 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); | 2194 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, ssl_cipher); |
2195 } | 2195 } |
2196 } | 2196 } |
2197 | 2197 |
2198 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2198 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2199 const rtc::SentPacket& sent_packet) { | 2199 const rtc::SentPacket& sent_packet) { |
2200 RTC_DCHECK(worker_thread()->IsCurrent()); | 2200 RTC_DCHECK(worker_thread()->IsCurrent()); |
2201 media_controller_->call_w()->OnSentPacket(sent_packet); | 2201 media_controller_->call_w()->OnSentPacket(sent_packet); |
2202 } | 2202 } |
2203 | 2203 |
2204 } // namespace webrtc | 2204 } // namespace webrtc |
OLD | NEW |