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

Side by Side Diff: webrtc/api/statscollector.cc

Issue 1802013002: A bunch of interfaces: Return scoped_ptr<SSLCertificate> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/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 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 // 696 //
697 StatsReport::Id local_cert_report_id, remote_cert_report_id; 697 StatsReport::Id local_cert_report_id, remote_cert_report_id;
698 rtc::scoped_refptr<rtc::RTCCertificate> certificate; 698 rtc::scoped_refptr<rtc::RTCCertificate> certificate;
699 if (pc_->session()->GetLocalCertificate( 699 if (pc_->session()->GetLocalCertificate(
700 transport_iter.second.transport_name, &certificate)) { 700 transport_iter.second.transport_name, &certificate)) {
701 StatsReport* r = AddCertificateReports(&(certificate->ssl_certificate())); 701 StatsReport* r = AddCertificateReports(&(certificate->ssl_certificate()));
702 if (r) 702 if (r)
703 local_cert_report_id = r->id(); 703 local_cert_report_id = r->id();
704 } 704 }
705 705
706 rtc::scoped_ptr<rtc::SSLCertificate> cert; 706 auto cert = pc_->session()->GetRemoteSSLCertificate(
torbjorng (webrtc) 2016/03/23 14:18:23 I think this use of auto makes the code less reada
kwiberg-webrtc 2016/03/23 15:05:27 Done. Also in a few other places; the only remaini
707 if (pc_->session()->GetRemoteSSLCertificate( 707 transport_iter.second.transport_name);
708 transport_iter.second.transport_name, cert.accept())) { 708 if (cert) {
709 StatsReport* r = AddCertificateReports(cert.get()); 709 StatsReport* r = AddCertificateReports(cert.get());
710 if (r) 710 if (r)
711 remote_cert_report_id = r->id(); 711 remote_cert_report_id = r->id();
712 } 712 }
713 713
714 for (const auto& channel_iter : transport_iter.second.channel_stats) { 714 for (const auto& channel_iter : transport_iter.second.channel_stats) {
715 StatsReport::Id id(StatsReport::NewComponentId( 715 StatsReport::Id id(StatsReport::NewComponentId(
716 transport_iter.second.transport_name, channel_iter.component)); 716 transport_iter.second.transport_name, channel_iter.component));
717 StatsReport* channel_report = reports_.ReplaceOrAddNew(id); 717 StatsReport* channel_report = reports_.ReplaceOrAddNew(id);
718 channel_report->set_timestamp(stats_gathering_started_); 718 channel_report->set_timestamp(stats_gathering_started_);
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 StatsReport* report = entry.second; 938 StatsReport* report = entry.second;
939 report->set_timestamp(stats_gathering_started_); 939 report->set_timestamp(stats_gathering_started_);
940 } 940 }
941 } 941 }
942 942
943 void StatsCollector::ClearUpdateStatsCacheForTest() { 943 void StatsCollector::ClearUpdateStatsCacheForTest() {
944 stats_gathering_started_ = 0; 944 stats_gathering_started_ = 0;
945 } 945 }
946 946
947 } // namespace webrtc 947 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/statscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698