Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_ | |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "third_party/WebKit/public/platform/WebRTCStats.h" | |
| 10 #include "third_party/webrtc/api/rtcstats.h" | |
| 11 #include "third_party/webrtc/api/rtcstatsreport.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 class RTCStatsReport : public blink::WebRTCStatsReport { | |
| 16 public: | |
| 17 RTCStatsReport( | |
| 18 const scoped_refptr<const webrtc::RTCStatsReport>& stats_report); | |
| 19 ~RTCStatsReport() override; | |
| 20 | |
| 21 std::unique_ptr<blink::WebRTCStats> next() override; | |
| 22 | |
| 23 private: | |
| 24 const scoped_refptr<const webrtc::RTCStatsReport> stats_report_; | |
| 25 webrtc::RTCStatsReport::ConstIterator it_; | |
| 26 const webrtc::RTCStatsReport::ConstIterator end_; | |
| 27 }; | |
| 28 | |
| 29 class RTCStats : public blink::WebRTCStats { | |
| 30 public: | |
| 31 RTCStats(const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, | |
| 32 const webrtc::RTCStats* stats); | |
| 33 ~RTCStats() override; | |
| 34 | |
| 35 blink::WebString id() const override; | |
| 36 blink::WebString type() const override; | |
| 37 double timestamp() const override; | |
| 38 | |
| 39 size_t membersCount() const override; | |
| 40 std::unique_ptr<blink::WebRTCStatsMember> getMember(size_t i) const override; | |
| 41 | |
| 42 private: | |
| 43 // Referencing the owning report protects |stats_| from destruction. | |
|
perkj_chrome
2016/09/09 07:10:40
owning report protects ?
hbos_chromium
2016/09/09 08:47:33
Done.
| |
| 44 const scoped_refptr<const webrtc::RTCStatsReport> stats_owner_; | |
| 45 // Pointer to a stats object that is owned by |stats_owner_|. | |
| 46 const webrtc::RTCStats* const stats_; | |
| 47 const std::vector<const webrtc::RTCStatsMemberInterface*> stats_members_; | |
|
perkj_chrome
2016/09/09 07:10:40
and a comment about stats_members_?
hbos_chromium
2016/09/09 08:47:33
Done.
| |
| 48 }; | |
| 49 | |
| 50 class RTCStatsMember : public blink::WebRTCStatsMember { | |
| 51 public: | |
| 52 RTCStatsMember(const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, | |
| 53 const webrtc::RTCStatsMemberInterface* member); | |
| 54 ~RTCStatsMember() override; | |
| 55 | |
| 56 blink::WebString name() const override; | |
| 57 blink::WebRTCStatsMemberType type() const override; | |
| 58 | |
| 59 int32_t valueInt32() const override; | |
| 60 uint32_t valueUint32() const override; | |
| 61 int64_t valueInt64() const override; | |
| 62 uint64_t valueUint64() const override; | |
| 63 double valueDouble() const override; | |
| 64 blink::WebString valueString() const override; | |
| 65 blink::WebVector<int32_t> valueSequenceInt32() const override; | |
| 66 blink::WebVector<uint32_t> valueSequenceUint32() const override; | |
| 67 blink::WebVector<int64_t> valueSequenceInt64() const override; | |
| 68 blink::WebVector<uint64_t> valueSequenceUint64() const override; | |
| 69 blink::WebVector<double> valueSequenceDouble() const override; | |
| 70 blink::WebVector<blink::WebString> valueSequenceString() const override; | |
| 71 | |
| 72 private: | |
| 73 // Referencing the owning report protects |member_| from destruction. | |
|
perkj_chrome
2016/09/09 07:10:40
dito
hbos_chromium
2016/09/09 08:47:33
Done.
| |
| 74 const scoped_refptr<const webrtc::RTCStatsReport> stats_owner_; | |
| 75 // Pointer to member of a stats object that is owned by |stats_owner_|. | |
| 76 const webrtc::RTCStatsMemberInterface* const member_; | |
| 77 }; | |
| 78 | |
| 79 } // namespace content | |
| 80 | |
| 81 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_ | |
| OLD | NEW |