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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 } | 1386 } |
1387 } | 1387 } |
1388 | 1388 |
1389 void WebRtcSession::OnTransportCompleted(cricket::Transport* transport) { | 1389 void WebRtcSession::OnTransportCompleted(cricket::Transport* transport) { |
1390 ASSERT(signaling_thread()->IsCurrent()); | 1390 ASSERT(signaling_thread()->IsCurrent()); |
1391 PeerConnectionInterface::IceConnectionState old_state = ice_connection_state_; | 1391 PeerConnectionInterface::IceConnectionState old_state = ice_connection_state_; |
1392 SetIceConnectionState(PeerConnectionInterface::kIceConnectionCompleted); | 1392 SetIceConnectionState(PeerConnectionInterface::kIceConnectionCompleted); |
1393 // Only report once when Ice connection is completed. | 1393 // Only report once when Ice connection is completed. |
1394 if (old_state != PeerConnectionInterface::kIceConnectionCompleted) { | 1394 if (old_state != PeerConnectionInterface::kIceConnectionCompleted) { |
1395 ReportBestConnectionState(transport); | 1395 ReportBestConnectionState(transport); |
1396 ReportNegotiatedCiphers(transport); | |
guoweis_webrtc
2015/06/08 17:09:11
Both ReportBestConnectionState and ReportNegotiate
joachim
2015/06/08 20:58:40
Done.
| |
1396 } | 1397 } |
1397 } | 1398 } |
1398 | 1399 |
1399 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) { | 1400 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) { |
1400 ASSERT(signaling_thread()->IsCurrent()); | 1401 ASSERT(signaling_thread()->IsCurrent()); |
1401 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed); | 1402 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed); |
1402 } | 1403 } |
1403 | 1404 |
1404 void WebRtcSession::OnTransportProxyCandidatesReady( | 1405 void WebRtcSession::OnTransportProxyCandidatesReady( |
1405 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { | 1406 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1897 AF_INET6) { | 1898 AF_INET6) { |
1898 metrics_observer_->IncrementCounter(kBestConnections_IPv6); | 1899 metrics_observer_->IncrementCounter(kBestConnections_IPv6); |
1899 } else { | 1900 } else { |
1900 ASSERT(false); | 1901 ASSERT(false); |
1901 } | 1902 } |
1902 return; | 1903 return; |
1903 } | 1904 } |
1904 } | 1905 } |
1905 } | 1906 } |
1906 | 1907 |
1908 void WebRtcSession::ReportNegotiatedCiphers(cricket::Transport* transport) { | |
1909 if (!metrics_observer_ || !dtls_enabled_) { | |
1910 return; | |
1911 } | |
1912 | |
1913 cricket::TransportStats stats; | |
1914 if (!transport->GetStats(&stats) || stats.channel_stats.empty()) { | |
1915 return; | |
1916 } | |
1917 | |
1918 const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher; | |
1919 const std::string& ssl_cipher = stats.channel_stats[0].ssl_cipher; | |
1920 if (srtp_cipher.empty() || ssl_cipher.empty()) { | |
1921 return; | |
1922 } | |
1923 | |
1924 metrics_observer_->CiphersNegotiated(stats.content_name, | |
1925 srtp_cipher, ssl_cipher); | |
1926 } | |
1927 | |
1907 } // namespace webrtc | 1928 } // namespace webrtc |
OLD | NEW |