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

Side by Side Diff: webrtc/api/stats/rtcstatsreport.h

Issue 2593503003: RTCStatsReport::AddStats DCHECKs that the ID is unique. (Closed)
Patch Set: Created 4 years 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/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstatsreport.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 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }; 51 };
52 52
53 // TODO(hbos): Remove "= 0" once Chromium unittest has been updated to call 53 // TODO(hbos): Remove "= 0" once Chromium unittest has been updated to call
54 // with a parameter. crbug.com/627816 54 // with a parameter. crbug.com/627816
55 static rtc::scoped_refptr<RTCStatsReport> Create(int64_t timestamp_us = 0); 55 static rtc::scoped_refptr<RTCStatsReport> Create(int64_t timestamp_us = 0);
56 56
57 explicit RTCStatsReport(int64_t timestamp_us); 57 explicit RTCStatsReport(int64_t timestamp_us);
58 RTCStatsReport(const RTCStatsReport& other) = delete; 58 RTCStatsReport(const RTCStatsReport& other) = delete;
59 59
60 int64_t timestamp_us() const { return timestamp_us_; } 60 int64_t timestamp_us() const { return timestamp_us_; }
61 bool AddStats(std::unique_ptr<const RTCStats> stats); 61 void AddStats(std::unique_ptr<const RTCStats> stats);
62 const RTCStats* Get(const std::string& id) const; 62 const RTCStats* Get(const std::string& id) const;
63 size_t size() const { return stats_.size(); } 63 size_t size() const { return stats_.size(); }
64 64
65 // Takes ownership of all the stats in |victim|, leaving it empty. 65 // Takes ownership of all the stats in |victim|, leaving it empty.
66 void TakeMembersFrom(rtc::scoped_refptr<RTCStatsReport> victim); 66 void TakeMembersFrom(rtc::scoped_refptr<RTCStatsReport> victim);
67 67
68 // Stats iterators. Stats are ordered lexicographically on |RTCStats::id|. 68 // Stats iterators. Stats are ordered lexicographically on |RTCStats::id|.
69 ConstIterator begin() const; 69 ConstIterator begin() const;
70 ConstIterator end() const; 70 ConstIterator end() const;
71 71
(...skipping 18 matching lines...) Expand all
90 private: 90 private:
91 ~RTCStatsReport() override; 91 ~RTCStatsReport() override;
92 92
93 int64_t timestamp_us_; 93 int64_t timestamp_us_;
94 StatsMap stats_; 94 StatsMap stats_;
95 }; 95 };
96 96
97 } // namespace webrtc 97 } // namespace webrtc
98 98
99 #endif // WEBRTC_API_STATS_RTCSTATSREPORT_H_ 99 #endif // WEBRTC_API_STATS_RTCSTATSREPORT_H_
OLDNEW
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstatsreport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698