| Index: content/renderer/media/webrtc/rtc_stats.h
|
| diff --git a/content/renderer/media/webrtc/rtc_stats.h b/content/renderer/media/webrtc/rtc_stats.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4aac0b2749b696d603345b1136c4754b9d1486a4
|
| --- /dev/null
|
| +++ b/content/renderer/media/webrtc/rtc_stats.h
|
| @@ -0,0 +1,69 @@
|
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_
|
| +#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_
|
| +
|
| +#include "base/memory/ref_counted.h"
|
| +#include "third_party/WebKit/public/platform/WebRTCStats.h"
|
| +#include "third_party/webrtc/api/rtcstats.h"
|
| +#include "third_party/webrtc/api/rtcstatsreport.h"
|
| +
|
| +namespace content {
|
| +
|
| +class RTCStats : public blink::WebRTCStats {
|
| + public:
|
| + RTCStats(scoped_refptr<const webrtc::RTCStatsReport> stats_owner,
|
| + const webrtc::RTCStats* stats);
|
| + ~RTCStats() override;
|
| +
|
| + blink::WebString id() const override;
|
| + blink::WebString type() const override;
|
| + double timestamp() const override;
|
| +
|
| + size_t membersCount() const override;
|
| + // The member is valid as long as this |RTCStats| object is alive. Do not use
|
| + // the member object after this object is destroyed.
|
| + std::unique_ptr<blink::WebRTCStatsMember> getMember(size_t i) const override;
|
| +
|
| + private:
|
| + // |stats_| are owned by |stats_owner_|, keeping a reference to the owning
|
| + // report protects it from destruction.
|
| + scoped_refptr<const webrtc::RTCStatsReport> stats_owner_;
|
| + const webrtc::RTCStats* stats_;
|
| + // Members of |stats_|, same as |stats_->Members()|.
|
| + std::vector<const webrtc::RTCStatsMemberInterface*> members_;
|
| +};
|
| +
|
| +class RTCStatsMember : public blink::WebRTCStatsMember {
|
| + public:
|
| + RTCStatsMember(const webrtc::RTCStatsMemberInterface* member);
|
| +
|
| + blink::WebString name() const override;
|
| + blink::WebRTCStatsMemberType type() const override;
|
| +
|
| + int32_t valueInt32() const override;
|
| + uint32_t valueUint32() const override;
|
| + int64_t valueInt64() const override;
|
| + uint64_t valueUint64() const override;
|
| + double valueDouble() const override;
|
| + const char* valueStaticString() const override;
|
| + const std::string& valueString() const override;
|
| + const std::vector<int32_t>& valueSequenceInt32() const override;
|
| + const std::vector<uint32_t>& valueSequenceUint32() const override;
|
| + const std::vector<int64_t>& valueSequenceInt64() const override;
|
| + const std::vector<uint64_t>& valueSequenceUint64() const override;
|
| + const std::vector<double>& valueSequenceDouble() const override;
|
| + const std::vector<const char*>& valueSequenceStaticString() const override;
|
| + const std::vector<std::string>& valueSequenceString() const override;
|
| +
|
| + private:
|
| + // Owned by the stats whose member this is. Not to be used after the
|
| + // |RTCStats| that constructed this object is destroyed.
|
| + const webrtc::RTCStatsMemberInterface* member_;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_STATS_H_
|
|
|