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

Unified Diff: webrtc/api/rtcstatsreport.h

Issue 2331373004: PeerConnection[Interface]::GetStats(RTCStatsCollectorCallback*) added. (Closed)
Patch Set: (Corrected an incorrect inclusion) Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/api/stats/rtcstats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtcstatsreport.h
diff --git a/webrtc/api/rtcstatsreport.h b/webrtc/api/rtcstatsreport.h
index fbd78b93f4e970ff0ca43c737404f4bfa6a18a2d..b16a53b588eb2824e83b525a82f4ce378ab40fbc 100644
--- a/webrtc/api/rtcstatsreport.h
+++ b/webrtc/api/rtcstatsreport.h
@@ -8,83 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_API_RTCSTATSREPORT_H_
-#define WEBRTC_API_RTCSTATSREPORT_H_
+// TODO(hbos): Remove this file once Chromium uses the correct include path.
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "webrtc/api/rtcstats.h"
-#include "webrtc/base/refcount.h"
-#include "webrtc/base/scoped_ref_ptr.h"
-
-namespace webrtc {
-
-// A collection of stats.
-// This is accessible as a map from |RTCStats::id| to |RTCStats|.
-class RTCStatsReport : public rtc::RefCountInterface {
- public:
- typedef std::map<std::string, std::unique_ptr<const RTCStats>> StatsMap;
-
- class ConstIterator {
- public:
- ConstIterator(const ConstIterator&& other);
- ~ConstIterator();
-
- ConstIterator& operator++();
- ConstIterator& operator++(int);
- const RTCStats& operator*() const;
- bool operator==(const ConstIterator& other) const;
- bool operator!=(const ConstIterator& other) const;
-
- private:
- friend class RTCStatsReport;
- ConstIterator(const rtc::scoped_refptr<const RTCStatsReport>& report,
- StatsMap::const_iterator it);
-
- // Reference report to make sure it is kept alive.
- rtc::scoped_refptr<const RTCStatsReport> report_;
- StatsMap::const_iterator it_;
- };
-
- static rtc::scoped_refptr<RTCStatsReport> Create();
-
- RTCStatsReport();
- RTCStatsReport(const RTCStatsReport& other) = delete;
-
- bool AddStats(std::unique_ptr<const RTCStats> stats);
- const RTCStats* Get(const std::string& id) const;
- size_t size() const { return stats_.size(); }
-
- // Takes ownership of all the stats in |victim|, leaving it empty.
- void TakeMembersFrom(rtc::scoped_refptr<RTCStatsReport> victim);
-
- // Stats iterators. Stats are ordered lexicographically on |RTCStats::id|.
- ConstIterator begin() const;
- ConstIterator end() const;
-
- // Gets the subset of stats that are of type |T|, where |T| is any class
- // descending from |RTCStats|.
- template<typename T>
- std::vector<const T*> GetStatsOfType() const {
- std::vector<const T*> stats_of_type;
- for (const RTCStats& stats : *this) {
- if (stats.type() == T::kType)
- stats_of_type.push_back(&stats.cast_to<const T>());
- }
- return stats_of_type;
- }
-
- friend class rtc::RefCountedObject<RTCStatsReport>;
-
- private:
- ~RTCStatsReport() override;
-
- StatsMap stats_;
-};
-
-} // namespace webrtc
-
-#endif // WEBRTC_API_RTCSTATSREPORT_H_
+#include "webrtc/api/stats/rtcstatsreport.h"
« no previous file with comments | « webrtc/api/rtcstatscollector_unittest.cc ('k') | webrtc/api/stats/rtcstats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698