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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 MediaStreamTrackInterface* track, | 879 MediaStreamTrackInterface* track, |
880 StatsOutputLevel level) { | 880 StatsOutputLevel level) { |
881 TRACE_EVENT0("webrtc", "PeerConnection::GetStats"); | 881 TRACE_EVENT0("webrtc", "PeerConnection::GetStats"); |
882 RTC_DCHECK(signaling_thread()->IsCurrent()); | 882 RTC_DCHECK(signaling_thread()->IsCurrent()); |
883 if (!VERIFY(observer != NULL)) { | 883 if (!VERIFY(observer != NULL)) { |
884 LOG(LS_ERROR) << "GetStats - observer is NULL."; | 884 LOG(LS_ERROR) << "GetStats - observer is NULL."; |
885 return false; | 885 return false; |
886 } | 886 } |
887 | 887 |
888 stats_->UpdateStats(level); | 888 stats_->UpdateStats(level); |
| 889 // The StatsCollector is used to tell if a track is valid because it may |
| 890 // remember tracks that the PeerConnection previously removed. |
| 891 if (track && !stats_->IsValidTrack(track->id())) { |
| 892 LOG(LS_WARNING) << "GetStats is called with an invalid track: " |
| 893 << track->id(); |
| 894 return false; |
| 895 } |
889 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_GETSTATS, | 896 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_GETSTATS, |
890 new GetStatsMsg(observer, track)); | 897 new GetStatsMsg(observer, track)); |
891 return true; | 898 return true; |
892 } | 899 } |
893 | 900 |
894 void PeerConnection::GetStats(RTCStatsCollectorCallback* callback) { | 901 void PeerConnection::GetStats(RTCStatsCollectorCallback* callback) { |
895 RTC_DCHECK(stats_collector_); | 902 RTC_DCHECK(stats_collector_); |
896 stats_collector_->GetStatsReport(callback); | 903 stats_collector_->GetStatsReport(callback); |
897 } | 904 } |
898 | 905 |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 | 2349 |
2343 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2350 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
2344 int64_t max_size_bytes) { | 2351 int64_t max_size_bytes) { |
2345 return event_log_->StartLogging(file, max_size_bytes); | 2352 return event_log_->StartLogging(file, max_size_bytes); |
2346 } | 2353 } |
2347 | 2354 |
2348 void PeerConnection::StopRtcEventLog_w() { | 2355 void PeerConnection::StopRtcEventLog_w() { |
2349 event_log_->StopLogging(); | 2356 event_log_->StopLogging(); |
2350 } | 2357 } |
2351 } // namespace webrtc | 2358 } // namespace webrtc |
OLD | NEW |