Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1666)

Unified Diff: talk/app/webrtc/webrtcsession.cc

Issue 1156143005: Report metrics about negotiated ciphers. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/webrtcsession.cc
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index 5c8b2df754fe8d69dd5928e2a0477e3f2e8e50ab..c827c790a0fec7bd07e33198f9e2702d6ccb0bf4 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -1393,6 +1393,7 @@ void WebRtcSession::OnTransportCompleted(cricket::Transport* transport) {
// Only report once when Ice connection is completed.
if (old_state != PeerConnectionInterface::kIceConnectionCompleted) {
ReportBestConnectionState(transport);
+ ReportNegotiatedCiphers(transport);
guoweis_webrtc 2015/06/08 17:09:11 Both ReportBestConnectionState and ReportNegotiate
joachim 2015/06/08 20:58:40 Done.
}
}
@@ -1904,4 +1905,24 @@ void WebRtcSession::ReportBestConnectionState(cricket::Transport* transport) {
}
}
+void WebRtcSession::ReportNegotiatedCiphers(cricket::Transport* transport) {
+ if (!metrics_observer_ || !dtls_enabled_) {
+ return;
+ }
+
+ cricket::TransportStats stats;
+ if (!transport->GetStats(&stats) || stats.channel_stats.empty()) {
+ return;
+ }
+
+ const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher;
+ const std::string& ssl_cipher = stats.channel_stats[0].ssl_cipher;
+ if (srtp_cipher.empty() || ssl_cipher.empty()) {
+ return;
+ }
+
+ metrics_observer_->CiphersNegotiated(stats.content_name,
+ srtp_cipher, ssl_cipher);
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698