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

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

Issue 2470023004: Return false if PeerConnection::GetStats() is called on invalid tracks (Closed)
Patch Set: Created 4 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 | « no previous file | webrtc/api/peerconnectioninterface_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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!stats_->IsValidTrack(track)) {
Taylor Brandstetter 2016/11/03 22:47:01 May be worth logging a warning here. Also, you co
Zhi Huang 2016/11/03 23:17:27 I realized that the nullptr is not an error. The n
890 return false;
891 }
889 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_GETSTATS, 892 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_GETSTATS,
890 new GetStatsMsg(observer, track)); 893 new GetStatsMsg(observer, track));
891 return true; 894 return true;
892 } 895 }
893 896
894 void PeerConnection::GetStats(RTCStatsCollectorCallback* callback) { 897 void PeerConnection::GetStats(RTCStatsCollectorCallback* callback) {
895 RTC_DCHECK(stats_collector_); 898 RTC_DCHECK(stats_collector_);
896 stats_collector_->GetStatsReport(callback); 899 stats_collector_->GetStatsReport(callback);
897 } 900 }
898 901
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 2344
2342 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, 2345 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
2343 int64_t max_size_bytes) { 2346 int64_t max_size_bytes) {
2344 return event_log_->StartLogging(file, max_size_bytes); 2347 return event_log_->StartLogging(file, max_size_bytes);
2345 } 2348 }
2346 2349
2347 void PeerConnection::StopRtcEventLog_w() { 2350 void PeerConnection::StopRtcEventLog_w() {
2348 event_log_->StopLogging(); 2351 event_log_->StopLogging();
2349 } 2352 }
2350 } // namespace webrtc 2353 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698