| 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 signaling_thread(), | 739 signaling_thread(), |
| 740 channel_manager_, | 740 channel_manager_, |
| 741 mediastream_signaling_, | 741 mediastream_signaling_, |
| 742 this, | 742 this, |
| 743 id(), | 743 id(), |
| 744 data_channel_type_)); | 744 data_channel_type_)); |
| 745 } else { | 745 } else { |
| 746 // Construct with DTLS enabled. | 746 // Construct with DTLS enabled. |
| 747 if (!certificate) { | 747 if (!certificate) { |
| 748 // Use the |dtls_identity_store| to generate a certificate. | 748 // Use the |dtls_identity_store| to generate a certificate. |
| 749 DCHECK(dtls_identity_store); | 749 RTC_DCHECK(dtls_identity_store); |
| 750 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 750 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
| 751 signaling_thread(), | 751 signaling_thread(), |
| 752 channel_manager_, | 752 channel_manager_, |
| 753 mediastream_signaling_, | 753 mediastream_signaling_, |
| 754 dtls_identity_store.Pass(), | 754 dtls_identity_store.Pass(), |
| 755 this, | 755 this, |
| 756 id(), | 756 id(), |
| 757 data_channel_type_)); | 757 data_channel_type_)); |
| 758 } else { | 758 } else { |
| 759 // Use the already generated certificate. | 759 // Use the already generated certificate. |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 transport_proxy = GetTransportProxy(content.name); | 1999 transport_proxy = GetTransportProxy(content.name); |
| 2000 | 2000 |
| 2001 return transport_proxy && transport_proxy->local_description_set() && | 2001 return transport_proxy && transport_proxy->local_description_set() && |
| 2002 transport_proxy->remote_description_set(); | 2002 transport_proxy->remote_description_set(); |
| 2003 } | 2003 } |
| 2004 | 2004 |
| 2005 // Walk through the ConnectionInfos to gather best connection usage | 2005 // Walk through the ConnectionInfos to gather best connection usage |
| 2006 // for IPv4 and IPv6. | 2006 // for IPv4 and IPv6. |
| 2007 void WebRtcSession::ReportBestConnectionState( | 2007 void WebRtcSession::ReportBestConnectionState( |
| 2008 const cricket::TransportStats& stats) { | 2008 const cricket::TransportStats& stats) { |
| 2009 DCHECK(metrics_observer_ != NULL); | 2009 RTC_DCHECK(metrics_observer_ != NULL); |
| 2010 for (cricket::TransportChannelStatsList::const_iterator it = | 2010 for (cricket::TransportChannelStatsList::const_iterator it = |
| 2011 stats.channel_stats.begin(); | 2011 stats.channel_stats.begin(); |
| 2012 it != stats.channel_stats.end(); ++it) { | 2012 it != stats.channel_stats.end(); ++it) { |
| 2013 for (cricket::ConnectionInfos::const_iterator it_info = | 2013 for (cricket::ConnectionInfos::const_iterator it_info = |
| 2014 it->connection_infos.begin(); | 2014 it->connection_infos.begin(); |
| 2015 it_info != it->connection_infos.end(); ++it_info) { | 2015 it_info != it->connection_infos.end(); ++it_info) { |
| 2016 if (!it_info->best_connection) { | 2016 if (!it_info->best_connection) { |
| 2017 continue; | 2017 continue; |
| 2018 } | 2018 } |
| 2019 | 2019 |
| 2020 PeerConnectionEnumCounterType type = kPeerConnectionEnumCounterMax; | 2020 PeerConnectionEnumCounterType type = kPeerConnectionEnumCounterMax; |
| 2021 const cricket::Candidate& local = it_info->local_candidate; | 2021 const cricket::Candidate& local = it_info->local_candidate; |
| 2022 const cricket::Candidate& remote = it_info->remote_candidate; | 2022 const cricket::Candidate& remote = it_info->remote_candidate; |
| 2023 | 2023 |
| 2024 // Increment the counter for IceCandidatePairType. | 2024 // Increment the counter for IceCandidatePairType. |
| 2025 if (local.protocol() == cricket::TCP_PROTOCOL_NAME || | 2025 if (local.protocol() == cricket::TCP_PROTOCOL_NAME || |
| 2026 (local.type() == RELAY_PORT_TYPE && | 2026 (local.type() == RELAY_PORT_TYPE && |
| 2027 local.relay_protocol() == cricket::TCP_PROTOCOL_NAME)) { | 2027 local.relay_protocol() == cricket::TCP_PROTOCOL_NAME)) { |
| 2028 type = kEnumCounterIceCandidatePairTypeTcp; | 2028 type = kEnumCounterIceCandidatePairTypeTcp; |
| 2029 } else if (local.protocol() == cricket::UDP_PROTOCOL_NAME) { | 2029 } else if (local.protocol() == cricket::UDP_PROTOCOL_NAME) { |
| 2030 type = kEnumCounterIceCandidatePairTypeUdp; | 2030 type = kEnumCounterIceCandidatePairTypeUdp; |
| 2031 } else { | 2031 } else { |
| 2032 CHECK(0); | 2032 RTC_CHECK(0); |
| 2033 } | 2033 } |
| 2034 metrics_observer_->IncrementEnumCounter( | 2034 metrics_observer_->IncrementEnumCounter( |
| 2035 type, GetIceCandidatePairCounter(local, remote), | 2035 type, GetIceCandidatePairCounter(local, remote), |
| 2036 kIceCandidatePairMax); | 2036 kIceCandidatePairMax); |
| 2037 | 2037 |
| 2038 // Increment the counter for IP type. | 2038 // Increment the counter for IP type. |
| 2039 if (local.address().family() == AF_INET) { | 2039 if (local.address().family() == AF_INET) { |
| 2040 metrics_observer_->IncrementEnumCounter( | 2040 metrics_observer_->IncrementEnumCounter( |
| 2041 kEnumCounterAddressFamily, kBestConnections_IPv4, | 2041 kEnumCounterAddressFamily, kBestConnections_IPv4, |
| 2042 kPeerConnectionAddressFamilyCounter_Max); | 2042 kPeerConnectionAddressFamilyCounter_Max); |
| 2043 | 2043 |
| 2044 } else if (local.address().family() == AF_INET6) { | 2044 } else if (local.address().family() == AF_INET6) { |
| 2045 metrics_observer_->IncrementEnumCounter( | 2045 metrics_observer_->IncrementEnumCounter( |
| 2046 kEnumCounterAddressFamily, kBestConnections_IPv6, | 2046 kEnumCounterAddressFamily, kBestConnections_IPv6, |
| 2047 kPeerConnectionAddressFamilyCounter_Max); | 2047 kPeerConnectionAddressFamilyCounter_Max); |
| 2048 } else { | 2048 } else { |
| 2049 CHECK(0); | 2049 RTC_CHECK(0); |
| 2050 } | 2050 } |
| 2051 | 2051 |
| 2052 return; | 2052 return; |
| 2053 } | 2053 } |
| 2054 } | 2054 } |
| 2055 } | 2055 } |
| 2056 | 2056 |
| 2057 void WebRtcSession::ReportNegotiatedCiphers( | 2057 void WebRtcSession::ReportNegotiatedCiphers( |
| 2058 const cricket::TransportStats& stats) { | 2058 const cricket::TransportStats& stats) { |
| 2059 DCHECK(metrics_observer_ != NULL); | 2059 RTC_DCHECK(metrics_observer_ != NULL); |
| 2060 if (!dtls_enabled_ || stats.channel_stats.empty()) { | 2060 if (!dtls_enabled_ || stats.channel_stats.empty()) { |
| 2061 return; | 2061 return; |
| 2062 } | 2062 } |
| 2063 | 2063 |
| 2064 const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher; | 2064 const std::string& srtp_cipher = stats.channel_stats[0].srtp_cipher; |
| 2065 const std::string& ssl_cipher = stats.channel_stats[0].ssl_cipher; | 2065 const std::string& ssl_cipher = stats.channel_stats[0].ssl_cipher; |
| 2066 if (srtp_cipher.empty() && ssl_cipher.empty()) { | 2066 if (srtp_cipher.empty() && ssl_cipher.empty()) { |
| 2067 return; | 2067 return; |
| 2068 } | 2068 } |
| 2069 | 2069 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2085 | 2085 |
| 2086 if (!srtp_cipher.empty()) { | 2086 if (!srtp_cipher.empty()) { |
| 2087 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 2087 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
| 2088 } | 2088 } |
| 2089 if (!ssl_cipher.empty()) { | 2089 if (!ssl_cipher.empty()) { |
| 2090 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 2090 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
| 2091 } | 2091 } |
| 2092 } | 2092 } |
| 2093 | 2093 |
| 2094 } // namespace webrtc | 2094 } // namespace webrtc |
| OLD | NEW |