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

Side by Side Diff: talk/app/webrtc/statscollector.cc

Issue 1458023002: Reland Convert internal representation of Srtp cryptos from string to int (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/peerconnection_unittest.cc ('k') | talk/app/webrtc/statscollector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 channel_report->AddInt(StatsReport::kStatsValueNameComponent, 723 channel_report->AddInt(StatsReport::kStatsValueNameComponent,
724 channel_iter.component); 724 channel_iter.component);
725 if (local_cert_report_id.get()) { 725 if (local_cert_report_id.get()) {
726 channel_report->AddId(StatsReport::kStatsValueNameLocalCertificateId, 726 channel_report->AddId(StatsReport::kStatsValueNameLocalCertificateId,
727 local_cert_report_id); 727 local_cert_report_id);
728 } 728 }
729 if (remote_cert_report_id.get()) { 729 if (remote_cert_report_id.get()) {
730 channel_report->AddId(StatsReport::kStatsValueNameRemoteCertificateId, 730 channel_report->AddId(StatsReport::kStatsValueNameRemoteCertificateId,
731 remote_cert_report_id); 731 remote_cert_report_id);
732 } 732 }
733 const std::string& srtp_cipher = channel_iter.srtp_cipher; 733 int srtp_crypto_suite = channel_iter.srtp_crypto_suite;
734 if (!srtp_cipher.empty()) { 734 if (srtp_crypto_suite != rtc::SRTP_INVALID_CRYPTO_SUITE &&
735 channel_report->AddString(StatsReport::kStatsValueNameSrtpCipher, 735 rtc::SrtpCryptoSuiteToName(srtp_crypto_suite).length()) {
736 srtp_cipher); 736 channel_report->AddString(
737 StatsReport::kStatsValueNameSrtpCipher,
738 rtc::SrtpCryptoSuiteToName(srtp_crypto_suite));
737 } 739 }
738 int ssl_cipher = channel_iter.ssl_cipher; 740 int ssl_cipher_suite = channel_iter.ssl_cipher_suite;
739 if (ssl_cipher && 741 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL &&
740 rtc::SSLStreamAdapter::GetSslCipherSuiteName(ssl_cipher).length()) { 742 rtc::SSLStreamAdapter::SslCipherSuiteToName(ssl_cipher_suite)
743 .length()) {
741 channel_report->AddString( 744 channel_report->AddString(
742 StatsReport::kStatsValueNameDtlsCipher, 745 StatsReport::kStatsValueNameDtlsCipher,
743 rtc::SSLStreamAdapter::GetSslCipherSuiteName(ssl_cipher)); 746 rtc::SSLStreamAdapter::SslCipherSuiteToName(ssl_cipher_suite));
744 } 747 }
745 748
746 int connection_id = 0; 749 int connection_id = 0;
747 for (const cricket::ConnectionInfo& info : 750 for (const cricket::ConnectionInfo& info :
748 channel_iter.connection_infos) { 751 channel_iter.connection_infos) {
749 StatsReport* connection_report = AddConnectionInfoReport( 752 StatsReport* connection_report = AddConnectionInfoReport(
750 transport_iter.first, channel_iter.component, connection_id++, 753 transport_iter.first, channel_iter.component, connection_id++,
751 channel_report->id(), info); 754 channel_report->id(), info);
752 if (info.best_connection) { 755 if (info.best_connection) {
753 channel_report->AddId( 756 channel_report->AddId(
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 StatsReport* report = entry.second; 939 StatsReport* report = entry.second;
937 report->set_timestamp(stats_gathering_started_); 940 report->set_timestamp(stats_gathering_started_);
938 } 941 }
939 } 942 }
940 943
941 void StatsCollector::ClearUpdateStatsCacheForTest() { 944 void StatsCollector::ClearUpdateStatsCacheForTest() {
942 stats_gathering_started_ = 0; 945 stats_gathering_started_ = 0;
943 } 946 }
944 947
945 } // namespace webrtc 948 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/peerconnection_unittest.cc ('k') | talk/app/webrtc/statscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698