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: webrtc/api/statscollector.h

Issue 2470023004: Return false if PeerConnection::GetStats() is called on invalid tracks (Closed)
Patch Set: Change the function parameter. 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 | « webrtc/api/peerconnectioninterface_unittest.cc ('k') | webrtc/api/statscollector.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void GetStats(MediaStreamTrackInterface* track, 71 void GetStats(MediaStreamTrackInterface* track,
72 StatsReports* reports); 72 StatsReports* reports);
73 73
74 // Prepare a local or remote SSRC report for the given ssrc. Used internally 74 // Prepare a local or remote SSRC report for the given ssrc. Used internally
75 // in the ExtractStatsFromList template. 75 // in the ExtractStatsFromList template.
76 StatsReport* PrepareReport(bool local, 76 StatsReport* PrepareReport(bool local,
77 uint32_t ssrc, 77 uint32_t ssrc,
78 const StatsReport::Id& transport_id, 78 const StatsReport::Id& transport_id,
79 StatsReport::Direction direction); 79 StatsReport::Direction direction);
80 80
81 // A track is invalid if there is no report data for it.
82 bool IsValidTrack(const std::string& track_id);
83
81 // Method used by the unittest to force a update of stats since UpdateStats() 84 // Method used by the unittest to force a update of stats since UpdateStats()
82 // that occur less than kMinGatherStatsPeriod number of ms apart will be 85 // that occur less than kMinGatherStatsPeriod number of ms apart will be
83 // ignored. 86 // ignored.
84 void ClearUpdateStatsCacheForTest(); 87 void ClearUpdateStatsCacheForTest();
85 88
86 private: 89 private:
87 friend class StatsCollectorTest; 90 friend class StatsCollectorTest;
88 91
89 // Overridden in unit tests to fake timing. 92 // Overridden in unit tests to fake timing.
90 virtual double GetTimeNow(); 93 virtual double GetTimeNow();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // TODO(tommi): We appear to be holding on to raw pointers to reference 143 // TODO(tommi): We appear to be holding on to raw pointers to reference
141 // counted objects? We should be using scoped_refptr here. 144 // counted objects? We should be using scoped_refptr here.
142 typedef std::vector<std::pair<AudioTrackInterface*, uint32_t> > 145 typedef std::vector<std::pair<AudioTrackInterface*, uint32_t> >
143 LocalAudioTrackVector; 146 LocalAudioTrackVector;
144 LocalAudioTrackVector local_audio_tracks_; 147 LocalAudioTrackVector local_audio_tracks_;
145 }; 148 };
146 149
147 } // namespace webrtc 150 } // namespace webrtc
148 151
149 #endif // WEBRTC_API_STATSCOLLECTOR_H_ 152 #endif // WEBRTC_API_STATSCOLLECTOR_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface_unittest.cc ('k') | webrtc/api/statscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698