| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RTCStatsReport_h | 5 #ifndef RTCStatsReport_h |
| 6 #define RTCStatsReport_h | 6 #define RTCStatsReport_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/Maplike.h" | 8 #include "bindings/core/v8/Maplike.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "platform/heap/GarbageCollected.h" | 10 #include "platform/heap/GarbageCollected.h" |
| 11 #include "platform/wtf/text/WTFString.h" | 11 #include "platform/wtf/text/WTFString.h" |
| 12 #include "public/platform/WebCString.h" | 12 #include "public/platform/WebCString.h" |
| 13 #include "public/platform/WebRTCStats.h" | 13 #include "public/platform/WebRTCStats.h" |
| 14 | 14 |
| 15 #include <map> | 15 #include <map> |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 // https://w3c.github.io/webrtc-pc/#rtcstatsreport-object | 19 // https://w3c.github.io/webrtc-pc/#rtcstatsreport-object |
| 20 class RTCStatsReport final : public GarbageCollectedFinalized<RTCStatsReport>, | 20 class RTCStatsReport final : public GarbageCollectedFinalized<RTCStatsReport>, |
| 21 public ScriptWrappable, | 21 public ScriptWrappable, |
| 22 public Maplike<String, v8::Local<v8::Value>> { | 22 public Maplike<String, v8::Local<v8::Value>> { |
| 23 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 | 24 |
| 25 public: | 25 public: |
| 26 RTCStatsReport(std::unique_ptr<WebRTCStatsReport>); | 26 RTCStatsReport(std::unique_ptr<WebRTCStatsReport>); |
| 27 | 27 |
| 28 size_t size() const { return report_->Size(); } |
| 29 |
| 28 // Maplike<String, v8::Local<v8::Value>> | 30 // Maplike<String, v8::Local<v8::Value>> |
| 29 PairIterable<String, v8::Local<v8::Value>>::IterationSource* StartIteration( | 31 PairIterable<String, v8::Local<v8::Value>>::IterationSource* StartIteration( |
| 30 ScriptState*, | 32 ScriptState*, |
| 31 ExceptionState&) override; | 33 ExceptionState&) override; |
| 32 bool GetMapEntry(ScriptState*, | 34 bool GetMapEntry(ScriptState*, |
| 33 const String& key, | 35 const String& key, |
| 34 v8::Local<v8::Value>&, | 36 v8::Local<v8::Value>&, |
| 35 ExceptionState&) override; | 37 ExceptionState&) override; |
| 36 | 38 |
| 37 DEFINE_INLINE_VIRTUAL_TRACE() {} | 39 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 std::unique_ptr<WebRTCStatsReport> report_; | 42 std::unique_ptr<WebRTCStatsReport> report_; |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 } // namespace blink | 45 } // namespace blink |
| 44 | 46 |
| 45 #endif // RTCStatsReport_h | 47 #endif // RTCStatsReport_h |
| OLD | NEW |