OLD | NEW |
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // FYI - for remote reports, the timestamp will be overwritten later. | 542 // FYI - for remote reports, the timestamp will be overwritten later. |
543 report->set_timestamp(stats_gathering_started_); | 543 report->set_timestamp(stats_gathering_started_); |
544 | 544 |
545 report->AddInt64(StatsReport::kStatsValueNameSsrc, ssrc); | 545 report->AddInt64(StatsReport::kStatsValueNameSsrc, ssrc); |
546 report->AddString(StatsReport::kStatsValueNameTrackId, track_id); | 546 report->AddString(StatsReport::kStatsValueNameTrackId, track_id); |
547 // Add the mapping of SSRC to transport. | 547 // Add the mapping of SSRC to transport. |
548 report->AddId(StatsReport::kStatsValueNameTransportId, transport_id); | 548 report->AddId(StatsReport::kStatsValueNameTransportId, transport_id); |
549 return report; | 549 return report; |
550 } | 550 } |
551 | 551 |
| 552 bool StatsCollector::IsValidTrack(const std::string& track_id) { |
| 553 return reports_.Find(StatsReport::NewTypedId( |
| 554 StatsReport::kStatsReportTypeTrack, track_id)) != nullptr; |
| 555 } |
| 556 |
552 StatsReport* StatsCollector::AddCertificateReports( | 557 StatsReport* StatsCollector::AddCertificateReports( |
553 const rtc::SSLCertificate* cert) { | 558 const rtc::SSLCertificate* cert) { |
554 RTC_DCHECK(pc_->session()->signaling_thread()->IsCurrent()); | 559 RTC_DCHECK(pc_->session()->signaling_thread()->IsCurrent()); |
555 RTC_DCHECK(cert != NULL); | 560 RTC_DCHECK(cert != NULL); |
556 | 561 |
557 std::unique_ptr<rtc::SSLCertificateStats> first_stats = cert->GetStats(); | 562 std::unique_ptr<rtc::SSLCertificateStats> first_stats = cert->GetStats(); |
558 StatsReport* first_report = nullptr; | 563 StatsReport* first_report = nullptr; |
559 StatsReport* prev_report = nullptr; | 564 StatsReport* prev_report = nullptr; |
560 for (rtc::SSLCertificateStats* stats = first_stats.get(); stats; | 565 for (rtc::SSLCertificateStats* stats = first_stats.get(); stats; |
561 stats = stats->issuer.get()) { | 566 stats = stats->issuer.get()) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 StatsReport* report = entry.second; | 980 StatsReport* report = entry.second; |
976 report->set_timestamp(stats_gathering_started_); | 981 report->set_timestamp(stats_gathering_started_); |
977 } | 982 } |
978 } | 983 } |
979 | 984 |
980 void StatsCollector::ClearUpdateStatsCacheForTest() { | 985 void StatsCollector::ClearUpdateStatsCacheForTest() { |
981 stats_gathering_started_ = 0; | 986 stats_gathering_started_ = 0; |
982 } | 987 } |
983 | 988 |
984 } // namespace webrtc | 989 } // namespace webrtc |
OLD | NEW |